cuda::experimental::logical_device#

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 underlying_device() const noexcept#

Retrieve the device on which this logical device resides.

inline constexpr kinds 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::physical_device &__dev)#

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

inline logical_device(const green_context &__gctx)#

Construct logical_device from a green_context.

Friends

inline friend 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