cuda::experimental::places::evaluate_localized_placement#

Overloads#

evaluate_localized_placement(grid, partition, elemsize, probes=localized_placement_default_probes, block_size=0)#

template<typename Partition>
localized_stats cuda::experimental::places::evaluate_localized_placement(
const exec_place &grid,
const Partition &partition,
size_t elemsize,
size_t probes = localized_placement_default_probes,
size_t block_size = 0
)

Evaluate - without allocating - how a localized allocation of a tensor distributed by partition over grid would be placed.

See evaluate_localized_placement(); the tensor extents are the partition’s true extents. Placement follows the same tiered decision procedure as the allocation path (make_partition_placement_provider): the analytic and census tiers yield an exact accuracy, and only layouts denser than the placement blocks fall back to the sampled majority vote, where accuracy is an estimate. probes only affects that fallback.

evaluate_localized_placement(grid, owner_of, data_dims, elemsize, probes=localized_placement_default_probes, block_size=0)#

template<typename OwnerFn, typename = ::cuda::std::enable_if_t<::cuda::std::is_invocable_r_v<pos4, OwnerFn, size_t>>>
localized_stats cuda::experimental::places::evaluate_localized_placement(
const exec_place &grid,
OwnerFn &&owner_of,
dim4 data_dims,
size_t elemsize,
size_t probes = localized_placement_default_probes,
size_t block_size = 0
)

Evaluate - without allocating anything - how a localized allocation would distribute a tensor over the places of a grid, from a generic owner function instead of a raw partition_fn_t mapper.

The owner function maps a linear element index to the grid position owning it, mirroring the localized_array constructor of the same shape. Use this overload for an owner that a bare partition_fn_t cannot express: a stateful partition object, or a mapper reached through a foreign ABI (the C API converts its own coordinate structs in such an adapter rather than casting the callback to partition_fn_t, which would not be a compatible function type).

Extents follow the dimension-0-fastest convention of dim4::get_index().

Parameters:
  • grid – Grid of execution places the owner function distributes over

  • owner_of – Callable mapping a linear element index to its owning grid position

  • data_dims – Extents of the tensor

  • elemsize – Size of one element in bytes

  • probes – Number of samples per block for the majority vote

  • block_size – Placement granularity in bytes; 0 selects the allocation granularity queried on device 0 when a device is present (granularity is assumed uniform across the machine’s devices), or a 2 MiB default otherwise (this granularity query is the only driver interaction)

evaluate_localized_placement(grid, mapper, data_dims, elemsize, probes=localized_placement_default_probes, block_size=0)#

inline localized_stats cuda::experimental::places::evaluate_localized_placement(
const exec_place &grid,
partition_fn_t mapper,
dim4 data_dims,
size_t elemsize,
size_t probes = localized_placement_default_probes,
size_t block_size = 0
)

Evaluate - without allocating anything - how a localized allocation would distribute a tensor over the places of a grid.

Runs the exact same block-owner decision procedure as localized_array and returns the resulting statistics, so callers can score a candidate mapping (and tune its parameters) before committing memory.

Extents follow the dimension-0-fastest convention of dim4::get_index().

Parameters:
  • grid – Grid of execution places the mapper distributes over

  • mapper – Partition function mapping element coordinates to a place

  • data_dims – Extents of the tensor

  • elemsize – Size of one element in bytes

  • probes – Number of samples per block for the majority vote

  • block_size – Placement granularity in bytes; 0 selects the device allocation granularity when a device is present, or a 2 MiB default otherwise (this granularity query is the only driver interaction)