cuda::experimental::stf::data_place#

class data_place#

Designates where data will be stored (CPU memory vs.

on device 0 (first GPU), device 1 (second GPU), …)

This typed enum is aligned with CUDA device ordinals but does not implicitly convert to int. See device_ordinal below.

Public Functions

data_place() = default#

Default constructor.

The object is initialized as invalid.

inline bool operator==(const data_place &rhs) const#
inline bool operator!=(const data_place &rhs) const#
inline bool is_composite() const#

checks if this data place is a composite data place

inline bool is_green_ctx() const#

checks if this data place is a green context data place

inline bool is_invalid() const#
inline bool is_host() const#
inline bool is_managed() const#
inline bool is_affine() const#
inline bool is_device() const#

checks if this data place corresponds to a specific device

inline bool is_device_auto() const#
inline ::std::string to_string() const#
inline const exec_place_grid &get_grid() const#
inline const get_executor_func_t &get_partitioner() const#
inline exec_place get_affine_exec_place() const#
inline decorated_stream getDataStream(
async_resources_handle &async_resources,
) const#

Public Members

::std::shared_ptr<green_ctx_view> gc_view#

Public Static Functions

static inline data_place invalid()#

Represents an invalid data_place object.

static inline data_place host()#

Represents the host CPU as the data_place (pinned host memory, or memory which should be pinned by CUDASTF).

static inline data_place managed()#

Represents a managed memory location as the data_place.

static inline data_place affine()#

This actually does not define a data_place, but means that we should use the data place affine to the execution place.

static inline data_place device_auto()#

Constant representing a placeholder that lets the library automatically select a GPU device as the data_place.

static inline data_place device(int dev_id = 0)#

Data is placed on device with index dev_id.

Two relaxations are allowed: -1 can be passed to create a placeholder for the host, and -2 can be used to create a placeholder for a managed device.

static inline data_place current_device()#

Select the embedded memory of the current device as data_place.

template<typename partitioner_t>
static data_place composite(
partitioner_t p,
const exec_place_grid &g,
)#
static inline data_place composite(
get_executor_func_t f,
const exec_place_grid &grid,
)#
static inline data_place green_ctx(const green_ctx_view &gc_view)#

Friends

inline friend size_t to_index(const data_place &p)#

Returns an index guaranteed to be >= 0 (0 for managed CPU, 1 for pinned CPU, 2 for device 0, 3 for device 1, …).

Requires that p is initialized and different from data_place::invalid().

inline friend int device_ordinal(const data_place &p)#

Returns the device ordinal (0 = first GPU, 1 = second GPU, … and by convention the CPU is -1) Requires that p is initialized.

class composite_state#

Public Functions

composite_state() = default#
inline composite_state(
exec_place_grid grid,
get_executor_func_t partitioner_func,
)#
inline const exec_place_grid &get_grid() const#
inline const get_executor_func_t &get_partitioner() const#