Skip to content

API Reference

GPU Performance API Reference

Functions

FunctionDescription
GpaBeginCommandListBegins 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 …
GpaBeginSampleBegins 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…
GpaBeginSessionBegins 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. …
GpaCloseContextCloses 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.
GpaContinueSampleOnCommandListContinues 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…
GpaCopySecondarySamplesCopies 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…
GpaCreateSessionCreates 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…
GpaDeleteSessionDeletes a session object. Deletes the specified session, along with all counter results associated with the session.
GpaDestroyUndoes 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.
GpaDisableAllCountersDisables all counters. Subsequent sampling sessions will not provide values for any disabled counters. Initially all counters are disabled, and must explicitly be enabled.
GpaDisableCounterDisables the specified counter. Subsequent sampling sessions will not provide values for any disabled counters. Initially all counters are disabled, and must explicitly be enabled.
GpaDisableCounterByNameDisables 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…
GpaEnableAllCountersEnables all counters. Subsequent sampling sessions will provide values for all counters. Initially all counters are disabled, and must explicitly be enabled.
GpaEnableCounterEnables the specified counter. Subsequent sampling sessions will provide values for any enabled counters. Initially all counters are disabled, and must explicitly be enabled.
GpaEnableCounterByNameEnables 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…
GpaEndCommandListEnds 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…
GpaEndSampleEnds 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 …
GpaEndSessionEnds 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.
GpaGetCounterDataTypeGets the data type of the specified counter.
GpaGetCounterDescriptionGets the description of the specified counter.
GpaGetCounterGroupGets the group of the specified counter.
GpaGetCounterIndexGets index of a counter given its name (case insensitive).
GpaGetCounterNameGets the name of the specified counter.
GpaGetCounterSampleTypeGets the sample type of the specified counter.
GpaGetCounterUsageTypeGets 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.”
GpaGetDataTypeAsStrGets 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…
GpaGetDeviceAndRevisionIdGets the GPU device id and revision id associated with the specified context.
GpaGetDeviceGenerationGets the device generation of the GPU associated with the specified context.
GpaGetDeviceMaxWaveSlotsGets the total number of wave slots on the GPU.
GpaGetDeviceNameGets the device name of the GPU associated with the specified context.
GpaGetEnabledIndexGets 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…
GpaGetFuncTableGets 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 …
GpaGetNumCountersGets the number of counters available.
GpaGetNumEnabledCountersGets the number of enabled counters.
GpaGetPassCountGets the number of passes required for the currently enabled set of counters.
GpaGetSampleCountGets 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…
GpaGetSampleIdGets the sample id of the sample with the specified index. This is useful if sample ids are either non-zero-based or non-consecutive.
GpaGetSampleResultGets 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…
GpaGetSampleResultSizeGets 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 …
GpaGetStatusAsStrGets 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.”
GpaGetUsageTypeAsStrGets 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…
GpaGetVersionGets the GPA version.
GpaGetDeviceMaxVgprsGets the max number of VGPRs on the GPU.
GpaInitializeInitializes 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…
GpaIsCounterEnabledChecks whether or not a counter is enabled.
GpaIsPassCompleteChecks 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…
GpaIsSessionCompleteChecks 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…
GpaOpenContextOpens the specified context, which provides access to GPU performance counters. This function must be called after GpaInitialize and before any other GPUPerfAPI functions.
GpaRegisterLoggingCallbackRegisters 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.