cuda::experimental::places::exec_place_grid_impl#

class exec_place_grid_impl : public cuda::experimental::places::exec_place::impl#

Implementation class for multi-device execution place grids.

This is used internally by make_grid() and related factory functions.

Public Functions

inline exec_place_grid_impl(::std::vector<exec_place> _places)#
inline exec_place_grid_impl(
::std::vector<exec_place> _places,
const dim4 &_dims
)#
inline virtual dim4 get_dims() const override#

Get the dimensions of this grid.

For scalar places, returns dim4(1, 1, 1, 1).

inline virtual size_t size() const override#

Get the total number of places in this grid.

inline ::std::shared_ptr<exec_place::impl> get_place(
size_t idx
) override#
inline virtual exec_place activate(size_t idx) const override#

Activate the sub-place at the given index.

For scalar places, idx must be 0. Returns the previous execution state needed for deactivate().

inline virtual void deactivate(
const exec_place &prev,
size_t idx = 0
) const override#

Deactivate the sub-place at the given index, restoring previous state.

inline ::std::string to_string() const override#
inline virtual int cmp(const exec_place::impl &rhs) const override#

Three-way comparison.

Returns:

-1 if *this < rhs, 0 if *this == rhs, 1 if *this > rhs

inline virtual size_t hash() const override#
inline virtual stream_pool &get_stream_pool(
bool for_computation,
exec_place_resources &res,
const exec_place&
) const override#

Return the stream pool to draw streams from for this place.

Pooled implementations (device, host) use the default body, which looks up / lazily creates a per-place pool inside the supplied registry, keyed by this (a stable singleton pointer for those impls).

Self-contained implementations (exec_place_cuda_stream_impl, exec_place_green_ctx_impl) override this method and ignore the registry, returning their embedded pool instead.

The grid implementation forwards res to its first sub-place.

Parameters:
  • for_computation – If true, return the computation pool slot; otherwise return the data-transfer slot.

  • res – Registry of per-place stream pools (typically owned by an async_resources_handle).

  • self – The exec_place wrapping *this (kept for derived overrides that need access to the public-facing place).

inline virtual bool is_host() const#
inline virtual bool is_device() const#
inline virtual data_place affine_data_place() const#
inline virtual void set_affine_data_place(data_place place)#

Public Static Attributes

static constexpr size_t pool_size = exec_place_default_pool_size#
static constexpr size_t data_pool_size = exec_place_default_data_pool_size#