libxmp/libxmpf in Omni Compiler  1.3.4
_xmpco_alloc.h File Reference
#include "xmpco_internal.h"
#include "_xmpco_alloc.h"
Include dependency graph for _xmpco_alloc.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  _resourceSet_t
 MEMORY MANAGEMENT STRUCTURE-I (for automatic deallocation) runtime resource corresponding to a procedure or to the entire program. More...
 
struct  _memoryChunk_t
 structure for each malloc/free call Every memory chunk is linked both: More...
 
struct  _coarrayInfo_t
 structure for each coarray variable One or more coarrays can be linked from a single memory chunk and be malloc'ed and be free'd together. More...
 
struct  _memoryChunkOrder_t
 MEMORY MANAGEMENT STRUCTURE-II (for dynamic ALLOCATE/DEALLOCATE stmts. More...
 
struct  _sortedChunkTable_t
 MEMORY MANAGEMENT STRUCTURE-III (for binary search for memory chunk) table of memory chunks sorted in order of local address. More...
 

Macros

#define _SortedChunkTableInitSize   256
 
#define DIV_CEILING(m, n)   (((m)-1)/(n)+1)
 
#define forallMemoryChunkOrder(cp)
 
#define forallMemoryChunkOrderRev(cp)
 
#define forallResourceSet(rs)
 
#define forallResourceSetRev(rs)
 
#define forallMemoryChunk(chk, rs)
 
#define forallMemoryChunkRev(chk, rs)
 
#define forallCoarrayInfo(ci, chk)
 
#define IsFirstCoarrayInfo(ci)   ((ci)->prev->prev == NULL)
 
#define IsLastCoarrayInfo(ci)   ((ci)->next->next == NULL)
 
#define IsOnlyCoarrayInfo(ci)   (IsFirstCoarrayInfo(ci) && IsLastCoarrayInfo(ci))
 
#define IsFirstMemoryChunk(chk)   ((chk)->prev->prev == NULL)
 
#define IsLastMemoryChunk(chk)   ((chk)->next->next == NULL)
 
#define IsEmptyMemoryChunk(chk)   ((chk)->headCoarray->next->next == NULL)
 
#define IsEmptyResourceSet(rs)   ((rs)->headChunk->next->next == NULL)
 

Macro Definition Documentation

◆ _SortedChunkTableInitSize

#define _SortedChunkTableInitSize   256

◆ DIV_CEILING

#define DIV_CEILING (   m,
 
)    (((m)-1)/(n)+1)

◆ forallCoarrayInfo

#define forallCoarrayInfo (   ci,
  chk 
)
Value:
for(CoarrayInfo_t *_ci1_ = ((ci)=(chk)->headCoarray->next)->next; \
_ci1_ != NULL; \
(ci) = _ci1_, _ci1_=_ci1_->next)

◆ forallMemoryChunk

#define forallMemoryChunk (   chk,
  rs 
)
Value:
for(MemoryChunk_t *_chk1_=((chk)=(rs)->headChunk->next)->next; \
_chk1_ != NULL; \
(chk)=_chk1_, _chk1_=_chk1_->next)

◆ forallMemoryChunkOrder

#define forallMemoryChunkOrder (   cp)
Value:
for(MemoryChunkOrder_t *_cp1_=((cp)=_mallocStack.head->next)->next; \
_cp1_ != NULL; \
(cp)=_cp1_, _cp1_=_cp1_->next)

◆ forallMemoryChunkOrderRev

#define forallMemoryChunkOrderRev (   cp)
Value:
for(MemoryChunkOrder_t *_cp1_=((cp)=_mallocStack.tail->prev)->prev; \
_cp1_ != NULL; \
(cp)=_cp1_, _cp1_=_cp1_->prev)

◆ forallMemoryChunkRev

#define forallMemoryChunkRev (   chk,
  rs 
)
Value:
for(MemoryChunk_t *_chk1_=((chk)=(rs)->tailChunk->prev)->prev; \
_chk1_ != NULL; \
(chk) = _chk1_, _chk1_=_chk1_->prev)

◆ forallResourceSet

#define forallResourceSet (   rs)
Value:
for(ResourceSet_t *_rs1_=((rs)=_headResourceSet->next)->next; \
_rs1_ != NULL; \
(rs)=_rs1_, _rs1_=_rs1_->next)

◆ forallResourceSetRev

#define forallResourceSetRev (   rs)
Value:
for(ResourceSet_t *_rs1_=((rs)=_tailResourceSet->prev)->prev; \
_rs1_ != NULL; \
(rs)=_rs1_, _rs1_=_rs1_->prev)

◆ IsEmptyMemoryChunk

#define IsEmptyMemoryChunk (   chk)    ((chk)->headCoarray->next->next == NULL)

◆ IsEmptyResourceSet

#define IsEmptyResourceSet (   rs)    ((rs)->headChunk->next->next == NULL)

◆ IsFirstCoarrayInfo

#define IsFirstCoarrayInfo (   ci)    ((ci)->prev->prev == NULL)

◆ IsFirstMemoryChunk

#define IsFirstMemoryChunk (   chk)    ((chk)->prev->prev == NULL)

◆ IsLastCoarrayInfo

#define IsLastCoarrayInfo (   ci)    ((ci)->next->next == NULL)

◆ IsLastMemoryChunk

#define IsLastMemoryChunk (   chk)    ((chk)->next->next == NULL)

◆ IsOnlyCoarrayInfo

