cuda::experimental::stf::data_place
Defined in include/cuda/experimental/__stf/places/places.cuh
-
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 toint
. Seedevice_ordinal
below.Public Functions
-
data_place() = default
Default constructor.
The object is intialized 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_device() const
checks if this data place corresponds to a specific device
-
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 Static Functions
-
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)
Public Static Attributes
-
static const data_place invalid
Constant representing an invalid
data_place
object.
-
static const data_place host
Constant representing the host CPU as the
data_place
.
-
static const data_place managed
Constant representing a managed memory location as the
data_place
.
-
static const 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 const data_place device_auto
Constant representing a placeholder that lets the library automatically select a GPU device as the
data_place
.
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 fromdata_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
-
composite_state() = default
-
data_place() = default