3.7. 网格属性

struct 
Grid info.

枚举

enum CUDBGGridStatus
Grid status.

变量

CUDBGResult  ( *CUDBGAPI_st::getBlockDim )( uint32_t dev, uint32_t sm, uint32_t wp, CuDim3* blockDim )
Get the number of threads in the given block.
CUDBGResult  ( *CUDBGAPI_st::getClusterDim )( uint32_t dev, uint32_t sm, uint32_t wp, CuDim3* clusterDim )
Get the number of blocks in the given cluster.
CUDBGResult  ( *CUDBGAPI_st::getClusterDim120 )( uint32_t dev, uint64_t gridId64, CuDim3* clusterDim )
Get the number of blocks in the given cluster.
CUDBGResult  ( *CUDBGAPI_st::getElfImage )( uint32_t dev, uint32_t sm, uint32_t wp, bool  relocated, void* *elfImage, uint64_t* size )
Get the relocated or non-relocated ELF image and size for the grid on the given device.
CUDBGResult  ( *CUDBGAPI_st::getElfImage32 )( uint32_t dev, uint32_t sm, uint32_t wp, bool  relocated, void* *elfImage, uint32_t* size )
Get the relocated or non-relocated ELF image and size for the grid on the given device.
CUDBGResult  ( *CUDBGAPI_st::getGridAttribute )( uint32_t dev, uint32_t sm, uint32_t wp, CUDBGAttribute attr, uint64_t* value )
Get the value of a grid attribute.
CUDBGResult  ( *CUDBGAPI_st::getGridAttributes )( uint32_t dev, uint32_t sm, uint32_t wp, CUDBGAttributeValuePair* pairs, uint32_t numPairs )
Get several grid attribute values in a single API call.
CUDBGResult  ( *CUDBGAPI_st::getGridDim )( uint32_t dev, uint32_t sm, uint32_t wp, CuDim3* gridDim )
Get the number of blocks in the given grid.
CUDBGResult  ( *CUDBGAPI_st::getGridDim32 )( uint32_t dev, uint32_t sm, uint32_t wp, CuDim2* gridDim )
Get the number of blocks in the given grid.
CUDBGResult  ( *CUDBGAPI_st::getGridInfo )( uint32_t dev, uint64_t gridId64, CUDBGGridInfo* gridInfo )
Get information about the specified grid. If the context of the grid has already been destroyed, the function will return CUDBG_ERROR_INVALID_GRID, although the grid id is correct.
CUDBGResult  ( *CUDBGAPI_st::getGridInfo120 )( uint32_t dev, uint64_t gridId64, CUDBGGridInfo120* gridInfo )
Get information about the specified grid. If the context of the grid has already been destroyed, the function will return CUDBG_ERROR_INVALID_GRID, although the grid id is correct.
CUDBGResult  ( *CUDBGAPI_st::getGridInfo55 )( uint32_t dev, uint64_t gridId64, CUDBGGridInfo55* gridInfo )
Get information about the specified grid. If the context of the grid has already been destroyed, the function will return CUDBG_ERROR_INVALID_GRID, although the grid id is correct.
CUDBGResult  ( *CUDBGAPI_st::getGridStatus )( uint32_t dev, uint64_t gridId64, CUDBGGridStatus* status )
Check whether the grid corresponding to the given gridId is still present on the device.
CUDBGResult  ( *CUDBGAPI_st::getGridStatus50 )( uint32_t dev, uint32_t gridId, CUDBGGridStatus* status )
Check whether the grid corresponding to the given gridId is still present on the device.
CUDBGResult  ( *CUDBGAPI_st::getTID )( uint32_t dev, uint32_t sm, uint32_t wp, uint32_t* tid )
Get the ID of the Linux thread hosting the context of the grid.

枚举

enum CUDBGGridStatus

数值
CUDBG_GRID_STATUS_INVALID
An invalid grid ID was passed, or an error occurred during status lookup.
CUDBG_GRID_STATUS_PENDING
The grid was launched but is not running on the HW yet.
CUDBG_GRID_STATUS_ACTIVE
The grid is currently running on the HW.
CUDBG_GRID_STATUS_SLEEPING
The grid is on the device, doing a join.
CUDBG_GRID_STATUS_TERMINATED
The grid has finished executing.
CUDBG_GRID_STATUS_UNDETERMINED
The grid is either QUEUED or TERMINATED.

变量

CUDBGResult ( *CUDBGAPI_st::getBlockDim )( uint32_t dev, uint32_t sm, uint32_t wp, CuDim3* blockDim )

