Wraps a cuda context and handles some initialization for you.
More...
#include <GpuAsyncLib.hh>
|
| | CudaContext () |
| | Initialize the CUDA driver API (cuInit()), aborting on failure.
|
| |
| bool | init (int device=-1, bool quiet=false) |
| | Creates a CUDA context, selects a device and ensures that stream memory ops are available.
|
| |
| void | listDevices () |
| | Dumps a list of devices to stdout.
|
| |
| int | getAttribute (CUdevice_attribute attr) |
| | Return the value of device attribute attr for the selected device, or 0 if the query fails.
|
| |
| CUdevice | device () const |
| | Return the device handle selected by init().
|
| |
| CUcontext | context () const |
| | Return the context created by init().
|
| |
| int | deviceNo () const |
| | Return the device number selected by init().
|
| |
Wraps a cuda context and handles some initialization for you.
◆ CudaContext()
| CudaContext::CudaContext |
( |
| ) |
|
|
inline |
Initialize the CUDA driver API (cuInit()), aborting on failure.
◆ context()
| CUcontext CudaContext::context |
( |
| ) |
const |
|
inline |
Return the context created by init().
◆ device()
| CUdevice CudaContext::device |
( |
| ) |
const |
|
inline |
Return the device handle selected by init().
◆ deviceNo()
| int CudaContext::deviceNo |
( |
| ) |
const |
|
inline |
Return the device number selected by init().
◆ getAttribute()
| int CudaContext::getAttribute |
( |
CUdevice_attribute |
attr | ) |
|
Return the value of device attribute attr for the selected device, or 0 if the query fails.
◆ init()
| bool CudaContext::init |
( |
int |
device = -1, |
|
|
bool |
quiet = false |
|
) |
| |
Creates a CUDA context, selects a device and ensures that stream memory ops are available.
- Parameters
-
| device | If >= 0, selects a device to use |
| quiet | Wheter to spew or not |
- Returns
- Bool if success
◆ listDevices()
| void CudaContext::listDevices |
( |
| ) |
|
Dumps a list of devices to stdout.
◆ context_
| CUcontext CudaContext::context_ |
◆ device_
| CUdevice CudaContext::device_ |
Device handle selected by init().
The documentation for this class was generated from the following file: