#define CUPTI_EVENT_OVERFLOW ((uint64_t)0xFFFFFFFFFFFFFFFFULL) |
The CUPTI event value that indicates an overflow.
typedef uint32_t CUpti_EventDomainID |
ID for an event domain. An event domain represents a group of related events. A device may have multiple instances of a domain, indicating that the device can simultaneously record multiple instances of each event within that domain.
typedef void* CUpti_EventGroup |
An event group is a collection of events that are managed together. All events in an event group must belong to the same domain.
typedef uint32_t CUpti_EventID |
An event represents a countable activity, action, or occurrence on the device.
typedef void( * CUpti_KernelReplayUpdateFunc)(const char *kernelName, int numReplaysDone, void *customData) |
kernelName | The mangled kernel name | |
numReplaysDone | Number of replays done so far | |
customData | Pointer of any custom data passed in when subscribing |
CUPTI device attributes. These attributes can be read using cuptiDeviceGetAttribute.
Enumeration of device classes for device attribute CUPTI_DEVICE_ATTR_DEVICE_CLASS.
enum CUpti_EventAttribute |
Event attributes. These attributes can be read using cuptiEventGetAttribute.
CUPTI_EVENT_ATTR_NAME | Event name. Value is a null terminated const c-string. |
CUPTI_EVENT_ATTR_SHORT_DESCRIPTION | Short description of event. Value is a null terminated const c-string. |
CUPTI_EVENT_ATTR_LONG_DESCRIPTION | Long description of event. Value is a null terminated const c-string. |
CUPTI_EVENT_ATTR_CATEGORY | Category of event. Value is CUpti_EventCategory. |
CUPTI_EVENT_ATTR_PROFILING_SCOPE | Profiling scope of the events. It can be either device or context or both. Value is a CUpti_EventProfilingScope. |
enum CUpti_EventCategory |
Each event is assigned to a category that represents the general type of the event. A event's category is accessed using cuptiEventGetAttribute and the CUPTI_EVENT_ATTR_CATEGORY attribute.
The collection method indicates how an event is collected.
The event collection mode determines the period over which the events within the enabled event groups will be collected.
Event domain attributes. Except where noted, all the attributes can be read using either cuptiDeviceGetEventDomainAttribute or cuptiEventDomainGetAttribute.
CUPTI_EVENT_DOMAIN_ATTR_NAME | Event domain name. Value is a null terminated const c-string. |
CUPTI_EVENT_DOMAIN_ATTR_INSTANCE_COUNT | Number of instances of the domain for which event counts will be collected. The domain may have additional instances that cannot be profiled (see CUPTI_EVENT_DOMAIN_ATTR_TOTAL_INSTANCE_COUNT). Can be read only with cuptiDeviceGetEventDomainAttribute. Value is a uint32_t. |
CUPTI_EVENT_DOMAIN_ATTR_TOTAL_INSTANCE_COUNT | Total number of instances of the domain, including instances that cannot be profiled. Use CUPTI_EVENT_DOMAIN_ATTR_INSTANCE_COUNT to get the number of instances that can be profiled. Can be read only with cuptiDeviceGetEventDomainAttribute. Value is a uint32_t. |
CUPTI_EVENT_DOMAIN_ATTR_COLLECTION_METHOD | Collection method used for events contained in the event domain. Value is a CUpti_EventCollectionMethod. |
Event group attributes. These attributes can be read using cuptiEventGroupGetAttribute. Attributes marked [rw] can also be written using cuptiEventGroupSetAttribute.
Profiling scope of event indicates if the event can be collected at context scope or device scope or both i.e. it can be collected at any of context or device scope.
CUPTI_EVENT_PROFILING_SCOPE_CONTEXT | Event is collected at context scope. |
CUPTI_EVENT_PROFILING_SCOPE_DEVICE | Event is collected at device scope. |
CUPTI_EVENT_PROFILING_SCOPE_BOTH | Event can be collected at device or context scope. The scope can be set using cuptiEventGroupSetAttribute API. |
enum CUpti_ReadEventFlags |
Flags for cuptiEventGroupReadEvent an cuptiEventGroupReadAllEvents.
CUptiResult cuptiDeviceEnumEventDomains | ( | CUdevice | device, | |
size_t * | arraySizeBytes, | |||
CUpti_EventDomainID * | domainArray | |||
) |
Returns the event domains IDs in domainArray
for a device. The size of the domainArray
buffer is given by *arraySizeBytes
. The size of the domainArray
buffer must be at least numdomains
* sizeof(CUpti_EventDomainID) or else all domains will not be returned. The value returned in *arraySizeBytes
contains the number of bytes returned in domainArray
.
device | The CUDA device | |
arraySizeBytes | The size of domainArray in bytes, and returns the number of bytes written to domainArray | |
domainArray | Returns the IDs of the event domains for the device |
CUPTI_SUCCESS | ||
CUPTI_ERROR_NOT_INITIALIZED | ||
CUPTI_ERROR_INVALID_DEVICE | ||
CUPTI_ERROR_INVALID_PARAMETER | if arraySizeBytes or domainArray are NULL |
CUptiResult cuptiDeviceGetAttribute | ( | CUdevice | device, | |
CUpti_DeviceAttribute | attrib, | |||
size_t * | valueSize, | |||
void * | value | |||
) |
Read a device attribute and return it in *value
.
device | The CUDA device | |
attrib | The attribute to read | |
valueSize | Size of buffer pointed by the value, and returns the number of bytes written to value | |
value | Returns the value of the attribute |
CUPTI_SUCCESS | ||
CUPTI_ERROR_NOT_INITIALIZED | ||
CUPTI_ERROR_INVALID_DEVICE | ||
CUPTI_ERROR_INVALID_PARAMETER | if valueSize or value is NULL, or if attrib is not a device attribute | |
CUPTI_ERROR_PARAMETER_SIZE_NOT_SUFFICIENT | For non-c-string attribute values, indicates that the value buffer is too small to hold the attribute value. |
CUptiResult cuptiDeviceGetEventDomainAttribute | ( | CUdevice | device, | |
CUpti_EventDomainID | eventDomain, | |||
CUpti_EventDomainAttribute | attrib, | |||
size_t * | valueSize, | |||
void * | value | |||
) |
Returns an event domain attribute in *value
. The size of the value
buffer is given by *valueSize
. The value returned in *valueSize
contains the number of bytes returned in value
.
If the attribute value is a c-string that is longer than *valueSize
, then only the first *valueSize
characters will be returned and there will be no terminating null byte.
device | The CUDA device | |
eventDomain | ID of the event domain | |
attrib | The event domain attribute to read | |
valueSize | The size of the value buffer in bytes, and returns the number of bytes written to value | |
value | Returns the attribute's value |
CUPTI_SUCCESS | ||
CUPTI_ERROR_NOT_INITIALIZED | ||
CUPTI_ERROR_INVALID_DEVICE | ||
CUPTI_ERROR_INVALID_EVENT_DOMAIN_ID | ||
CUPTI_ERROR_INVALID_PARAMETER | if valueSize or value is NULL, or if attrib is not an event domain attribute | |
CUPTI_ERROR_PARAMETER_SIZE_NOT_SUFFICIENT | For non-c-string attribute values, indicates that the value buffer is too small to hold the attribute value. |
CUptiResult cuptiDeviceGetNumEventDomains | ( | CUdevice | device, | |
uint32_t * | numDomains | |||
) |
Returns the number of domains in numDomains
for a device.
device | The CUDA device | |
numDomains | Returns the number of domains |
CUPTI_SUCCESS | ||
CUPTI_ERROR_NOT_INITIALIZED | ||
CUPTI_ERROR_INVALID_DEVICE | ||
CUPTI_ERROR_INVALID_PARAMETER | if numDomains is NULL |
CUptiResult cuptiDeviceGetTimestamp | ( | CUcontext | context, | |
uint64_t * | timestamp | |||
) |
Returns the device timestamp in *timestamp
. The timestamp is reported in nanoseconds and indicates the time since the device was last reset.
context | A context on the device from which to get the timestamp | |
timestamp | Returns the device timestamp |
CUPTI_SUCCESS | ||
CUPTI_ERROR_NOT_INITIALIZED | ||
CUPTI_ERROR_INVALID_CONTEXT | ||
CUPTI_ERROR_INVALID_PARAMETER | is timestamp is NULL |
CUptiResult cuptiDisableKernelReplayMode | ( | CUcontext | context | ) |
Set profiling mode for the context to non-replay (default) mode. Event collection mode will be set to CUPTI_EVENT_COLLECTION_MODE_KERNEL. All previously enabled event groups and event group sets will be disabled.
context | The context |
CUPTI_SUCCESS |
CUptiResult cuptiEnableKernelReplayMode | ( | CUcontext | context | ) |
Set profiling mode for the context to replay mode. In this mode, any number of events can be collected in one run of the kernel. The event collection mode will automatically switch to CUPTI_EVENT_COLLECTION_MODE_KERNEL. In this mode, cuptiSetEventCollectionMode will return CUPTI_ERROR_INVALID_OPERATION.
Thread-safety: this function is thread safe.
context | The context |
CUPTI_SUCCESS |
CUptiResult cuptiEnumEventDomains | ( | size_t * | arraySizeBytes, | |
CUpti_EventDomainID * | domainArray | |||
) |
Returns all the event domains available on any CUDA-capable device. Event domain IDs are returned in domainArray
. The size of the domainArray
buffer is given by *arraySizeBytes
. The size of the domainArray
buffer must be at least numDomains
* sizeof(CUpti_EventDomainID) or all domains will not be returned. The value returned in *arraySizeBytes
contains the number of bytes returned in domainArray
.
arraySizeBytes | The size of domainArray in bytes, and returns the number of bytes written to domainArray | |
domainArray | Returns all the event domains |
CUPTI_SUCCESS | ||
CUPTI_ERROR_INVALID_PARAMETER | if arraySizeBytes or domainArray are NULL |
CUptiResult cuptiEventDomainEnumEvents | ( | CUpti_EventDomainID | eventDomain, | |
size_t * | arraySizeBytes, | |||
CUpti_EventID * | eventArray | |||
) |
Returns the event IDs in eventArray
for a domain. The size of the eventArray
buffer is given by *arraySizeBytes
. The size of the eventArray
buffer must be at least numdomainevents
* sizeof(CUpti_EventID) or else all events will not be returned. The value returned in *arraySizeBytes
contains the number of bytes returned in eventArray
.
eventDomain | ID of the event domain | |
arraySizeBytes | The size of eventArray in bytes, and returns the number of bytes written to eventArray | |
eventArray | Returns the IDs of the events in the domain |
CUPTI_SUCCESS | ||
CUPTI_ERROR_NOT_INITIALIZED | ||
CUPTI_ERROR_INVALID_EVENT_DOMAIN_ID | ||
CUPTI_ERROR_INVALID_PARAMETER | if arraySizeBytes or eventArray are NULL |
CUptiResult cuptiEventDomainGetAttribute | ( | CUpti_EventDomainID | eventDomain, | |
CUpti_EventDomainAttribute | attrib, | |||
size_t * | valueSize, | |||
void * | value | |||
) |
Returns an event domain attribute in *value
. The size of the value
buffer is given by *valueSize
. The value returned in *valueSize
contains the number of bytes returned in value
.
If the attribute value is a c-string that is longer than *valueSize
, then only the first *valueSize
characters will be returned and there will be no terminating null byte.
eventDomain | ID of the event domain | |
attrib | The event domain attribute to read | |
valueSize | The size of the value buffer in bytes, and returns the number of bytes written to value | |
value | Returns the attribute's value |
CUPTI_SUCCESS | ||
CUPTI_ERROR_NOT_INITIALIZED | ||
CUPTI_ERROR_INVALID_EVENT_DOMAIN_ID | ||
CUPTI_ERROR_INVALID_PARAMETER | if valueSize or value is NULL, or if attrib is not an event domain attribute | |
CUPTI_ERROR_PARAMETER_SIZE_NOT_SUFFICIENT | For non-c-string attribute values, indicates that the value buffer is too small to hold the attribute value. |
CUptiResult cuptiEventDomainGetNumEvents | ( | CUpti_EventDomainID | eventDomain, | |
uint32_t * | numEvents | |||
) |
Returns the number of events in numEvents
for a domain.
eventDomain | ID of the event domain | |
numEvents | Returns the number of events in the domain |
CUPTI_SUCCESS | ||
CUPTI_ERROR_NOT_INITIALIZED | ||
CUPTI_ERROR_INVALID_EVENT_DOMAIN_ID | ||
CUPTI_ERROR_INVALID_PARAMETER | if numEvents is NULL |
CUptiResult cuptiEventGetAttribute | ( | CUpti_EventID | event, | |
CUpti_EventAttribute | attrib, | |||
size_t * | valueSize, | |||
void * | value | |||
) |
Returns an event attribute in *value
. The size of the value
buffer is given by *valueSize
. The value returned in *valueSize
contains the number of bytes returned in value
.
If the attribute value is a c-string that is longer than *valueSize
, then only the first *valueSize
characters will be returned and there will be no terminating null byte.
event | ID of the event | |
attrib | The event attribute to read | |
valueSize | The size of the value buffer in bytes, and returns the number of bytes written to value | |
value | Returns the attribute's value |
CUPTI_SUCCESS | ||
CUPTI_ERROR_NOT_INITIALIZED | ||
CUPTI_ERROR_INVALID_EVENT_ID | ||
CUPTI_ERROR_INVALID_PARAMETER | if valueSize or value is NULL, or if attrib is not an event attribute | |
CUPTI_ERROR_PARAMETER_SIZE_NOT_SUFFICIENT | For non-c-string attribute values, indicates that the value buffer is too small to hold the attribute value. |
CUptiResult cuptiEventGetIdFromName | ( | CUdevice | device, | |
const char * | eventName, | |||
CUpti_EventID * | event | |||
) |
Find an event by name and return the event ID in *event
.
device | The CUDA device | |
eventName | The name of the event to find | |
event | Returns the ID of the found event or undefined if unable to find the event |
CUPTI_SUCCESS | ||
CUPTI_ERROR_NOT_INITIALIZED | ||
CUPTI_ERROR_INVALID_DEVICE | ||
CUPTI_ERROR_INVALID_EVENT_NAME | if unable to find an event with name eventName . In this case *event is undefined | |
CUPTI_ERROR_INVALID_PARAMETER | if eventName or event are NULL |
CUptiResult cuptiEventGroupAddEvent | ( | CUpti_EventGroup | eventGroup, | |
CUpti_EventID | event | |||
) |
Add an event to an event group. The event add can fail for a number of reasons:
eventGroup | The event group | |
event | The event to add to the group |
CUPTI_SUCCESS | ||
CUPTI_ERROR_NOT_INITIALIZED | ||
CUPTI_ERROR_INVALID_EVENT_ID | ||
CUPTI_ERROR_OUT_OF_MEMORY | ||
CUPTI_ERROR_INVALID_OPERATION | if eventGroup is enabled | |
CUPTI_ERROR_NOT_COMPATIBLE | if event belongs to a different event domain than the events already in eventGroup , or if a device limitation prevents event from being collected at the same time as the events already in eventGroup | |
CUPTI_ERROR_MAX_LIMIT_REACHED | if eventGroup is full | |
CUPTI_ERROR_INVALID_PARAMETER | if eventGroup is NULL |
CUptiResult cuptiEventGroupCreate | ( | CUcontext | context, | |
CUpti_EventGroup * | eventGroup, | |||
uint32_t | flags | |||
) |
Creates a new event group for context
and returns the new group in *eventGroup
.
flags
are reserved for future use and should be set to zero. Thread-safety: this function is thread safe.
context | The context for the event group | |
eventGroup | Returns the new event group | |
flags | Reserved - must be zero |
CUPTI_SUCCESS | ||
CUPTI_ERROR_NOT_INITIALIZED | ||
CUPTI_ERROR_INVALID_CONTEXT | ||
CUPTI_ERROR_OUT_OF_MEMORY | ||
CUPTI_ERROR_INVALID_PARAMETER | if eventGroup is NULL |
CUptiResult cuptiEventGroupDestroy | ( | CUpti_EventGroup | eventGroup | ) |
Destroy an eventGroup
and free its resources. An event group cannot be destroyed if it is enabled.
eventGroup | The event group to destroy |
CUPTI_SUCCESS | ||
CUPTI_ERROR_NOT_INITIALIZED | ||
CUPTI_ERROR_INVALID_OPERATION | if the event group is enabled | |
CUPTI_ERROR_INVALID_PARAMETER | if eventGroup is NULL |
CUptiResult cuptiEventGroupDisable | ( | CUpti_EventGroup | eventGroup | ) |
Disable an event group. Disabling an event group stops collection of events contained in the group.
eventGroup | The event group |
CUPTI_SUCCESS | ||
CUPTI_ERROR_NOT_INITIALIZED | ||
CUPTI_ERROR_HARDWARE | ||
CUPTI_ERROR_INVALID_PARAMETER | if eventGroup is NULL |
CUptiResult cuptiEventGroupEnable | ( | CUpti_EventGroup | eventGroup | ) |
Enable an event group. Enabling an event group zeros the value of all the events in the group and then starts collection of those events.
eventGroup | The event group |
CUPTI_SUCCESS | ||
CUPTI_ERROR_NOT_INITIALIZED | ||
CUPTI_ERROR_HARDWARE | ||
CUPTI_ERROR_NOT_READY | if eventGroup does not contain any events | |
CUPTI_ERROR_NOT_COMPATIBLE | if eventGroup cannot be enabled due to other already enabled event groups | |
CUPTI_ERROR_INVALID_PARAMETER | if eventGroup is NULL | |
CUPTI_ERROR_HARDWARE_BUSY | if another client is profiling and hardware is busy |
CUptiResult cuptiEventGroupGetAttribute | ( | CUpti_EventGroup | eventGroup, | |
CUpti_EventGroupAttribute | attrib, | |||
size_t * | valueSize, | |||
void * | value | |||
) |
Read an event group attribute and return it in *value
.
eventGroup
(for example, client must guard against simultaneous calls to cuptiEventGroupDestroy, cuptiEventGroupAddEvent, etc.), and must guard against simultaneous destruction of the context in which eventGroup
was created (for example, client must guard against simultaneous calls to cudaDeviceReset, cuCtxDestroy, etc.).eventGroup | The event group | |
attrib | The attribute to read | |
valueSize | Size of buffer pointed by the value, and returns the number of bytes written to value | |
value | Returns the value of the attribute |
CUPTI_SUCCESS | ||
CUPTI_ERROR_NOT_INITIALIZED | ||
CUPTI_ERROR_INVALID_PARAMETER | if valueSize or value is NULL, or if attrib is not an eventgroup attribute | |
CUPTI_ERROR_PARAMETER_SIZE_NOT_SUFFICIENT | For non-c-string attribute values, indicates that the value buffer is too small to hold the attribute value. |
CUptiResult cuptiEventGroupReadAllEvents | ( | CUpti_EventGroup | eventGroup, | |
CUpti_ReadEventFlags | flags, | |||
size_t * | eventValueBufferSizeBytes, | |||
uint64_t * | eventValueBuffer, | |||
size_t * | eventIdArraySizeBytes, | |||
CUpti_EventID * | eventIdArray, | |||
size_t * | numEventIdsRead | |||
) |
Read the values for all the events in an event group. The event values are returned in the eventValueBuffer
buffer. eventValueBufferSizeBytes
indicates the size of eventValueBuffer
. The buffer must be at least (sizeof(uint64) * number of events in group) if CUPTI_EVENT_GROUP_ATTR_PROFILE_ALL_DOMAIN_INSTANCES is not set on the group containing the events. The buffer must be at least (sizeof(uint64) * number of domain instances * number of events in group) if CUPTI_EVENT_GROUP_ATTR_PROFILE_ALL_DOMAIN_INSTANCES is set on the group.
The data format returned in eventValueBuffer
is:
The event order in eventValueBuffer
is returned in eventIdArray
. The size of eventIdArray
is specified in eventIdArraySizeBytes
. The size should be at least (sizeof(CUpti_EventID) * number of events in group).
If any instance of any event counter overflows, the value returned for that event instance will be CUPTI_EVENT_OVERFLOW.
The only allowed value for flags
is CUPTI_EVENT_READ_FLAG_NONE.
Reading events from a disabled event group is not allowed. After being read, an event's value is reset to zero.
eventGroup
(for example, client must guard against simultaneous calls to cuptiEventGroupDestroy, cuptiEventGroupAddEvent, etc.), and must guard against simultaneous destruction of the context in which eventGroup
was created (for example, client must guard against simultaneous calls to cudaDeviceReset, cuCtxDestroy, etc.). If cuptiEventGroupResetAllEvents is called simultaneously with this function, then returned event values are undefined.eventGroup | The event group | |
flags | Flags controlling the reading mode | |
eventValueBufferSizeBytes | The size of eventValueBuffer in bytes, and returns the number of bytes written to eventValueBuffer | |
eventValueBuffer | Returns the event values | |
eventIdArraySizeBytes | The size of eventIdArray in bytes, and returns the number of bytes written to eventIdArray | |
eventIdArray | Returns the IDs of the events in the same order as the values return in eventValueBuffer. | |
numEventIdsRead | Returns the number of event IDs returned in eventIdArray |
CUPTI_SUCCESS | ||
CUPTI_ERROR_NOT_INITIALIZED | ||
CUPTI_ERROR_HARDWARE | ||
CUPTI_ERROR_INVALID_OPERATION | if eventGroup is disabled | |
CUPTI_ERROR_INVALID_PARAMETER | if eventGroup , eventValueBufferSizeBytes , eventValueBuffer , eventIdArraySizeBytes , eventIdArray or numEventIdsRead is NULL | |
CUPTI_ERROR_PARAMETER_SIZE_NOT_SUFFICIENT | if size of eventValueBuffer or eventIdArray is not sufficient |
CUptiResult cuptiEventGroupReadEvent | ( | CUpti_EventGroup | eventGroup, | |
CUpti_ReadEventFlags | flags, | |||
CUpti_EventID | event, | |||
size_t * | eventValueBufferSizeBytes, | |||
uint64_t * | eventValueBuffer | |||
) |
Read the value for an event in an event group. The event value is returned in the eventValueBuffer
buffer. eventValueBufferSizeBytes
indicates the size of the eventValueBuffer
buffer. The buffer must be at least sizeof(uint64) if CUPTI_EVENT_GROUP_ATTR_PROFILE_ALL_DOMAIN_INSTANCES is not set on the group containing the event. The buffer must be at least (sizeof(uint64) * number of domain instances) if CUPTI_EVENT_GROUP_ATTR_PROFILE_ALL_DOMAIN_INSTANCES is set on the group.
If any instance of an event counter overflows, the value returned for that event instance will be CUPTI_EVENT_OVERFLOW.
The only allowed value for flags
is CUPTI_EVENT_READ_FLAG_NONE.
Reading an event from a disabled event group is not allowed. After being read, an event's value is reset to zero.
eventGroup
(for example, client must guard against simultaneous calls to cuptiEventGroupDestroy, cuptiEventGroupAddEvent, etc.), and must guard against simultaneous destruction of the context in which eventGroup
was created (for example, client must guard against simultaneous calls to cudaDeviceReset, cuCtxDestroy, etc.). If cuptiEventGroupResetAllEvents is called simultaneously with this function, then returned event values are undefined.eventGroup | The event group | |
flags | Flags controlling the reading mode | |
event | The event to read | |
eventValueBufferSizeBytes | The size of eventValueBuffer in bytes, and returns the number of bytes written to eventValueBuffer | |
eventValueBuffer | Returns the event value(s) |
CUPTI_SUCCESS | ||
CUPTI_ERROR_NOT_INITIALIZED | ||
CUPTI_ERROR_INVALID_EVENT_ID | ||
CUPTI_ERROR_HARDWARE | ||
CUPTI_ERROR_INVALID_OPERATION | if eventGroup is disabled | |
CUPTI_ERROR_INVALID_PARAMETER | if eventGroup , eventValueBufferSizeBytes or eventValueBuffer is NULL | |
CUPTI_ERROR_PARAMETER_SIZE_NOT_SUFFICIENT | if size of eventValueBuffer is not sufficient |
CUptiResult cuptiEventGroupRemoveAllEvents | ( | CUpti_EventGroup | eventGroup | ) |
Remove all events from an event group. Events cannot be removed if the event group is enabled.
eventGroup | The event group |
CUPTI_SUCCESS | ||
CUPTI_ERROR_NOT_INITIALIZED | ||
CUPTI_ERROR_INVALID_OPERATION | if eventGroup is enabled | |
CUPTI_ERROR_INVALID_PARAMETER | if eventGroup is NULL |
CUptiResult cuptiEventGroupRemoveEvent | ( | CUpti_EventGroup | eventGroup, | |
CUpti_EventID | event | |||
) |
Remove event
from the an event group. The event cannot be removed if the event group is enabled.
eventGroup | The event group | |
event | The event to remove from the group |
CUPTI_SUCCESS | ||
CUPTI_ERROR_NOT_INITIALIZED | ||
CUPTI_ERROR_INVALID_EVENT_ID | ||
CUPTI_ERROR_INVALID_OPERATION | if eventGroup is enabled | |
CUPTI_ERROR_INVALID_PARAMETER | if eventGroup is NULL |
CUptiResult cuptiEventGroupResetAllEvents | ( | CUpti_EventGroup | eventGroup | ) |
Zero all the event counts in an event group.
eventGroup
(for example, client must guard against simultaneous calls to cuptiEventGroupDestroy, cuptiEventGroupAddEvent, etc.), and must guard against simultaneous destruction of the context in which eventGroup
was created (for example, client must guard against simultaneous calls to cudaDeviceReset, cuCtxDestroy, etc.).eventGroup | The event group |
CUPTI_SUCCESS | ||
CUPTI_ERROR_NOT_INITIALIZED | ||
CUPTI_ERROR_HARDWARE | ||
CUPTI_ERROR_INVALID_PARAMETER | if eventGroup is NULL |
CUptiResult cuptiEventGroupSetAttribute | ( | CUpti_EventGroup | eventGroup, | |
CUpti_EventGroupAttribute | attrib, | |||
size_t | valueSize, | |||
void * | value | |||
) |
Write an event group attribute.
eventGroup | The event group | |
attrib | The attribute to write | |
valueSize | The size, in bytes, of the value | |
value | The attribute value to write |
CUPTI_SUCCESS | ||
CUPTI_ERROR_NOT_INITIALIZED | ||
CUPTI_ERROR_INVALID_PARAMETER | if valueSize or value is NULL, or if attrib is not an event group attribute, or if attrib is not a writable attribute | |
CUPTI_ERROR_PARAMETER_SIZE_NOT_SUFFICIENT | Indicates that the value buffer is too small to hold the attribute value. |
CUptiResult cuptiEventGroupSetDisable | ( | CUpti_EventGroupSet * | eventGroupSet | ) |
Disable a set of event groups. Disabling a set of event groups stops collection of events contained in the groups.
If this call fails, some of the event groups in the set may be disabled and other event groups may remain enabled.
eventGroupSet | The pointer to the event group set |
CUPTI_SUCCESS | ||
CUPTI_ERROR_NOT_INITIALIZED | ||
CUPTI_ERROR_HARDWARE | ||
CUPTI_ERROR_INVALID_PARAMETER | if eventGroupSet is NULL |
CUptiResult cuptiEventGroupSetEnable | ( | CUpti_EventGroupSet * | eventGroupSet | ) |
Enable a set of event groups. Enabling a set of event groups zeros the value of all the events in all the groups and then starts collection of those events.
eventGroupSet | The pointer to the event group set |
CUPTI_SUCCESS | ||
CUPTI_ERROR_NOT_INITIALIZED | ||
CUPTI_ERROR_HARDWARE | ||
CUPTI_ERROR_NOT_READY | if eventGroup does not contain any events | |
CUPTI_ERROR_NOT_COMPATIBLE | if eventGroup cannot be enabled due to other already enabled event groups | |
CUPTI_ERROR_INVALID_PARAMETER | if eventGroupSet is NULL | |
CUPTI_ERROR_HARDWARE_BUSY | if other client is profiling and hardware is busy |
CUptiResult cuptiEventGroupSetsCreate | ( | CUcontext | context, | |
size_t | eventIdArraySizeBytes, | |||
CUpti_EventID * | eventIdArray, | |||
CUpti_EventGroupSets ** | eventGroupPasses | |||
) |
The number of events that can be collected simultaneously varies by device and by the type of the events. When events can be collected simultaneously, they may need to be grouped into multiple event groups because they are from different event domains. This function takes a set of events and determines how many passes are required to collect all those events, and which events can be collected simultaneously in each pass.
The CUpti_EventGroupSets returned in eventGroupPasses
indicates how many passes are required to collect the events with the numSets
field. Within each event group set, the sets
array indicates the event groups that should be collected on each pass.
context
.context | The context for event collection | |
eventIdArraySizeBytes | Size of eventIdArray in bytes | |
eventIdArray | Array of event IDs that need to be grouped | |
eventGroupPasses | Returns a CUpti_EventGroupSets object that indicates the number of passes required to collect the events and the events to collect on each pass |
CUPTI_SUCCESS | ||
CUPTI_ERROR_NOT_INITIALIZED | ||
CUPTI_ERROR_INVALID_CONTEXT | ||
CUPTI_ERROR_INVALID_EVENT_ID | ||
CUPTI_ERROR_INVALID_PARAMETER | if eventIdArray or eventGroupPasses is NULL |
CUptiResult cuptiEventGroupSetsDestroy | ( | CUpti_EventGroupSets * | eventGroupSets | ) |
Destroy a CUpti_EventGroupSets object.
eventGroupSets | The object to destroy |
CUPTI_SUCCESS | ||
CUPTI_ERROR_NOT_INITIALIZED | ||
CUPTI_ERROR_INVALID_OPERATION | if any of the event groups contained in the sets is enabled | |
CUPTI_ERROR_INVALID_PARAMETER | if eventGroupSets is NULL |
CUptiResult cuptiGetNumEventDomains | ( | uint32_t * | numDomains | ) |
Returns the total number of event domains available on any CUDA-capable device.
numDomains | Returns the number of domains |
CUPTI_SUCCESS | ||
CUPTI_ERROR_INVALID_PARAMETER | if numDomains is NULL |
CUptiResult cuptiKernelReplaySubscribeUpdate | ( | CUpti_KernelReplayUpdateFunc | updateFunc, | |
void * | customData | |||
) |
When subscribed, the function pointer passed in will be called each time a kernel run is finished during kernel replay. Previously subscribed function pointer will be replaced. Pass in NULL as the function pointer unsubscribes the update.
updateFunc | The update function pointer | |
customData | Pointer to any custom data |
CUPTI_SUCCESS |
CUptiResult cuptiSetEventCollectionMode | ( | CUcontext | context, | |
CUpti_EventCollectionMode | mode | |||
) |
Set the event collection mode for a context
. The mode
controls the event collection behavior of all events in event groups created in the context
. This API is invalid in kernel replay mode.
context | The context | |
mode | The event collection mode |
CUPTI_SUCCESS | ||
CUPTI_ERROR_NOT_INITIALIZED | ||
CUPTI_ERROR_INVALID_CONTEXT | ||
CUPTI_ERROR_INVALID_OPERATION | if called when replay mode is enabled | |
CUPTI_ERROR_NOT_SUPPORTED | if mode is not supported on the device |