File indexing completed on 2023-05-28 05:10:56 UTC
view on githubraw file Latest commit b4daa243 on 2023-05-28 03:53:22 UTC
b4daa24319 Shre*0001
0002 //# if defined(__cplusplus)
0003 // extern "C" {
0004 //# endif
0005
0006 /** Re-base restored pointers *pp (and possibly it adjoint *ppb) from their
0007 * old base from the forward sweep to their new base in the backward sweep.
0008 * When new base is not available yet, schedules this to be done later
0009 * when a new base is allocated.
0010 * Usage: restoring a pointer pp (i.e. declared as T* pp ;) creates in the backward sweep:
0011 * poppointer8((void**)(&pp)) ;
0012 * and/or possibly:
0013 * poppointer8((void**)(&ppb)) ;
0014 * then add after these pop(s):
0015 * ADMM_rebaseShadowed((void**)(&pp), (void**)(&ppb)) ;
0016 * or if no ppb:
0017 * ADMM_rebase((void**)(&pp)) ;
0018 */
0019 void ADMM_rebaseShadowed(void **pp, void **ppb
0020 #ifdef ADMM_LABELS
0021 , char *label
0022 #endif
0023 );
0024 void ADMM_rebase(void **pp
0025 #ifdef ADMM_LABELS
0026 , char *label
0027 #endif
0028 );
0029
0030 /** Register a newly allocated memory chunk in the forward sweep (when obase==null or ==base),
0031 * or register a newly allocated memory chunk "base" in the backward sweep relating it
0032 * with its corresponding chunk from the forward sweep "obase".
0033 * "sizeInBytes" is the total size in bytes of the allocated chunk.
0034 * When the corresponding derivative chunks exist separately ("Shadowed" mode),
0035 * then do the same with the info about the derivative
0036 * chunks "baseb", "obaseb" and "sizeInBytesb".
0037 * "nbElements" is the length i.e. the number of elements of the allocated array. */
0038 void ADMM_registerShadowed(void *base, void *obase, int sizeInBytes, void *baseb, void **alreadyRebasedb, void *obaseb, int sizeInBytesb, int nbElements
0039 #ifdef ADMM_LABELS
0040 , char *label
0041 #endif
0042 ) ;
0043 void ADMM_register(void *base, void **alreadyRebased, void *obase, int sizeInBytes, int nbElements
0044 #ifdef ADMM_LABELS
0045 , char *label
0046 #endif
0047 ) ;
0048
0049 /** Unregister a memory chunk, which must be done when this chunk is about to be deallocated.
0050 * Returns in "nbElements" the length i.e. the number of elements of the array
0051 * that is about to be deallocated. */
0052 void ADMM_unregisterShadowed(void *base, void *baseb, int *nbElements
0053 #ifdef ADMM_LABELS
0054 , char *label
0055 #endif
0056 ) ;
0057 void ADMM_unregister(void *base, int *nbElements
0058 #ifdef ADMM_LABELS
0059 , char *label
0060 #endif
0061 ) ;
0062
0063 void ADMM_statistics();
0064
0065 //# if defined(__cplusplus)
0066 // }
0067 //# endif