获取给定块中的线程数。自CUDA 3.0起。

另请参阅:

getGridDim

参数
dev
- device index
sm
- SM index
wp
- warp index
blockDim
- the returned number of threads in the block
返回

CUDBG_SUCCESS, CUDBG_ERROR_INVALID_ARGS, CUDBG_ERROR_INVALID_GRID, CUDBG_ERROR_UNINITIALIZED

CUDBGResult ( *CUDBGAPI_st::getClusterDim )( uint32_t dev, uint32_t sm, uint32_t wp, CuDim3* clusterDim )

获取给定集群中的块数量。自 CUDA 12.7 起。

另请参阅:

getBlockDim

getGridDim

参数
dev
- device index
sm
- SM index
wp
- warp index
clusterDim
- the returned number of blocks in the cluster
返回

CUDBG_SUCCESS, CUDBG_ERROR_INVALID_ARGS, CUDBG_ERROR_INVALID_GRID, CUDBG_ERROR_UNINITIALIZED

CUDBGResult ( *CUDBGAPI_st::getClusterDim120 )( uint32_t dev, uint64_t gridId64, CuDim3* clusterDim )

获取给定集群中的块数量。自 CUDA 12.0 起。

另请参阅:

getBlockDim

getGridDim

参数
dev
- device index
gridId64
- grid ID
clusterDim
- the returned number of blocks in the cluster
返回

CUDBG_SUCCESS, CUDBG_ERROR_INVALID_ARGS, CUDBG_ERROR_INVALID_GRID, CUDBG_ERROR_UNINITIALIZED

CUDBGResult ( *CUDBGAPI_st::getElfImage )( uint32_t dev, uint32_t sm, uint32_t wp, bool  relocated, void* *elfImage, uint64_t* size )

获取指定设备上网格的重定位或非重定位ELF镜像及其大小。自CUDA 4.0起支持。

参数
dev
- device index
sm
- SM index
wp
- warp index
relocated
- set to true to specify the relocated ELF image, false otherwise
*elfImage
- pointer to the ELF image
size
- size of the ELF image (64 bits)
返回

CUDBG_SUCCESS, CUDBG_ERROR_INVALID_ARGS, CUDBG_ERROR_INVALID_GRID, CUDBG_ERROR_UNINITIALIZED

CUDBGResult ( *CUDBGAPI_st::getElfImage32 )( uint32_t dev, uint32_t sm, uint32_t wp, bool  relocated, void* *elfImage, uint32_t* size )

获取指定设备上网格的重定位或非重定位ELF映像及其大小。自CUDA 3.0起支持。

参数
dev
- device index
sm
- SM index
wp
- warp index
relocated
- set to true to specify the relocated ELF image, false otherwise
*elfImage
- pointer to the ELF image
size
- size of the ELF image (32 bits)
返回

CUDBG_SUCCESS, CUDBG_ERROR_INVALID_ARGS, CUDBG_ERROR_INVALID_GRID, CUDBG_ERROR_UNINITIALIZED

CUDBGResult ( *CUDBGAPI_st::getGridAttribute )( uint32_t dev, uint32_t sm, uint32_t wp, CUDBGAttribute attr, uint64_t* value )

获取网格属性的值。自CUDA 3.1起。

参数
dev
- device index
sm
- SM index
wp
- warp index
attr
- the attribute
value
- the returned value of the attribute
返回

CUDBG_SUCCESS, CUDBG_ERROR_INVALID_ARGS, CUDBG_ERROR_INVALID_GRID, CUDBG_ERROR_INVALID_ATTRIBUTE, CUDBG_ERROR_UNINITIALIZED

CUDBGResult ( *CUDBGAPI_st::getGridAttributes )( uint32_t dev, uint32_t sm, uint32_t wp, CUDBGAttributeValuePair* pairs, uint32_t numPairs )

通过单次API调用获取多个网格属性值。自CUDA 3.1起支持。

参数
dev
- device index
sm
- SM index
wp
- warp index
pairs
- array of attribute/value pairs
numPairs
- the number of attribute/values pairs in the array
返回

CUDBG_SUCCESS, CUDBG_ERROR_INVALID_ARGS, CUDBG_ERROR_INVALID_GRID, CUDBG_ERROR_INVALID_ATTRIBUTE, CUDBG_ERROR_UNINITIALIZED

CUDBGResult ( *CUDBGAPI_st::getGridDim )( uint32_t dev, uint32_t sm, uint32_t wp, CuDim3* gridDim )

