cuda::experimental::logical_device

Defined in /home/runner/work/cccl/cccl/cudax/include/cuda/experimental/__device/logical_device.cuh

class logical_device

A non-owning representation of a CUDA device or a green context.

Public Types

enum class kinds

Enum to indicate the kind of logical device stored.

Values:

enumerator device
enumerator green_context

Public Functions

inline constexpr CUcontext context() const noexcept
inline constexpr device_ref get_underlying_device() const noexcept

Retrieve the device on which this logical device resides.

inline constexpr kinds get_kind() const noexcept

Retrieve the kind of logical device stored in this object The kind indicates if this logical_device holds a device or green_context.

inline explicit logical_device(int __id)

Construct logical_device from a device ordinal.

Constructing a logical_device for a given device ordinal has a side effect of initializing that device

inline explicit logical_device(device_ref __dev)

Construct logical_device from a device_ref.

Constructing a logical_device for a given device_ref has a side effect of initializing that device

inline logical_device(const ::cuda::experimental::device &__dev)

Constructing a logical_device for a given device has a side effect of initializing that device.

inline bool operator==(logical_device __lhs, logical_device __rhs) noexcept

Compares two logical_devices for equality.

Parameters
Returns

true if lhs and rhs refer to the same logical device