3.3. 设备执行控制

变量

CUDBGResult  ( *CUDBGAPI_st::resumeDevice )( uint32_t dev )
Resume a suspended CUDA device.
CUDBGResult  ( *CUDBGAPI_st::resumeWarpsUntilPC )( uint32_t devId, uint32_t sm, uint64_t warpMask, uint64_t virtPC )
Inserts a temporary breakpoint at the specified virtual PC, and resumes all warps in the specified bitmask on a given SM. As compared to CUDBGAPI_st::resumeDevice, CUDBGAPI_st::resumeWarpsUntilPC provides finer-grain control by resuming a selected set of warps on the same SM. The main intended usage is to accelerate the single-stepping process when the target PC is known in advance. Instead of single-stepping each warp individually until the target PC is hit, the client can issue this API. When this API is used, errors within CUDA kernels will no longer be reported precisely. In the situation where resuming warps is not possible, this API will return CUDBG_ERROR_WARP_RESUME_NOT_POSSIBLE. The client should then fall back to using CUDBGAPI_st::singleStepWarp or CUDBGAPI_st::resumeDevice.
CUDBGResult  ( *CUDBGAPI_st::singleStepWarp )( uint32_t dev, uint32_t sm, uint32_t wp, uint32_t nsteps, uint64_t* warpMask )
Single step an individual warp nsteps times on a suspended CUDA device. Only the last instruction in a range should be a control flow instruction.
CUDBGResult  ( *CUDBGAPI_st::singleStepWarp40 )( uint32_t dev, uint32_t sm, uint32_t wp )
Single step an individual warp on a suspended CUDA device.
CUDBGResult  ( *CUDBGAPI_st::singleStepWarp41 )( uint32_t dev, uint32_t sm, uint32_t wp, uint64_t* warpMask )
Single step an individual warp on a suspended CUDA device.
CUDBGResult  ( *CUDBGAPI_st::suspendDevice )( uint32_t dev )
Suspends a running CUDA device.

变量

CUDBGResult ( *CUDBGAPI_st::resumeDevice )( uint32_t dev )

恢复一个被挂起的CUDA设备。自CUDA 3.0起。

另请参阅:

suspendDevice

singleStepWarp

参数
dev
- device index
返回

CUDBG_SUCCESS, CUDBG_ERROR_INVALID_DEVICE, CUDBG_ERROR_RUNNING_DEVICE, CUDBG_ERROR_UNINITIALIZED

CUDBGResult ( *CUDBGAPI_st::resumeWarpsUntilPC )( uint32_t devId, uint32_t sm, uint64_t warpMask, uint64_t virtPC )

在指定的虚拟PC处插入一个临时断点,并在给定的SM上恢复指定位掩码中的所有warp。 与CUDBGAPI_st::resumeDevice相比,CUDBGAPI_st::resumeWarpsUntilPC通过在同一SM上恢复选定的warp集合提供了更精细的控制。其主要用途是当目标PC已知时加速单步执行过程。客户端可以调用此API,而不必逐个warp单步执行直到命中目标PC。使用此API时,CUDA内核中的错误将不再被精确报告。在无法恢复warp的情况下,此API将返回CUDBG_ERROR_WARP_RESUME_NOT_POSSIBLE。此时客户端应回退使用CUDBGAPI_st::singleStepWarp或CUDBGAPI_st::resumeDevice。自CUDA 6.0起支持此功能。

另请参阅:

resumeDevice

参数
devId
- device index
sm
- the SM index
warpMask
- the bitmask of warps to resume (1 = resume, 0 = do not resume)
virtPC
- the virtual PC where the temporary breakpoint will be inserted
返回

CUDBG_SUCCESS CUDBG_ERROR_INVALID_ARGS CUDBG_ERROR_INVALID_DEVICE CUDBG_ERROR_INVALID_SM CUDBG_ERROR_INVALID_WARP_MASK CUDBG_ERROR_WARP_RESUME_NOT_POSSIBLE CUDBG_ERROR_UNINITIALIZED

CUDBGResult ( *CUDBGAPI_st::singleStepWarp )( uint32_t dev, uint32_t sm, uint32_t wp, uint32_t nsteps, uint64_t* warpMask )

在挂起的CUDA设备上单步执行单个warp nsteps次。范围中的最后一条指令应为控制流指令。自CUDA 7.5起。

另请参阅:

resumeDevice

suspendDevice

参数
dev
- device index
sm
- SM index
wp
- warp index
nsteps
- number of single steps
warpMask
- the warps that have been single-stepped
返回

CUDBG_SUCCESS, CUDBG_ERROR_INVALID_DEVICE, CUDBG_ERROR_INVALID_SM, CUDBG_ERROR_INVALID_WARP, CUDBG_ERROR_RUNNING_DEVICE, CUDBG_ERROR_UNINITIALIZED, CUDBG_ERROR_UNKNOWN

CUDBGResult ( *CUDBGAPI_st::singleStepWarp40 )( uint32_t dev, uint32_t sm, uint32_t wp )

在挂起的CUDA设备上单步执行一个独立的warp。自CUDA 3.0起支持。

另请参阅:

resumeDevice

suspendDevice

singleStepWarp

参数
dev
- device index
sm
- SM index
wp
- warp index
返回

CUDBG_SUCCESS, CUDBG_ERROR_INVALID_DEVICE, CUDBG_ERROR_INVALID_SM, CUDBG_ERROR_INVALID_WARP, CUDBG_ERROR_RUNNING_DEVICE, CUDBG_ERROR_UNINITIALIZED, CUDBG_ERROR_UNKNOWN, CUDBG_ERROR_WARP_RESUME_NOT_POSSIBLE

CUDBGResult ( *CUDBGAPI_st::singleStepWarp41 )( uint32_t dev, uint32_t sm, uint32_t wp, uint64_t* warpMask )

在挂起的CUDA设备上单步执行单个warp。自CUDA 4.1起支持。

另请参阅:

resumeDevice

suspendDevice

参数
dev
- device index
sm
- SM index
wp
- warp index
warpMask
- the warps that have been single-stepped
返回

CUDBG_SUCCESS, CUDBG_ERROR_INVALID_DEVICE, CUDBG_ERROR_INVALID_SM, CUDBG_ERROR_INVALID_WARP, CUDBG_ERROR_RUNNING_DEVICE, CUDBG_ERROR_UNINITIALIZED, CUDBG_ERROR_UNKNOWN

CUDBGResult ( *CUDBGAPI_st::suspendDevice )( uint32_t dev )

暂停正在运行的CUDA设备。自CUDA 3.0起支持。

另请参阅:

resumeDevice

singleStepWarp

参数
dev
- device index
返回

CUDBG_SUCCESS, CUDBG_ERROR_INVALID_DEVICE, CUDBG_ERROR_RUNNING_DEVICE, CUDBG_ERROR_UNINITIALIZED