legate::mapping::Mapper#

class Mapper#

An abstract class that defines Legate mapping APIs.

The APIs give Legate libraries high-level control on task and store mappings

Subclassed by legate::experimental::io::detail::Mapper, legate::mapping::detail::CoreMapper, legate::mapping::detail::DefaultMapper

Public Functions

virtual std::vector<StoreMapping> store_mappings(
const Task &task,
const std::vector<StoreTarget> &options
) = 0#

Chooses mapping policies for the task’s stores.

Store mappings can be underspecified; any store of the task that doesn’t have a mapping policy will fall back to the default one.

Parameters:
  • taskTask to map

  • options – Types of memories to which the stores can be mapped

Returns:

A vector of store mappings

virtual std::optional<std::size_t> allocation_pool_size(
const Task &task,
StoreTarget memory_kind
) = 0#

Returns an upper bound for the amount of memory (in bytes), of a particular memory type, allocated by a task via Legate allocators.

All buffers created by create_buffer or create_output_buffer calls are drawn from this allocation pool, and their aggregate size cannot exceed the upper bound returned from this call (the program will crash otherwise). Any out-of-band memory allocations (e.g., those created by malloc or cudaMalloc) invisible to Legate are not subject to this pool bound.

This callback is invoked only for task variants that are registered with has_allocations being true.

Parameters:
  • taskTask to map

  • memory_kindType of memory in which the memory pool is created

Returns:

A memory pool size; returning std::nullopt means the total size is unknown.

virtual Scalar tunable_value(TunableID tunable_id) = 0#

Returns a tunable value.

Parameters:

tunable_id – a tunable value id

Returns:

A tunable value in a Scalar object