legate::mapping::InstanceMappingPolicy#
-
class InstanceMappingPolicy#
A descriptor for instance mapping policy.
Public Functions
-
inline InstanceMappingPolicy &with_target(StoreTarget target) &#
Changes the store target.
- Parameters:
target – A new store target
- Returns:
This instance mapping policy
- inline InstanceMappingPolicy &with_allocation_policy(
- AllocPolicy allocation
Changes the allocation policy.
- Parameters:
allocation – A new allocation policy
- Returns:
This instance mapping policy
-
inline InstanceMappingPolicy &with_ordering(DimOrdering ordering) &#
Changes the dimension ordering.
- Parameters:
ordering – A new dimension ordering
- Returns:
This instance mapping policy
-
inline InstanceMappingPolicy &with_exact(bool exact) &#
Changes the value of
exact- Parameters:
exact – A new value for the
exactfield- Returns:
This instance mapping policy
-
inline InstanceMappingPolicy &with_redundant(bool redundant) &#
Changes the value of
redundant- Parameters:
redundant – A new value for the
redundantfield- Returns:
This instance mapping policy
-
inline void set_target(StoreTarget target)#
Changes the store target.
- Parameters:
target – A new store target
-
inline void set_allocation_policy(AllocPolicy allocation)#
Changes the allocation policy.
- Parameters:
allocation – A new allocation policy
-
inline void set_ordering(DimOrdering ordering)#
Changes the dimension ordering.
- Parameters:
ordering – A new dimension ordering
-
inline void set_exact(bool exact)#
Changes the value of
exact- Parameters:
exact – A new value for the
exactfield
-
inline void set_redundant(bool redundant)#
Changes the value of
redundant- Parameters:
redundant – A new value for the
redundantfield
Public Members
-
StoreTarget target = {StoreTarget::SYSMEM}#
Target memory type for the instance.
-
AllocPolicy allocation = {AllocPolicy::MAY_ALLOC}#
Allocation policy.
-
std::optional<DimOrdering> ordering = {}#
Dimension ordering for the instance. Unspecified by default. When unspecified, the mapper will grab an instance of any dimension ordering that satisfies the rest of the policy.
A recommendation in general is that the mapper should keep this ordering unspecified, to increase the chance of reusing existing instances in the store mapping. Dimension orderings are required most likely when tasks interoperate with external libraries that assume specific allocation layouts (e.g., math libraries expecting Fortran or C layouts with no stride arguments).
-
bool exact = {false}#
If true, the instance must be tight to the store(s); i.e., the instance must not have any extra elements not included in the store(s).
-
bool redundant = {false}#
If true, the runtime treats the instance as a redundant copy and marks it as collectible as soon as the consumer task is done using it. In case where the program makes access to a store through several different partitions, setting this flag will help reduce the memory footprint by allowing the runtime to collect redundant instances eagerly.
This flag has no effect when the instance is not freshly created for the task or is used for updates.
-
inline InstanceMappingPolicy &with_target(StoreTarget target) &#