获取给定网格中的块数量。自CUDA 4.0起。

另请参阅:

getBlockDim

参数
dev
- device index
sm
- SM index
wp
- warp index
gridDim
- the returned number of blocks in the grid
返回

CUDBG_SUCCESS, CUDBG_ERROR_INVALID_ARGS, CUDBG_ERROR_INVALID_GRID, CUDBG_ERROR_UNINITIALIZED

CUDBGResult ( *CUDBGAPI_st::getGridDim32 )( uint32_t dev, uint32_t sm, uint32_t wp, CuDim2* gridDim )

获取给定网格中的块数量。自CUDA 3.0起。

另请参阅:

getBlockDim

参数
dev
- device index
sm
- SM index
wp
- warp index
gridDim
- the returned number of blocks in the grid
返回

CUDBG_SUCCESS, CUDBG_ERROR_INVALID_ARGS, CUDBG_ERROR_INVALID_GRID, CUDBG_ERROR_UNINITIALIZED

CUDBGResult ( *CUDBGAPI_st::getGridInfo )( uint32_t dev, uint64_t gridId64, CUDBGGridInfo* gridInfo )

获取指定网格(grid)的信息。如果该网格的上下文已被销毁,即使网格ID正确,函数也将返回CUDBG_ERROR_INVALID_GRID。自CUDA 12.7版本起生效。

参数
dev
gridId64
gridInfo
- pointer to a client allocated structure in which grid info will be returned.
返回

CUDBG_ERROR_INVALID_ARGS, CUDBG_ERROR_INVALID_GRID, CUDBG_SUCCESS

CUDBGResult ( *CUDBGAPI_st::getGridInfo120 )( uint32_t dev, uint64_t gridId64, CUDBGGridInfo120* gridInfo )

获取指定网格(grid)的信息。如果该网格的上下文已被销毁,即使网格ID正确,函数也将返回CUDBG_ERROR_INVALID_GRID。自CUDA 12.0起生效。

参数
dev
gridId64
gridInfo
- pointer to a client allocated structure in which grid info will be returned.
返回

CUDBG_ERROR_INVALID_ARGS, CUDBG_ERROR_INVALID_GRID, CUDBG_SUCCESS

CUDBGResult ( *CUDBGAPI_st::getGridInfo55 )( uint32_t dev, uint64_t gridId64, CUDBGGridInfo55* gridInfo )

获取指定网格(grid)的信息。如果该网格的上下文已被销毁,即使网格ID正确,函数也将返回CUDBG_ERROR_INVALID_GRID。自CUDA 5.5版本起支持此功能。

参数
dev
gridId64
gridInfo
- pointer to a client allocated structure in which grid info will be returned.
返回

CUDBG_ERROR_INVALID_ARGS, CUDBG_ERROR_INVALID_GRID, CUDBG_SUCCESS

CUDBGResult ( *CUDBGAPI_st::getGridStatus )( uint32_t dev, uint64_t gridId64, CUDBGGridStatus* status )

检查给定gridId对应的网格是否仍存在于设备上。自CUDA 5.5起。

参数
dev
gridId64
- 64-bit grid ID
status
- enum indicating whether the grid status is INVALID, PENDING, ACTIVE, SLEEPING, TERMINATED or UNDETERMINED
返回

CUDBG_ERROR_INVALID_DEVICE, CUDBG_ERROR_INVALID_GRID, CUDBG_ERROR_INTERNAL

CUDBGResult ( *CUDBGAPI_st::getGridStatus50 )( uint32_t dev, uint32_t gridId, CUDBGGridStatus* status )

检查给定gridId对应的网格是否仍存在于设备上。自CUDA 5.0起。

参数
dev
gridId
- grid ID
status
- enum indicating whether the grid status is INVALID, PENDING, ACTIVE, SLEEPING, TERMINATED or UNDETERMINED
返回

CUDBG_ERROR_INVALID_DEVICE, CUDBG_ERROR_INVALID_GRID, CUDBG_ERROR_INTERNAL

CUDBGResult ( *CUDBGAPI_st::getTID )( uint32_t dev, uint32_t sm, uint32_t wp, uint32_t* tid )

获取托管网格上下文的Linux线程ID。自CUDA 3.0起。

参数
dev
- device index
sm
- SM index
wp
- warp index
tid
- the returned thread id
返回

CUDBG_SUCCESS, CUDBG_ERROR_INVALID_ARGS, CUDBG_ERROR_INVALID_GRID, CUDBG_ERROR_UNINITIALIZED