6.6. 设备管理 [已弃用]

本节介绍底层CUDA驱动应用程序编程接口的设备管理功能。

Functions

CUresult cuDeviceComputeCapability ( int* major, int* minor, CUdevice dev )
Returns the compute capability of the device.
CUresult cuDeviceGetProperties ( CUdevprop* prop, CUdevice dev )
Returns properties for a selected device.

Functions

CUresult cuDeviceComputeCapability ( int* major, int* minor, CUdevice dev )
返回设备的计算能力。
参数
major
- Major revision number
minor
- Minor revision number
dev
- Device handle
已弃用

该函数自CUDA 5.0起已弃用,其功能由cuDeviceGetAttribute()替代。

描述

返回设备dev计算能力定义的主版本号和次版本号到*major*minor中。

Note:

请注意,此函数也可能返回之前异步启动的错误代码。

另请参阅:

cuDeviceGetAttribute, cuDeviceGetCount, cuDeviceGetName, cuDeviceGetUuid, cuDeviceGet, cuDeviceTotalMem

CUresult cuDeviceGetProperties ( CUdevprop* prop, CUdevice dev )
返回所选设备的属性。
参数
prop
- Returned properties of device
dev
- Device to get properties for
已弃用

该函数自CUDA 5.0起已弃用,并由cuDeviceGetAttribute()替代。

描述

返回设备 dev 的属性到 *prop 中。CUdevprop 结构体定义为:

‎     typedef struct CUdevprop_st {
           int maxThreadsPerBlock;
           int maxThreadsDim[3];
           int maxGridSize[3];
           int sharedMemPerBlock;
           int totalConstantMemory;
           int SIMDWidth;
           int memPitch;
           int regsPerBlock;
           int clockRate;
           int textureAlign
        } CUdevprop;
where:

  • maxThreadsPerBlock 是每个块的最大线程数;

  • maxThreadsDim[3] 是每个线程块维度的最大尺寸;

  • maxGridSize[3] 是网格每个维度的最大尺寸;

  • sharedMemPerBlock 是每个块可用的共享内存总量,单位为字节;

  • totalConstantMemory 表示设备上可用的常量内存总量,单位为字节;

  • SIMDWidth 是线程束大小;

  • memPitch是涉及通过cuMemAllocPitch()分配的内存区域的内存复制函数所允许的最大间距;

  • regsPerBlock 是每个块可用的寄存器总数;

  • clockRate 是以千赫兹为单位的时钟频率;

  • textureAlign 是对齐要求;与 textureAlign 字节对齐的纹理基地址无需对纹理提取应用偏移量。

Note:

请注意,此函数也可能返回之前异步启动的错误代码。

另请参阅:

cuDeviceGetAttribute, cuDeviceGetCount, cuDeviceGetName, cuDeviceGetUuid, cuDeviceGet, cuDeviceTotalMem