API Reference
GPU Performance API Reference
Functions
| Function | Description |
|---|---|
| GpaBeginCommandList | Begins a command list for sampling. You will be unable to create samples on a command list or command buffer before GpaBeginCommandList is called. The session must have been previously created and … |
| GpaBeginSample | Begins a sample in a command list. A sample is a particular workload for which counters will be collected. If the owning session was created with kGpaSessionSampleTypeDiscreteCounter and one or mor… |
| GpaBeginSession | Begins sampling with the currently enabled set of counters. A session must have been created using GpaCreateSession before it can be started. A session must be started before creating any samples. … |
| GpaCloseContext | Closes the specified context, which ends access to GPU performance counters. After closing a context, GPA functions should not be called again until the counters are reopened with GpaOpenContext. |
| GpaContinueSampleOnCommandList | Continues a sample from one primary command list on to another primary command list. This function is only supported for DirectX 12 and Vulkan. Normally samples must be started and ended on the sam… |
| GpaCopySecondarySamples | Copies a set of samples from a secondary command list back to the primary command list that executed the secondary command list. This function is only supported for DirectX 12 and Vulkan. You canno… |
| GpaCreateSession | Creates a session on the specified context. A unique session identifier will be returned which allows counters to be enabled, samples to be measured, and stores the results of the profile. The samp… |
| GpaDeleteSession | Deletes a session object. Deletes the specified session, along with all counter results associated with the session. |
| GpaDestroy | Undoes any initialization to ensure proper behavior in applications that are not being profiled. This function must be called before the rendering context or device is released / destroyed. |
| GpaDisableAllCounters | Disables all counters. Subsequent sampling sessions will not provide values for any disabled counters. Initially all counters are disabled, and must explicitly be enabled. |
| GpaDisableCounter | Disables the specified counter. Subsequent sampling sessions will not provide values for any disabled counters. Initially all counters are disabled, and must explicitly be enabled. |
| GpaDisableCounterByName | Disables the counter with the specified counter name (case insensitive). Subsequent sampling sessions will not provide values for any disabled counters. Initially all counters are disabled, and mus… |
| GpaEnableAllCounters | Enables all counters. Subsequent sampling sessions will provide values for all counters. Initially all counters are disabled, and must explicitly be enabled. |
| GpaEnableCounter | Enables the specified counter. Subsequent sampling sessions will provide values for any enabled counters. Initially all counters are disabled, and must explicitly be enabled. |
| GpaEnableCounterByName | Enables the counter with the specified counter name (case insensitive). Subsequent sampling sessions will provide values for any enabled counters. Initially all counters are disabled, and must expl… |
| GpaEndCommandList | Ends command list for sampling. You will be unable to create samples on the specified command list after GpaEndCommandList is called. For DirectX 12, GpaEndCommandList should be called before the a… |
| GpaEndSample | Ends a sample in a command list. A sample is a particular workload for which counters will be collected. If the owning session was created with kGpaSessionSampleTypeDiscreteCounter and one or more … |
| GpaEndSession | Ends sampling with the currently enabled set of counters. This will end the sampling process. A session must be ended before results for that session can be queried. |
| GpaGetCounterDataType | Gets the data type of the specified counter. |
| GpaGetCounterDescription | Gets the description of the specified counter. |
| GpaGetCounterGroup | Gets the group of the specified counter. |
| GpaGetCounterIndex | Gets index of a counter given its name (case insensitive). |
| GpaGetCounterName | Gets the name of the specified counter. |
| GpaGetCounterSampleType | Gets the sample type of the specified counter. |
| GpaGetCounterUsageType | Gets the usage type of the specified counter. The usage type indicates the units used for the counter. |
| GpaGetCounterUuid | ”Gets the UUID type of the specified counter. The UUID can be used to uniquely identify the counter. A counter’s unique identifier can change from one version of GPA to the next.” |
| GpaGetDataTypeAsStr | Gets a string representation of the specified counter data type. This could be used to display counter types along with their name or value. For example the kGpaDataTypeUint64 counter_data_type wou… |
| GpaGetDeviceAndRevisionId | Gets the GPU device id and revision id associated with the specified context. |
| GpaGetDeviceGeneration | Gets the device generation of the GPU associated with the specified context. |
| GpaGetDeviceMaxWaveSlots | Gets the total number of wave slots on the GPU. |
| GpaGetDeviceName | Gets the device name of the GPU associated with the specified context. |
| GpaGetEnabledIndex | Gets the counter index for an enabled counter. This is meant to be used with GpaGetNumEnabledCounters. Once you determine the number of enabled counters, you can use GpaGetEnabledIndex to determine… |
| GpaGetFuncTable | Gets the GPA API function table. gpa_func_table is both an input and output parameter, whose type is GpaFunctionTable*. Prior to calling this function the major_version and minor_version should be … |
| GpaGetNumCounters | Gets the number of counters available. |
| GpaGetNumEnabledCounters | Gets the number of enabled counters. |
| GpaGetPassCount | Gets the number of passes required for the currently enabled set of counters. |
| GpaGetSampleCount | Gets the number of samples created for the specified session. This is useful if samples are conditionally created and a count is not kept. The session must have been ended by GpaEndSession before c… |
| GpaGetSampleId | Gets the sample id of the sample with the specified index. This is useful if sample ids are either non-zero-based or non-consecutive. |
| GpaGetSampleResult | Gets the result data for a given sample. This function will block until results are ready. Use GpaIsSessionComplete to check if results are ready. For discrete counter samples, the data will be a s… |
| GpaGetSampleResultSize | Gets the result size (in bytes) for a given sample. For discrete counter samples, the size will be the same for all samples, so it would be valid to retrieve the result size for one sample and use … |
| GpaGetStatusAsStr | Gets a string representation of the specified GPA status value. Provides a simple method to convert a GpaStatus value into a string which can be used to display log messages. When an error is retur… |
| GpaGetSupportedSampleTypes | ”Gets a mask of the sample types supported by the specified context. A call to GpaCreateSession will fail if the requested sample types are not compatible with the context’s sample types.” |
| GpaGetUsageTypeAsStr | Gets a string representation of the specified counter usage type. This could be used to display counter units along with their name or value. For example, the kGpaUsageTypePercentage usage_type_str… |
| GpaGetVersion | Gets the GPA version. |
| GpaGetDeviceMaxVgprs | Gets the max number of VGPRs on the GPU. |
| GpaInitialize | Initializes the driver so that counters are exposed. This function must be called before the rendering context or device is created. In the case of DirectX 12 or Vulkan, this function must be calle… |
| GpaIsCounterEnabled | Checks whether or not a counter is enabled. |
| GpaIsPassComplete | Checks whether or not a pass has finished. After sampling a workload, results may be available immediately or take a certain amount of time to become available. This function allows you to determin… |
| GpaIsSessionComplete | Checks if results for all samples within a session are available. After a sampling session results may be available immediately or take a certain amount of time to become available. This function a… |
| GpaOpenContext | Opens the specified context, which provides access to GPU performance counters. This function must be called after GpaInitialize and before any other GPUPerfAPI functions. |
| GpaRegisterLoggingCallback | Registers a callback function to receive log messages. Only one callback function can be registered, so the implementation should be able to handle the different types of messages. A parameter to t… |
Types
For information on the various typedefs, enumerations, and macros used in the GPUPerfAPI interface, please refer to the declarations in the gpu_performance_api/gpu_perf_api_types.h header file.