Implementations requiring the definitions of multiple CUDA entity proxy classes, and which regard devices, including primary contexts.
More...
Go to the source code of this file.
|
| cuda |
| Definitions and functionality wrapping CUDA APIs.
|
|
| cuda::device |
| Definitions and functionality related to CUDA devices (not including the device wrapper type cuda::device_t itself)
|
|
| cuda::device::peer_to_peer |
| API functions and definitions relating to communications among peer CUDA GPU devices on the same system.
|
|
Implementations requiring the definitions of multiple CUDA entity proxy classes, and which regard devices, including primary contexts.
Specifically:
- Functions in the cuda::device namespace.
- Methods of cuda::device_t and possibly some relates classes.
◆ destroy()
void cuda::device::primary_context::destroy |
( |
const device_t & |
device | ) |
|
|
inline |
Destroy and clean up all resources associated with the specified device's primary context.
- Parameters
-
device | The device whose primary context is to be destroyed |
◆ get()
primary_context_t cuda::device::primary_context::get |
( |
const device_t & |
device | ) |
|
|
inline |
Obtain a handle to the primary context of a given device - creating it ("activating" it) if it doesn't exist.
- Note
- This method and its returned object will "perform their own" reference accounting vis-a-vis the driver, i.e. the caller does not need to worry about increasing or decreasing the CUDA driver reference count for the primary context. Naturally, though, the caller must not interfere with this reference accounting by decreasing the reference count arbitrarily by more than it has increased it, by destroying the primary context etc.
- Parameters
-
device | The device whose primary context is to be proxied |
- Returns
- A proxy object for the specified device
◆ is_active()
bool cuda::device::primary_context::is_active |
( |
const device_t & |
device | ) |
|
|
inline |
- Returns
- true if the device's primary context is active (i.e. has resources allocated for it), which implies we are holding a refcount unit for it somewhere.
- Note
- recall a primary context being active does not mean that it is the current context