Legion Runtime
|
#include <legion.h>
Public Member Functions | |
FieldAllocator (const FieldAllocator &allocator) | |
FieldAllocator (FieldAllocator &&allocator) noexcept | |
FieldAllocator & | operator= (const FieldAllocator &allocator) |
FieldAllocator & | operator= (FieldAllocator &&allocator) noexcept |
bool | operator< (const FieldAllocator &rhs) const |
bool | operator== (const FieldAllocator &rhs) const |
bool | exists (void) const |
void | free_field (FieldID fid, const bool unordered=false, const char *provenance=NULL) |
FieldID | allocate_local_field (size_t field_size, FieldID desired_fieldid=LEGION_AUTO_GENERATE_ID, CustomSerdezID serdez_id=0, const char *provenance=NULL) |
void | free_fields (const std::set< FieldID > &to_free, const bool unordered=false, const char *provenance=NULL) |
void | allocate_local_fields (const std::vector< size_t > &field_sizes, std::vector< FieldID > &resulting_fields, CustomSerdezID serdez_id=0, const char *provenance=NULL) |
FieldSpace | get_field_space (void) const |
FieldID | allocate_field (size_t field_size, FieldID desired_fieldid=LEGION_AUTO_GENERATE_ID, CustomSerdezID serdez_id=0, bool local_field=false, const char *provenance=NULL) |
FieldID | allocate_field (const Future &field_size, FieldID desired_fieldid=LEGION_AUTO_GENERATE_ID, CustomSerdezID serdez_id=0, bool local_field=false, const char *provenance=NULL) |
void | allocate_fields (const std::vector< size_t > &field_sizes, std::vector< FieldID > &resulting_fields, CustomSerdezID serdez_id=0, bool local_fields=false, const char *provenance=NULL) |
void | allocate_fields (const std::vector< Future > &field_sizes, std::vector< FieldID > &resulting_fields, CustomSerdezID serdez_id=0, bool local_fields=false, const char *provenance=NULL) |
![]() | |
size_t | legion_buffer_size (void) |
size_t | legion_serialize (void *buffer) |
size_t | legion_deserialize (const void *buffer) |
Protected Member Functions | |
FRIEND_ALL_RUNTIME_CLASSES | FieldAllocator (Internal::FieldAllocatorImpl *impl) |
Field allocators provide objects for performing allocation on field spaces. They must be explicitly created by the runtime so that they can be linked back to the runtime. Field allocators can be passed by value to functions and stored in data structures, but they should never escape the enclosing context in which they were created.
Field space allocators operate on a single field space which is immutable. Separate field space allocators must be made to perform allocations on different field spaces.
FieldID Legion::FieldAllocator::allocate_field | ( | size_t | field_size, |
FieldID | desired_fieldid = LEGION_AUTO_GENERATE_ID , |
||
CustomSerdezID | serdez_id = 0 , |
||
bool | local_field = false , |
||
const char * | provenance = NULL |
||
) |
Allocate a field with a given size. Optionally specify the field ID to be assigned. Note if you use LEGION_AUTO_GENERATE_ID, then all fields for the field space should be generated this way or field names may be deduplicated as the runtime will not check against user assigned field names when generating its own.
field_size | size of the field to be allocated |
desired_fieldid | field ID to be assigned to the field or LEGION_AUTO_GENERATE_ID to specify that the runtime should assign a fresh field ID |
serdez_id | optional parameter for specifying a custom serdez object for serializing and deserializing a field when it is moved. |
local_field | whether this is a local field or not |
provenance | an optional string describing the provenance information for this index space |
void Legion::FieldAllocator::allocate_fields | ( | const std::vector< size_t > & | field_sizes, |
std::vector< FieldID > & | resulting_fields, | ||
CustomSerdezID | serdez_id = 0 , |
||
bool | local_fields = false , |
||
const char * | provenance = NULL |
||
) |
Allocate a collection of fields with the specified sizes. Optionally pass in a set of field IDs to use when allocating the fields otherwise the vector should be empty or the same size as field_sizes with LEGION_AUTO_GENERATE_ID set as the value for each of the resulting_field IDs. The length of the resulting_fields vector must be less than or equal to the length of field_sizes. Upon return it will be the same size with field IDs specified for all the allocated fields
field_sizes | size in bytes of the fields to be allocated |
resulting_fields | optional field names for allocated fields |
local_fields | whether these should be local fields or not |
provenance | an optional string describing the provenance information for this index space |
FieldID Legion::FieldAllocator::allocate_local_field | ( | size_t | field_size, |
FieldID | desired_fieldid = LEGION_AUTO_GENERATE_ID , |
||
CustomSerdezID | serdez_id = 0 , |
||
const char * | provenance = NULL |
||
) |
Same as allocate field, but this field will only be available locally on the node on which it is created and not on remote nodes. It will then be implicitly destroyed once the task in which it is allocated completes.
void Legion::FieldAllocator::allocate_local_fields | ( | const std::vector< size_t > & | field_sizes, |
std::vector< FieldID > & | resulting_fields, | ||
CustomSerdezID | serdez_id = 0 , |
||
const char * | provenance = NULL |
||
) |
Same as allocate_fields but the fields that are allocated will only be available locally on the node on which this call is made and not on remote nodes. The fields will be implicitly destroyed once the task in which they were created completes.
void Legion::FieldAllocator::free_field | ( | FieldID | fid, |
const bool | unordered = false , |
||
const char * | provenance = NULL |
||
) |
Deallocate the specified field from the field space.
fid | the field ID to be deallocated |
unordered | set to true if this is performed by a different thread than the one for the task (e.g a garbage collector) |
provenance | an optional string describing the provenance information for this index space |
void Legion::FieldAllocator::free_fields | ( | const std::set< FieldID > & | to_free, |
const bool | unordered = false , |
||
const char * | provenance = NULL |
||
) |
Free a collection of field IDs
to_free | set of field IDs to be freed |
unordered | set to true if this is performed by a different thread than the one for the task (e.g a garbage collector) |
provenance | an optional string describing the provenance information for this index space |
FieldSpace Legion::FieldAllocator::get_field_space | ( | void | ) | const |