GPUOcelot
Functions

Device Management

CUDA Driver API
Collaboration diagram for Device Management:

Functions

CUresult CUDAAPI cuDeviceGet (CUdevice *device, int ordinal)
 Returns a handle to a compute device.
CUresult CUDAAPI cuDeviceGetCount (int *count)
 Returns the number of compute-capable devices.
CUresult CUDAAPI cuDeviceGetName (char *name, int len, CUdevice dev)
 Returns an identifer string for the device.
CUresult CUDAAPI cuDeviceComputeCapability (int *major, int *minor, CUdevice dev)
 Returns the compute capability of the device.
CUresult CUDAAPI cuDeviceGetProperties (CUdevprop *prop, CUdevice dev)
 Returns properties for a selected device.
CUresult CUDAAPI cuDeviceGetAttribute (int *pi, CUdevice_attribute attrib, CUdevice dev)
 Returns information about the device.
CUresult CUDAAPI cuDeviceTotalMem (size_t *bytes, CUdevice dev)
 Returns the total amount of memory on the device.

Detailed Description

This section describes the device management functions of the low-level CUDA driver application programming interface.


Function Documentation

CUresult CUDAAPI cuDeviceComputeCapability ( int *  major,
int *  minor,
CUdevice  dev 
)

Returns the compute capability of the device.

Returns in *major and *minor the major and minor revision numbers that define the compute capability of the device dev.

Parameters:
major- Major revision number
minor- Minor revision number
dev- Device handle
Returns:
CUDA_SUCCESS, CUDA_ERROR_DEINITIALIZED, CUDA_ERROR_NOT_INITIALIZED, CUDA_ERROR_INVALID_CONTEXT, CUDA_ERROR_INVALID_VALUE, CUDA_ERROR_INVALID_DEVICE
See also:
cuDeviceGetAttribute, cuDeviceGetCount, cuDeviceGetName, cuDeviceGet, cuDeviceGetProperties, cuDeviceTotalMem
CUresult CUDAAPI cuDeviceGet ( CUdevice device,
int  ordinal 
)

Returns a handle to a compute device.

Returns in *device a device handle given an ordinal in the range [0, cuDeviceGetCount()-1].

Parameters:
device- Returned device handle
ordinal- Device number to get handle for
Returns:
CUDA_SUCCESS, CUDA_ERROR_DEINITIALIZED, CUDA_ERROR_NOT_INITIALIZED, CUDA_ERROR_INVALID_CONTEXT, CUDA_ERROR_INVALID_VALUE, CUDA_ERROR_INVALID_DEVICE
See also:
cuDeviceComputeCapability, cuDeviceGetAttribute, cuDeviceGetCount, cuDeviceGetName, cuDeviceGetProperties, cuDeviceTotalMem
CUresult CUDAAPI cuDeviceGetAttribute ( int *  pi,
CUdevice_attribute  attrib,
CUdevice  dev 
)

Returns information about the device.

Returns in *pi the integer value of the attribute attrib on device dev. The supported attributes are:

CUresult CUDAAPI cuDeviceGetCount ( int *  count)

Returns the number of compute-capable devices.

Returns in *count the number of devices with compute capability greater than or equal to 1.0 that are available for execution. If there is no such device, cuDeviceGetCount() returns 0.

Parameters:
count- Returned number of compute-capable devices
Returns:
CUDA_SUCCESS, CUDA_ERROR_DEINITIALIZED, CUDA_ERROR_NOT_INITIALIZED, CUDA_ERROR_INVALID_CONTEXT, CUDA_ERROR_INVALID_VALUE
See also:
cuDeviceComputeCapability, cuDeviceGetAttribute, cuDeviceGetName, cuDeviceGet, cuDeviceGetProperties, cuDeviceTotalMem
CUresult CUDAAPI cuDeviceGetName ( char *  name,
int  len,
CUdevice  dev 
)

Returns an identifer string for the device.

Returns an ASCII string identifying the device dev in the NULL-terminated string pointed to by name. len specifies the maximum length of the string that may be returned.

Parameters:
name- Returned identifier string for the device
len- Maximum length of string to store in name
dev- Device to get identifier string for
Returns:
CUDA_SUCCESS, CUDA_ERROR_DEINITIALIZED, CUDA_ERROR_NOT_INITIALIZED, CUDA_ERROR_INVALID_CONTEXT, CUDA_ERROR_INVALID_VALUE, CUDA_ERROR_INVALID_DEVICE
See also:
cuDeviceComputeCapability, cuDeviceGetAttribute, cuDeviceGetCount, cuDeviceGet, cuDeviceGetProperties, cuDeviceTotalMem
CUresult CUDAAPI cuDeviceGetProperties ( CUdevprop prop,
CUdevice  dev 
)

Returns properties for a selected device.

Returns in *prop the properties of device dev. The CUdevprop structure is defined as:

where:

  • ::maxThreadsPerBlock is the maximum number of threads per block;
  • ::maxThreadsDim[3] is the maximum sizes of each dimension of a block;
  • ::maxGridSize[3] is the maximum sizes of each dimension of a grid;
  • ::sharedMemPerBlock is the total amount of shared memory available per block in bytes;
  • ::totalConstantMemory is the total amount of constant memory available on the device in bytes;
  • ::SIMDWidth is the warp size;
  • ::memPitch is the maximum pitch allowed by the memory copy functions that involve memory regions allocated through cuMemAllocPitch();
  • ::regsPerBlock is the total number of registers available per block;
  • ::clockRate is the clock frequency in kilohertz;
  • ::textureAlign is the alignment requirement; texture base addresses that are aligned to ::textureAlign bytes do not need an offset applied to texture fetches.
Parameters:
prop- Returned properties of device
dev- Device to get properties for
Returns:
CUDA_SUCCESS, CUDA_ERROR_DEINITIALIZED, CUDA_ERROR_NOT_INITIALIZED, CUDA_ERROR_INVALID_CONTEXT, CUDA_ERROR_INVALID_VALUE, CUDA_ERROR_INVALID_DEVICE
See also:
cuDeviceComputeCapability, cuDeviceGetAttribute, cuDeviceGetCount, cuDeviceGetName, cuDeviceGet, cuDeviceTotalMem
CUresult CUDAAPI cuDeviceTotalMem ( size_t bytes,
CUdevice  dev 
)

Returns the total amount of memory on the device.

Returns in *bytes the total amount of memory available on the device dev in bytes.

Parameters:
bytes- Returned memory available on device in bytes
dev- Device handle
Returns:
CUDA_SUCCESS, CUDA_ERROR_DEINITIALIZED, CUDA_ERROR_NOT_INITIALIZED, CUDA_ERROR_INVALID_CONTEXT, CUDA_ERROR_INVALID_VALUE, CUDA_ERROR_INVALID_DEVICE
See also:
cuDeviceComputeCapability, cuDeviceGetAttribute, cuDeviceGetCount, cuDeviceGetName, cuDeviceGet, cuDeviceGetProperties,
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines