3.7. Grid Properties

Classes

struct 
Grid attribute-value pair.
struct 
Information about a CUDA grid.
struct 
Grid info.
struct 
Grid info.

Enumerations

enum CUDBGAttribute
Queryable grid attributes.
enum CUDBGGridStatus
Grid status.
enum CUDBGKernelLaunchNotifyMode
Kernel launch notification mode.
enum CUDBGKernelOrigin
Kernel origin.
enum CUDBGKernelType
Kernel types.

Variables

CUDBGResult  ( *CUDBGAPI_st::getBlockDim )( uint32_t dev, uint32_t sm, uint32_t wp, CuDim3* blockDim )
Get the dimensions of 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 dimensions in blocks of the given grid.
CUDBGResult  ( *CUDBGAPI_st::getGridDim32 )( uint32_t dev, uint32_t sm, uint32_t wp, CuDim2* gridDim )
Get the dimensions of the given grid.
CUDBGResult  ( *CUDBGAPI_st::getGridInfo )( uint32_t dev, uint64_t gridId64, CUDBGGridInfo* gridInfo )
Get information about the specified grid.
CUDBGResult  ( *CUDBGAPI_st::getGridInfo120 )( uint32_t dev, uint64_t gridId64, CUDBGGridInfo120* gridInfo )
Get information about the specified grid.
CUDBGResult  ( *CUDBGAPI_st::getGridInfo55 )( uint32_t dev, uint64_t gridId64, CUDBGGridInfo55* gridInfo )
Get information about the specified grid.
CUDBGResult  ( *CUDBGAPI_st::getGridStatus )( uint32_t dev, uint64_t gridId64, CUDBGGridStatus* status )
Check whether the grid corresponding to the ID 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 ID 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 CUDA context active at the given coordinates.

Enumerations

enum CUDBGAttribute

Values
CUDBG_ATTR_GRID_LAUNCH_BLOCKING = 0x000
Whether the launch is synchronous (blocking) or not.
CUDBG_ATTR_GRID_TID = 0x001
The id of the host thread that launched the grid.
enum CUDBGGridStatus

Values
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.
enum CUDBGKernelLaunchNotifyMode

Values
CUDBG_KNL_LAUNCH_NOTIFY_EVENT = 0x000
Kernel launches generate launch notification events.
CUDBG_KNL_LAUNCH_NOTIFY_DEFER = 0x001
Kernel launches do not generate any notification.
enum CUDBGKernelOrigin

Values
CUDBG_KNL_ORIGIN_CPU = 0x000
The kernel was launched from the CPU.
CUDBG_KNL_ORIGIN_GPU = 0x001
The kernel was launched from the GPU.
enum CUDBGKernelType

Values
CUDBG_KNL_TYPE_UNKNOWN = 0x000
Unknown kernel type. Fall-back value.
CUDBG_KNL_TYPE_SYSTEM = 0x001
System kernel, launched by the CUDA driver (cudaMemset, ...).
CUDBG_KNL_TYPE_APPLICATION = 0x002
Application kernel, launched by the application (user-defined or libraries).

Variables

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

Get the dimensions of the given block. Since CUDA 3.0.

See also:

getClusterDim

getGridDim

Parameters
dev
- device index
sm
- SM index
wp
- warp index
blockDim
- the returned number of threads in the block
Returns

CUDBG_SUCCESS, CUDBG_ERROR_INVALID_ARGS, CUDBG_ERROR_UNINITIALIZED, CUDBG_ERROR_INTERNAL, CUDBG_ERROR_INVALID_WARP, CUDBG_ERROR_INITIALIZATION_FAILURE, CUDBG_ERROR_INVALID_CONTEXT, CUDBG_ERROR_RECURSIVE_API_CALL

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

Get the number of blocks in the given cluster. Since CUDA 12.7.

See also:

getBlockDim

getGridDim

Parameters
dev
- device index
sm
- SM index
wp
- warp index
clusterDim
- the returned number of blocks in the cluster
Returns

CUDBG_SUCCESS, CUDBG_ERROR_INVALID_ARGS, CUDBG_ERROR_UNINITIALIZED, CUDBG_ERROR_INTERNAL, CUDBG_ERROR_INVALID_WARP, CUDBG_ERROR_INITIALIZATION_FAILURE, CUDBG_ERROR_INVALID_CONTEXT, CUDBG_ERROR_RECURSIVE_API_CALL

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

Get the number of blocks in the given cluster. Behaves like getClusterDim, but takes a grid ID instead of warp coordinates. In newer GPU architectures, it's possible to have different warps belong to blocks of clusters of different size.

Since CUDA 12.0.

Note:

DEPRECATED in CUDA 12.7: Use getClusterDim instead.

See also:

getClusterDim

Parameters
dev
- device index
gridId64
- grid ID
clusterDim
- the returned number of blocks in the cluster
Returns

CUDBG_SUCCESS, CUDBG_ERROR_INVALID_ARGS, CUDBG_ERROR_UNINITIALIZED, CUDBG_ERROR_INTERNAL, CUDBG_ERROR_INITIALIZATION_FAILURE, CUDBG_ERROR_INVALID_GRID, CUDBG_ERROR_RECURSIVE_API_CALL

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. Since CUDA 4.0.

See also:

getElfImageByHandle

getLoadedFunctionInfo

Parameters
dev
- device index
sm
- SM index
wp
- warp index
relocated
- set to true to specify the relocated ELF image, false otherwise
*elfImage
size
- size of the ELF image (64 bits)
Returns

CUDBG_SUCCESS, CUDBG_ERROR_INVALID_ARGS, CUDBG_ERROR_UNINITIALIZED, CUDBG_ERROR_INTERNAL, CUDBG_ERROR_INVALID_WARP, CUDBG_ERROR_INITIALIZATION_FAILURE, CUDBG_ERROR_INVALID_GRID, CUDBG_ERROR_INVALID_CONTEXT, CUDBG_ERROR_RECURSIVE_API_CALL

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. Behaves like getElfImage but will truncate the image size for cubins larger than 4GiB.

Since CUDA 3.0.

Note:

DEPRECATED in CUDA 4.0: Use getElfImage instead.

See also:

getElfImage

getElfImageByHandle

Parameters
dev
- device index
sm
- SM index
wp
- warp index
relocated
- set to true to specify the relocated ELF image, false otherwise
*elfImage
size
- size of the ELF image (32 bits)
Returns

CUDBG_SUCCESS, CUDBG_ERROR_INVALID_ARGS, CUDBG_ERROR_UNINITIALIZED, CUDBG_ERROR_INTERNAL, CUDBG_ERROR_INVALID_WARP, CUDBG_ERROR_INITIALIZATION_FAILURE, CUDBG_ERROR_INVALID_GRID, CUDBG_ERROR_INVALID_CONTEXT, CUDBG_ERROR_RECURSIVE_API_CALL

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. See CUDBGAttribute for the list of available attributes.

Since CUDA 3.1.

See also:

getGridAttributes

Parameters
dev
- device index
sm
- SM index
wp
- warp index
attr
- the attribute
value
- the returned value of the attribute
Returns

CUDBG_SUCCESS, CUDBG_ERROR_INVALID_ARGS, CUDBG_ERROR_UNINITIALIZED, CUDBG_ERROR_INVALID_WARP, CUDBG_ERROR_INITIALIZATION_FAILURE, CUDBG_ERROR_INVALID_ATTRIBUTE, CUDBG_ERROR_INVALID_CONTEXT, CUDBG_ERROR_RECURSIVE_API_CALL

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. See CUDBGAttribute for the list of available attributes.

Since CUDA 3.1.

See also:

getGridAttribute

Parameters
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
Returns

CUDBG_SUCCESS, CUDBG_ERROR_INVALID_ARGS, CUDBG_ERROR_UNINITIALIZED, CUDBG_ERROR_INVALID_WARP, CUDBG_ERROR_INITIALIZATION_FAILURE, CUDBG_ERROR_INVALID_ATTRIBUTE, CUDBG_ERROR_INVALID_CONTEXT, CUDBG_ERROR_RECURSIVE_API_CALL

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

Get the dimensions in blocks of the given grid. Since CUDA 4.0.

See also:

getBlockDim

getClusterDim

Parameters
dev
- device index
sm
- SM index
wp
- warp index
gridDim
- the dimensions of the grid
Returns

CUDBG_SUCCESS, CUDBG_ERROR_INVALID_ARGS, CUDBG_ERROR_UNINITIALIZED, CUDBG_ERROR_INTERNAL, CUDBG_ERROR_INVALID_WARP, CUDBG_ERROR_INITIALIZATION_FAILURE, CUDBG_ERROR_INVALID_CONTEXT, CUDBG_ERROR_RECURSIVE_API_CALL

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

Get the dimensions of the given grid. Behaves like getGridDim but doesn't return the z dimension.

Since CUDA 3.0.

Note:

DEPRECATED in CUDA 4.0: Use getGridDim instead.

See also:

getGridDim

Parameters
dev
- device index
sm
- SM index
wp
- warp index
gridDim
- the returned number of blocks in the grid
Returns

