cuda::experimental::places::localized_array#

class localized_array#

An allocator that takes a mapping function to dispatch an allocation over multiple data places.

This is the mechanism used to implement the data_place of a grid of execution places. Uses CUDA Virtual Memory Management (VMM) to create a contiguous virtual address range backed by physical allocations on different devices according to the partitioner.

Public Functions

template<typename F>
inline localized_array(
exec_place grid,
partition_fn_t mapper,
F &&delinearize,
size_t total_size,
size_t elemsize,
dim4 data_dims,
size_t probes = localized_placement_default_probes
)#
inline localized_array(
exec_place grid,
const ::std::function<pos4(size_t)> &owner_of,
size_t total_size,
size_t elemsize,
dim4 data_dims,
size_t probes = localized_placement_default_probes
)#

Construct from a generic owner function instead of a raw partition_fn_t mapper (e.g.

a stateful partition object). The owner function maps a linear element index to the grid position owning it and is only used during construction.

template<typename PlacementProvider, typename = ::cuda::std::enable_if_t<::cuda::std::is_invocable_r_v<::std::vector<block_run>, PlacementProvider, size_t, size_t, localized_stats&>>>
inline localized_array(
exec_place grid,
PlacementProvider &&placement_provider,
size_t total_size,
size_t elemsize,
dim4 data_dims
)#

Construct from a placement PROVIDER: a callable (size_t block_size_bytes, size_t nblocks, localized_stats&) -> std::vector<block_run> producing the maximal same-owner block runs of the allocation, in increasing block order.

Runs are the allocation’s natural currency (one physical allocation and one mapping per run). The exact analytic tier emits them directly (see cute_partition_descriptor::try_block_runs); sampled/census tiers return one owner per block and convert via owners_to_block_runs (see make_partition_placement_provider).

localized_array() = delete#
localized_array(const localized_array&) = delete#
localized_array(localized_array&&) = delete#
localized_array &operator=(const localized_array&) = delete#
localized_array &operator=(localized_array&&) = delete#
inline ~localized_array()#
inline void *get_base_ptr() const#
inline const localized_stats &get_stats() const#

Placement statistics of this allocation (see localized_stats)

template<typename ...P>
inline bool operator==(
::cuda::std::tuple<P&...> t
) const#