#define IsOnlyCoarrayInfo (   ci)    (IsFirstCoarrayInfo(ci) && IsLastCoarrayInfo(ci))
_resourceSet_t
MEMORY MANAGEMENT STRUCTURE-I (for automatic deallocation) runtime resource corresponding to a proced...
Definition: _xmpco_alloc.h:64
_XMP_gpu_data_type::host_array_desc
_XMP_array_t * host_array_desc
Definition: xmp_data_struct.h:484
_mallocStack
struct @2 _mallocStack
_XMP_array_info_type::shadow_comm_rank
int shadow_comm_rank
Definition: xmp_data_struct.h:257
_XMP_alloc
void * _XMP_alloc(size_t size)
Definition: xmp_util.c:21
xmp_gpu_internal.h
_XMP_array_info_type
Definition: xmp_data_struct.h:194
_XMP_gpu_data_type::device_array_desc
_XMP_gpu_array_t * device_array_desc
Definition: xmp_data_struct.h:485
_XMP_gpu_unpack_array
void _XMP_gpu_unpack_array(_XMP_gpu_array_t *device_desc, void *gpu_array_addr, void *host_shadow_buffer, size_t type_size, size_t alloc_size, int array_dim, int *lower, int *upper, int *stride)
_memoryChunkOrder_t::prev
MemoryChunkOrder_t * prev
Definition: _xmpco_alloc.h:112
_XMP_array_info_type::shadow_comm_size
int shadow_comm_size
Definition: xmp_data_struct.h:256
_XMP_gpu_pack_array
void _XMP_gpu_pack_array(_XMP_gpu_array_t *device_desc, void *host_shadow_buffer, void *gpu_array_addr, size_t type_size, size_t alloc_size, int array_dim, int *lower, int *upper, int *stride)
_XMP_gpu_device_count
int _XMP_gpu_device_count
_XMP_array_info_type::dim_elmts
unsigned long long dim_elmts
Definition: xmp_data_struct.h:243
_XMP_array_info_type::local_stride
int local_stride
Definition: xmp_data_struct.h:211
_XMP_array_info_type::shadow_size_lo
int shadow_size_lo
Definition: xmp_data_struct.h:249
_XMP_array_info_type::align_manner
int align_manner
Definition: xmp_data_struct.h:197
xmp_get_gpu_count
int xmp_get_gpu_count(void)
Definition: xmp_gpu_lib.c:3
_XMP_gpu_array_type
Definition: xmp_data_struct.h:475
_XMP_gpu_unpack_shadow_NORMAL
void _XMP_gpu_unpack_shadow_NORMAL(_XMP_gpu_data_t *desc, void *lo_buffer, void *hi_buffer, int array_index)
Definition: xmp_gpu_shadow.c:108
_XMP_array_info_type::local_lower
int local_lower
Definition: xmp_data_struct.h:209
_XMP_array_info_type::shadow_size_hi
int shadow_size_hi
Definition: xmp_data_struct.h:250
_XMP_gpu_data_type::device_addr
void * device_addr
Definition: xmp_data_struct.h:483
_XMP_gpu_data_type
Definition: xmp_data_struct.h:480
_XMP_array_type
Definition: xmp_data_struct.h:266
_XMP_array_type::type_size
size_t type_size
Definition: xmp_data_struct.h:274
_XMP_N_ALIGN_BLOCK
#define _XMP_N_ALIGN_BLOCK
Definition: xmp_constant.h:37
_XMP_array_type::info
_XMP_array_info_t info[1]
Definition: xmp_data_struct.h:313
_XMP_free
void _XMP_free(void *p)
Definition: xmp_util.c:37
_XMP_ASSERT
#define _XMP_ASSERT(_flag)
Definition: xmp_internal.h:34
_memoryChunk_t
structure for each malloc/free call Every memory chunk is linked both:
Definition: _xmpco_alloc.h:76
_XMP_threads_init
void _XMP_threads_init(void)
Definition: xmp_threads_runtime.c:3
_XMP_array_type::dim
int dim
Definition: xmp_data_struct.h:272
_memoryChunk_t::next
MemoryChunk_t * next
Definition: _xmpco_alloc.h:78
_memoryChunkOrder_t::next
MemoryChunkOrder_t * next
Definition: _xmpco_alloc.h:113
_XMP_fatal
void _XMP_fatal(char *msg)
Definition: xmp_util.c:42
_memoryChunkOrder_t
MEMORY MANAGEMENT STRUCTURE-II (for dynamic ALLOCATE/DEALLOCATE stmts.
Definition: _xmpco_alloc.h:111
_XMP_array_info_type::par_size
int par_size
Definition: xmp_data_struct.h:207
xmp_internal.h
_XMP_gpu_pack_shadow_NORMAL
void _XMP_gpu_pack_shadow_NORMAL(_XMP_gpu_data_t *desc, void **lo_buffer, void **hi_buffer, int array_index)
Definition: xmp_gpu_shadow.c:17
_XMP_RETURN_IF_SINGLE
#define _XMP_RETURN_IF_SINGLE
Definition: xmp_internal.h:37
_memoryChunk_t::prev
MemoryChunk_t * prev
Definition: _xmpco_alloc.h:77
_coarrayInfo_t::next
CoarrayInfo_t * next
Definition: _xmpco_alloc.h:94
_coarrayInfo_t
structure for each coarray variable One or more coarrays can be linked from a single memory chunk and...
Definition: _xmpco_alloc.h:92
_XMP_threads_finalize
void _XMP_threads_finalize(void)
Definition: xmp_threads_runtime.c:7
_XMP_array_type::is_allocated
_Bool is_allocated
Definition: xmp_data_struct.h:270
xmp_constant.h
_XMP_array_info_type::is_shadow_comm_member
_Bool is_shadow_comm_member
Definition: xmp_data_struct.h:195
_XMP_array_info_type::local_upper
int local_upper
Definition: xmp_data_struct.h:210