CUDBG_SUCCESS, CUDBG_ERROR_INVALID_ARGS, CUDBG_ERROR_UNINITIALIZED, CUDBG_ERROR_INTERNAL, CUDBG_ERROR_INVALID_WARP, CUDBG_ERROR_INITIALIZATION_FAILURE, CUDBG_ERROR_INVALID_CONTEXT, CUDBG_ERROR_RECURSIVE_API_CALL

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

Get information about the specified grid. Returns CUDBG_ERROR_INVALID_GRID if the context of the grid has already been destroyed (even if grid ID itself is correct).

Since CUDA 12.7.

Parameters
dev
- device index
gridId64
gridInfo
- pointer to a client allocated structure in which grid info will be returned
Returns

CUDBG_SUCCESS, CUDBG_ERROR_INVALID_ARGS, CUDBG_ERROR_UNINITIALIZED, CUDBG_ERROR_INTERNAL, CUDBG_ERROR_INITIALIZATION_FAILURE, CUDBG_ERROR_INVALID_GRID, CUDBG_ERROR_INVALID_CONTEXT, CUDBG_ERROR_RECURSIVE_API_CALL

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

Get information about the specified grid. Behaves like getGridInfo, but returns less information. Returns CUDBG_ERROR_INVALID_GRID if the context of the grid has already been destroyed (even if grid ID itself is correct).

Since CUDA 12.0.

Note:

DEPRECATED in CUDA 12.7: Use getGridInfo instead.

See also:

getGridInfo

Parameters
dev
- device index
gridId64
gridInfo
- pointer to a client allocated structure in which grid info will be returned
Returns

CUDBG_SUCCESS, CUDBG_ERROR_INVALID_ARGS, CUDBG_ERROR_UNINITIALIZED, CUDBG_ERROR_INTERNAL, CUDBG_ERROR_INITIALIZATION_FAILURE, CUDBG_ERROR_INVALID_GRID, CUDBG_ERROR_INVALID_CONTEXT, CUDBG_ERROR_RECURSIVE_API_CALL

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

Get information about the specified grid. Behaves like getGridInfo, but returns less information. Returns CUDBG_ERROR_INVALID_GRID if the context of the grid has already been destroyed (even if grid ID itself is correct).

Since CUDA 5.5.

Note:

DEPRECATED in CUDA 12.0: Use getGridInfo instead.

See also:

getGridInfo

Parameters
dev
- device index
gridId64
gridInfo
- pointer to a client allocated structure in which grid info will be returned
Returns

CUDBG_SUCCESS, CUDBG_ERROR_INVALID_ARGS, CUDBG_ERROR_UNINITIALIZED, CUDBG_ERROR_INTERNAL, CUDBG_ERROR_INITIALIZATION_FAILURE, CUDBG_ERROR_INVALID_GRID, CUDBG_ERROR_INVALID_CONTEXT, CUDBG_ERROR_RECURSIVE_API_CALL

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

Check whether the grid corresponding to the ID is still present on the device. Since CUDA 5.5.

Parameters
dev
- device index
gridId64
- 64-bit grid ID
status
- enum indicating the grid status
Returns

CUDBG_SUCCESS, CUDBG_ERROR_INVALID_ARGS, CUDBG_ERROR_UNINITIALIZED, CUDBG_ERROR_INTERNAL, CUDBG_ERROR_INITIALIZATION_FAILURE, CUDBG_ERROR_RECURSIVE_API_CALL

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

Check whether the grid corresponding to the ID is still present on the device. Behaves like getGridStatus, but takes a 32-bit grid ID instead of a 64-bit one.

Since CUDA 5.0.

Note:

DEPRECATED in CUDA 5.5: Use getGridStatus instead.

See also:

getGridStatus

Parameters
dev
- device index
gridId
- grid ID
status
- enum indicating the grid status
Returns

CUDBG_SUCCESS, CUDBG_ERROR_INVALID_ARGS, CUDBG_ERROR_UNINITIALIZED, CUDBG_ERROR_INTERNAL, CUDBG_ERROR_INITIALIZATION_FAILURE, CUDBG_ERROR_RECURSIVE_API_CALL

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 CUDA context active at the given coordinates. This returns a Linux thread ID.

Since CUDA 3.0.

See also:

getGridAttributes

Parameters
dev
- device index
sm
- SM index
wp
- warp index
tid
- the returned thread id
Returns

CUDBG_SUCCESS, CUDBG_ERROR_INVALID_ARGS, CUDBG_ERROR_UNINITIALIZED, CUDBG_ERROR_INVALID_WARP, CUDBG_ERROR_INITIALIZATION_FAILURE, CUDBG_ERROR_INVALID_CONTEXT, CUDBG_ERROR_RECURSIVE_API_CALL