typedef void(SANITIZERAPI * Sanitizer_CallbackFunc)(void *userdata, Sanitizer_CallbackDomain domain, Sanitizer_CallbackId cbid, const void *cbdata) |
Function type for a callback. The type of the data passed to the callback in cbdata
depends on the domain. If domain
is SANITIZER_CB_DOMAIN_DRIVER_API or SANITIZER_CB_DOMAIN_RUNTIME_API the type of cbdata
will be Sanitizer_CallbackData. If domain
is SANITIZER_CB_DOMAIN_RESOURCE the type of cbdata
will be dependent on cbid. Refer to Sanitizer_ResourceContextData, Sanitizer_ResourceStreamData, Sanitizer_ResourceModuleData and Sanitizer_ResourceMemoryFlags documentations. If domain
is SANITIZER_CB_DOMAIN_SYNCHRONIZE the type of cbdata
will be Sanitizer_SynchronizeData. If domain
is SANITIZER_CB_DOMAIN_LAUNCH the type of cbdata
will be Sanitizer_LaunchData. If domain
is SANITIZER_CB_DOMAIN_MEMCPY the type of cbdata
will be Sanitizer_MemcpyData. If domain
is SANITIZER_CB_DOMAIN_MEMSET the type of cbdata
will be Sanitizer_MemsetData. If domain
is SANITIZER_CB_DOMAIN_BATCH_MEMOP the type of cbdata
will be Sanitizer_BatchMemopData.
Specifies the type of batch memory operation reported by a callback in domain SANITIZER_CB_DOMAIN_BATCH_MEMOP. This value is communicated to the callback function via Sanitizer_BatchMemopData::type.
Callback IDs for resource domain SANITIZER_CB_DOMAIN_SYNCHRONIZE. This value is communicated to the callback function via the cbid
parameter.
Callback domain. Each domain represents callback points for a group of related API functions or CUDA driver activity.
Callback IDs for resource domain SANITIZER_CB_DOMAIN_GRAPHS. This value is communicated to the callback function via the cbid
parameter.
Callback IDs for resource domain SANITIZER_CB_DOMAIN_LAUNCH. This value is communicated to the callback function via the cbid
parameter.
Callback IDs for resource domain SANITIZER_CB_DOMAIN_RESOURCE. This value is communicated to the callback function via the cbid
parameter.
Callback IDs for resource domain SANITIZER_CB_DOMAIN_UVM. This value is communicated to the callback function via the cbid
parameter.
Indicates the direction of a memcpy, passed inside Sanitizer_Memcpydata
.
Specifies the visibility of an allocation. This is typically GLOBAL on allocations made via cudaMalloc, cudaHostAlloc and similar APIs. This can be GLOBAL or HOST for cudaMallocManaged allocations depending on the flags parameter. This can be changed after allocation time using cudaMemAttachSingle API (see SANITIZER_CBID_UVM_ATTACH_MEM for the corresponding callback).
Flags describing a memory allocation. These values are to be used in order to interpret the value of Sanitizer_ResourceMemoryData::flags
Permissions for a memory allocation. These values are to be used in order to interpret the value of Sanitizer_ResourceMemoryData::permissions
SanitizerResult SANITIZERAPI sanitizerEnableAllDomains | ( | uint32_t | enable, | |
Sanitizer_SubscriberHandle | subscriber | |||
) |
Enable or disable all callbacks in all domains.
enable | New enable state for all callbacks in all domains. Zero disables all callbacks, non-zero enables all callbacks. | |
subscriber | - Handle of the initialized subscriber |
SANITIZER_SUCCESS | on success | |
SANITIZER_ERROR_NOT_INITIALIZED | if unable to initialize the sanitizer | |
SANITIZER_ERROR_INVALID_PARAMETER | if subscriber is invalid |
SanitizerResult SANITIZERAPI sanitizerEnableCallback | ( | uint32_t | enable, | |
Sanitizer_SubscriberHandle | subscriber, | |||
Sanitizer_CallbackDomain | domain, | |||
Sanitizer_CallbackId | cbid | |||
) |
Enable or disable callbacks for a subscriber for a specific domain and callback ID.
enable | New enable state for the callback. Zero disables the callback, non-zero enables the callback | |
subscriber | - Handle of the initialized subscriber | |
domain | The domain of the callback | |
cbid | The ID of the callback |
SANITIZER_SUCCESS | on success | |
SANITIZER_ERROR_NOT_INITIALIZED | if unable to initialize the sanitizer | |
SANITIZER_ERROR_INVALID_PARAMETER | if subscriber , domain or cbid is invalid |
SanitizerResult SANITIZERAPI sanitizerEnableDomain | ( | uint32_t | enable, | |
Sanitizer_SubscriberHandle | subscriber, | |||
Sanitizer_CallbackDomain | domain | |||
) |
Enable or disable all callbacks for a specific domain.
enable | New enable state for all callbacks in the domain. Zero disables all callbacks, non-zero enables all callbacks | |
subscriber | - Handle of the initialized subscriber | |
domain | The domain of the callback |
SANITIZER_SUCCESS | on success | |
SANITIZER_ERROR_NOT_INITIALIZED | if unable to initialize the sanitizer | |
SANITIZER_ERROR_INVALID_PARAMETER | if subscriber or domain is invalid |
SanitizerResult SANITIZERAPI sanitizerGetCallbackState | ( | uint32_t * | enable, | |
Sanitizer_SubscriberHandle | subscriber, | |||
Sanitizer_CallbackDomain | domain, | |||
Sanitizer_CallbackId | cbid | |||
) |
Returns non-zero in *enable
if the callback for a domain and callback ID is enabled, and zero if not enabled.
enable | Returns non-zero if callback enabled, zero if not enabled | |
subscriber | Handle to the initialized subscriber | |
domain | The domain of the callback | |
cbid | The ID of the callback |
SANITIZER_SUCCESS | on success | |
SANITIZER_ERROR_NOT_INITIALIZED | if unable to initialize the sanitizer | |
SANITIZER_ERROR_INVALID_PARAMETER | if enabled is NULL, or if subscriber , domain or cbid is invalid. |
SanitizerResult SANITIZERAPI sanitizerSubscribe | ( | Sanitizer_SubscriberHandle * | subscriber, | |
Sanitizer_CallbackFunc | callback, | |||
void * | userdata | |||
) |
Initialize a callback subscriber with a callback function and (optionally) a pointer to user data. The returned subscriber handle can be used to enable and disable the callback for specific domains and callback IDs.
This function does not enable any callbacks.
Thread-safety: this function is thread safe.
subscriber | Returns handle to initialize subscriber | |
callback | The callback function | |
userdata | A pointer to user data. This data will be passed to the callback function via the userdata parameter |
SANITIZER_SUCCESS | on success | |
SANITIZER_ERROR_NOT_INITIALIZED | if unable to initialize the sanitizer | |
SANITIZER_ERROR_MAX_LIMIT_RACHED | if there is already a sanitizer subscriber | |
SANITIZER_ERROR_INVALID_PARAMETER | if subscriber is NULL |
SanitizerResult SANITIZERAPI sanitizerUnsubscribe | ( | Sanitizer_SubscriberHandle | subscriber | ) |
Removes a callback subscriber so that no future callback will be issued to that subscriber.
subscriber | Handle to the initialized subscriber |
SANITIZER_SUCCESS | on success | |
SANITIZER_ERROR_NOT_INITIALIZED | if unable to initialize the sanitizer | |
SANITIZER_ERROR_INVALID_PARAMETER | if subscriber is NULL or not initialized |
union { ... } [inherited] |
Data for this node launch.
uint64_t Sanitizer_UvmData::address [inherited] |
The address of the allocation.
uint64_t Sanitizer_BatchMemopData::address [inherited] |
The address to be written.
uint64_t Sanitizer_MemsetData::address [inherited] |
The address of the memset start.
uint32_t Sanitizer_LaunchData::blockDim_x [inherited] |
Launch properties of the grid. These values are only valid for SANITIZER_CBID_LAUNCH_BEGIN and graph node launch callbacks
uint32_t Sanitizer_LaunchData::blockDim_y [inherited] |
Launch properties of the grid. These values are only valid for SANITIZER_CBID_LAUNCH_BEGIN and graph node launch callbacks
uint32_t Sanitizer_LaunchData::blockDim_z [inherited] |
Launch properties of the grid. These values are only valid for SANITIZER_CBID_LAUNCH_BEGIN and graph node launch callbacks
CUcontext Sanitizer_ResourceMemoryData::context [inherited] |
Context containing the allocation being created or destroyed. Can be NULL if the allocation is not attached to a context.
CUcontext Sanitizer_CallbackData::context [inherited] |
Driver context current to the thread, or null if no context is current. This value can change from the entry to exit callback of a runtime API function if the runtime initialized a context.
size_t Sanitizer_ResourceModuleData::cubinSize [inherited] |
The size of the cubin.
CUdevice Sanitizer_LaunchData::device [inherited] |
The device where the grid is launched
CUdevice Sanitizer_ResourceMempoolData::device [inherited] |
Device that owns the memory pool.
CUdevice Sanitizer_ResourceMemoryData::device [inherited] |
Device where the allocation is being created. Available for all cbid with a driver version of 455 or newer.
CUdevice Sanitizer_ResourceContextData::device [inherited] |
The device on which the context is being created or destroyed. This field is only valid for SANITIZER_CBID_RESOURCE_CONTEXT_CREATION_* callbacks
The direction of the transfer
uint64_t Sanitizer_MemcpyData::dstAddress [inherited] |
The destination allocation address.
CUcontext Sanitizer_MemcpyData::dstContext [inherited] |
The context where the destination allocation is located
uint64_t Sanitizer_MemcpyData::dstPitch [inherited] |
The destination allocation pitch.
CUstream Sanitizer_MemcpyData::dstStream [inherited] |
The stream where the memcpy is executed on the destination context
uint32_t Sanitizer_ResourceMemoryData::flags [inherited] |
Allocation details: use Sanitizer_ResourceMemoryFlags to interpret this field.
CUfunction Sanitizer_LaunchData::function [inherited] |
The function of the grid launch.
const char* Sanitizer_LaunchData::functionName [inherited] |
The name of the launched function.
const char* Sanitizer_CallbackData::functionName [inherited] |
Name of the runtime or driver API function which issued the callback. This string is a global constant and so may be accessed outside of the callback.
const void* Sanitizer_CallbackData::functionParams [inherited] |
Pointer to the arguments passed to the runtime or driver API call. See generated_cuda_runtime_api_meta.h and generated_cuda_meta.h for structure definitions for the parameters for each runtime and driver API function.
const void* Sanitizer_CallbackData::functionReturnValue [inherited] |
Pointer to the return value of the runtime or driver API call. This field is only valid within the SANITIZER_API_EXIT callback. For a runtime API functionReturnValue
points to a cudaError_t
. For a driver API functionReturnValue
points to a CUresult
.
CUgraphExec Sanitizer_GraphExecData::graphExec [inherited] |
Instance of the CUDA graph.
uint32_t Sanitizer_LaunchData::gridDim_x [inherited] |
Launch properties of the grid. These values are only valid for SANITIZER_CBID_LAUNCH_BEGIN and graph node launch callbacks
uint32_t Sanitizer_LaunchData::gridDim_y [inherited] |
Launch properties of the grid. These values are only valid for SANITIZER_CBID_LAUNCH_BEGIN and graph node launch callbacks
uint32_t Sanitizer_LaunchData::gridDim_z [inherited] |
Launch properties of the grid. These values are only valid for SANITIZER_CBID_LAUNCH_BEGIN and graph node launch callbacks
uint64_t Sanitizer_LaunchData::gridId [inherited] |
Unique identifier of the grid launch. For graph node launches, this is only unique within the graphexec launch.
CUarray Sanitizer_ResourceArrayData::hArray [inherited] |
The CUDA array being created or destroyed.
Sanitizer_StreamHandle Sanitizer_MemcpyData::hDstStream [inherited] |
Unique handle for the destination context stream.
Sanitizer_LaunchHandle Sanitizer_LaunchData::hLaunch [inherited] |
Handle of the grid launch. This is only valid between the launch begin and end callbacks.
Sanitizer_StreamHandle Sanitizer_MemcpyData::hSrcStream [inherited] |
Unique handle for the source context stream.
Sanitizer_StreamHandle Sanitizer_UvmData::hStream [inherited] |
Unique handle for the stream.
Sanitizer_StreamHandle Sanitizer_BatchMemopData::hStream [inherited] |
Unique handle for the stream.
Sanitizer_StreamHandle Sanitizer_MemsetData::hStream [inherited] |
Unique handle for the stream.
Sanitizer_StreamHandle Sanitizer_LaunchData::hStream [inherited] |
Unique handle for the stream.
Sanitizer_StreamHandle Sanitizer_SynchronizeData::hStream [inherited] |
Unique handle for the stream.
Sanitizer_StreamHandle Sanitizer_ResourceMemoryData::hStream [inherited] |
Stream containing the allocation being created or destroyed. Can be NULL if the allocation is not attached to a stream.
Sanitizer_StreamHandle Sanitizer_ResourceStreamData::hStream [inherited] |
Unique handle for the stream.
uint32_t Sanitizer_MemsetData::isAsync [inherited] |
Boolean value indicating if the transfer is asynchronous.
uint32_t Sanitizer_MemcpyData::isAsync [inherited] |
Boolean value indicating if the transfer is asynchronous.
Sanitizer_LaunchData { ... } ::launchData [inherited] |
This is only valid if nodeType is CU_GRAPH_NODE_TYPE_KERNEL.
uint32_t Sanitizer_GraphNodeLaunchData::launchId [inherited] |
Launch ID for this CUDA graph instance
Sanitizer_ResourceMemoryData { ... } ::memAllocData [inherited] |
This is only valid if nodeType is CU_GRAPH_NODE_TYPE_MEM_ALLOC.
This is only valid if nodeType is CU_GRAPH_NODE_TYPE_MEM_ALLOC.
uint64_t { ... } ::memFreeAddress [inherited] |
The freed device pointer This is only valid if nodeType is CU_GRAPH_NODE_TYPE_MEM_FREE.
uint64_t Sanitizer_GraphNodeLaunchData::memFreeAddress [inherited] |
The freed device pointer This is only valid if nodeType is CU_GRAPH_NODE_TYPE_MEM_FREE.
CUmemoryPool Sanitizer_ResourceMemoryData::memoryPool [inherited] |
Memory pool containing the allocation being created or destroyed. Can be NULL if the allocation is not attached to a memory pool.
CUmodule Sanitizer_LaunchData::module [inherited] |
The module containing the grid code.
CUmodule Sanitizer_ResourceModuleData::module [inherited] |
The module being loaded or unloaded.
CUgraphNode Sanitizer_GraphNodeLaunchData::node [inherited] |
CUDA graphs node being launched.
CUgraphNodeType Sanitizer_GraphNodeLaunchData::nodeType [inherited] |
CUDA graphs node type.
const char* Sanitizer_ResourceModuleData::pCubin [inherited] |
Pointer to the associated cubin.
CUdevice Sanitizer_ResourceMempoolData::peerDevice [inherited] |
Device that access type changed. Avaialble if cbid is SANITIZER_CBID_RESOURCE_MEMPOOL_PEER_ACCESS_ENABLED or SANITIZER_CBID_RESOURCE_MEMPOOL_PEER_ACCESS_DISABLING.
uint32_t Sanitizer_ResourceMemoryData::permissions [inherited] |
Allocation permissions: use Sanitizer_ResourceMemoryPermissions to interpret this field.
uint64_t Sanitizer_MemcpyData::size [inherited] |
Size of the transfer in bytes.
uint64_t Sanitizer_ResourceMemoryData::size [inherited] |
Size of the allocation being created or destroyed.
CUdevice Sanitizer_ResourceMemoryData::sourceDevice [inherited] |
Source device of this allocation (different from device if SANITIZER_MEMORY_FLAG_PEER is set).
uint64_t Sanitizer_MemcpyData::srcAddress [inherited] |
The source allocation address.
uint64_t Sanitizer_MemcpyData::srcPitch [inherited] |
The source allocation pitch.
CUstream Sanitizer_MemcpyData::srcStream [inherited] |
The stream where the memcpy is executed on the source context
CUstream Sanitizer_UvmData::stream [inherited] |
The stream on which the memory is attached. This is only valid if visibility is SANITIZER_MEMORY_VISIBILITY_STREAM
CUstream Sanitizer_BatchMemopData::stream [inherited] |
The stream where the batch memop is executed.
CUstream Sanitizer_MemsetData::stream [inherited] |
The stream where the memset is executed.
CUstream Sanitizer_LaunchData::stream [inherited] |
The stream where the grid is launched.
CUstream Sanitizer_SynchronizeData::stream [inherited] |
This field is only valid for SANITIZER_CBID_SYNCHRONIZE_STREAM_SYNCHRONIZED. This is the stream being synchronized.
CUstream Sanitizer_ResourceMemoryData::stream [inherited] |
Public handle for the stream.
CUstream Sanitizer_ResourceStreamData::stream [inherited] |
The stream being created or destroyed.
const char* Sanitizer_CallbackData::symbolName [inherited] |
Name of the symbol operated on by the runtime or driver API function which issued the callback. This entry is valid only for driver and runtime launch callbacks, where it returns the name of the kernel.
Type of batch memory operation.
uint64_t Sanitizer_BatchMemopData::value [inherited] |
The value to be written.
uint32_t Sanitizer_MemsetData::value [inherited] |
Value to be written.
New visibility for the allocation.
Visibility of the allocation.
uint64_t Sanitizer_MemsetData::width [inherited] |
Memset size configuration.
uint64_t Sanitizer_MemcpyData::width [inherited] |
Memcpy size configuration.
uint64_t Sanitizer_ResourceArrayData::width [inherited] |
The CUDA array size.