AMD_DBGAPI  0.31.0
Data Structures | Macros | Enumerations | Functions
Agents

Operations related to AMD GPU agents accessible to a process. More...

Data Structures

struct  amd_dbgapi_agent_id_t
 Opaque agent handle. More...
 

Macros

#define AMD_DBGAPI_AGENT_NONE   (amd_dbgapi_agent_id_t{ 0 })
 The NULL agent handle. More...
 

Enumerations

enum  amd_dbgapi_agent_info_t {
  AMD_DBGAPI_AGENT_INFO_NAME = 1, AMD_DBGAPI_AGENT_INFO_ARCHITECTURE = 2, AMD_DBGAPI_AGENT_INFO_PCI_SLOT = 3, AMD_DBGAPI_AGENT_INFO_PCI_VENDOR_ID = 4,
  AMD_DBGAPI_AGENT_INFO_PCI_DEVICE_ID = 5, AMD_DBGAPI_AGENT_INFO_SHADER_ENGINE_COUNT = 6, AMD_DBGAPI_AGENT_INFO_COMPUTE_UNIT_COUNT = 7, AMD_DBGAPI_AGENT_INFO_NUM_SIMD_PER_COMPUTE_UNIT = 8,
  AMD_DBGAPI_AGENT_INFO_MAX_WAVES_PER_SIMD = 9
}
 Agent queries that are supported by amd_dbgapi_agent_get_info. More...
 

Functions

amd_dbgapi_status_t AMD_DBGAPI amd_dbgapi_agent_get_info (amd_dbgapi_process_id_t process_id, amd_dbgapi_agent_id_t agent_id, amd_dbgapi_agent_info_t query, size_t value_size, void *value) AMD_DBGAPI_VERSION_0_24
 Query information about an agent. More...
 
amd_dbgapi_status_t AMD_DBGAPI amd_dbgapi_agent_list (amd_dbgapi_process_id_t process_id, size_t *agent_count, amd_dbgapi_agent_id_t **agents, amd_dbgapi_changed_t *changed) AMD_DBGAPI_VERSION_0_24
 Return the list of agents for a process. More...
 

Detailed Description

Operations related to AMD GPU agents accessible to a process.

Agent is the term for AMD GPU devices that can be accessed by the process.

Macro Definition Documentation

◆ AMD_DBGAPI_AGENT_NONE

#define AMD_DBGAPI_AGENT_NONE   (amd_dbgapi_agent_id_t{ 0 })

The NULL agent handle.

Enumeration Type Documentation

◆ amd_dbgapi_agent_info_t

Agent queries that are supported by amd_dbgapi_agent_get_info.

Each query specifies the type of data returned in the value argument to amd_dbgapi_agent_get_info.

Enumerator
AMD_DBGAPI_AGENT_INFO_NAME 

Agent name.

The type of this attribute is a poiter to a NUL terminated char*. It is allocated by amd_dbgapi_callbacks_s::allocate_memory and is owned by the client.

AMD_DBGAPI_AGENT_INFO_ARCHITECTURE 

Return the architecture of this agent.

The type of this attribute is amd_dbgapi_architecture_id_t.

AMD_DBGAPI_AGENT_INFO_PCI_SLOT 

PCI slot of the agent in BDF format (see [Bus:Device.Function (BDF) Notation][bfd].

The type of this attribute is uint16_t.

AMD_DBGAPI_AGENT_INFO_PCI_VENDOR_ID 

PCI vendor ID of the agent.

The type of this attribute is uint32_t.

AMD_DBGAPI_AGENT_INFO_PCI_DEVICE_ID 

PCI device ID of the agent.

The type of this attribute is uint32_t.

AMD_DBGAPI_AGENT_INFO_SHADER_ENGINE_COUNT 

The number of Shader Engines (SE) in the agent.

The type of this attribute is size_t.

AMD_DBGAPI_AGENT_INFO_COMPUTE_UNIT_COUNT 

Number of compute units available in the agent.

The type of this attribute is size_t.

AMD_DBGAPI_AGENT_INFO_NUM_SIMD_PER_COMPUTE_UNIT 

Number of SIMDs per compute unit (CU).

The type of this attribute is size_t.

AMD_DBGAPI_AGENT_INFO_MAX_WAVES_PER_SIMD 

Maximum number of waves possible in a SIMD.

The type of this attribute is size_t.

Function Documentation

◆ amd_dbgapi_agent_get_info()

amd_dbgapi_status_t AMD_DBGAPI amd_dbgapi_agent_get_info ( amd_dbgapi_process_id_t  process_id,
amd_dbgapi_agent_id_t  agent_id,
amd_dbgapi_agent_info_t  query,
size_t  value_size,
void *  value 
)

Query information about an agent.

amd_dbgapi_agent_info_t specifies the queries supported and the type returned using the value argument.

Parameters
[in]process_idThe process to which the agent belongs.
[in]agent_idThe handle of the agent being queried.
[in]queryThe query being requested.
[in]value_sizeSize of the memory pointed to by value. Must be equal to the byte size of the query result.
[out]valuePointer to memory where the query result is stored.
Return values
AMD_DBGAPI_STATUS_SUCCESSThe function has been executed successfully and the result is stored in value.
AMD_DBGAPI_STATUS_FATALA fatal error occurred. The library is left uninitialized and value is unaltered.
AMD_DBGAPI_STATUS_ERROR_NOT_INITIALIZEDThe library is not initialized. The library is left uninitialized and value is unaltered.
AMD_DBGAPI_STATUS_ERROR_INVALID_PROCESS_IDprocess_id is invalid. value is unaltered.
AMD_DBGAPI_STATUS_ERROR_INVALID_AGENT_IDagent_id is invalid. value is unaltered.
AMD_DBGAPI_STATUS_ERROR_INVALID_ARGUMENTvalue is NULL or query is invalid. value is unaltered.
AMD_DBGAPI_STATUS_ERROR_INVALID_ARGUMENT_SIZEvalue_size does not match the size of the result. value is unaltered.
AMD_DBGAPI_STATUS_ERROR_CLIENT_CALLBACKThis will be reported if the amd_dbgapi_callbacks_s::allocate_memory callback used to allocate value returns NULL. value is unaltered.

◆ amd_dbgapi_agent_list()

amd_dbgapi_status_t AMD_DBGAPI amd_dbgapi_agent_list ( amd_dbgapi_process_id_t  process_id,
size_t *  agent_count,
amd_dbgapi_agent_id_t **  agents,
amd_dbgapi_changed_t changed 
)

Return the list of agents for a process.

The order of the agent handles in the list is unspecified and can vary between calls.

Parameters
[in]process_idThe process for which the agent list is requested.
[out]agent_countThe number of agents accessed by the process.
[out]agentsIf changed is not NULL and the agent list has not changed since the last call to amd_dbgapi_agent_list then return NULL. Otherwise, return a pointer to an array of amd_dbgapi_agent_id_t with agent_count elements. It is allocated by the amd_dbgapi_callbacks_s::allocate_memory callback and is owned by the client.
[in,out]changedIf NULL then left unaltered. If non-NULL, set to AMD_DBGAPI_CHANGED_NO if the list of agents is the same as when amd_dbgapi_agent_list was last called, otherwise set to AMD_DBGAPI_CHANGED_YES.
Return values
AMD_DBGAPI_STATUS_SUCCESSThe function has been executed successfully and the result is stored in changed, agent_count, and agents.
AMD_DBGAPI_STATUS_FATALA fatal error occurred. The library is left uninitialized; and agent_count, agents, and changed are unaltered.
AMD_DBGAPI_STATUS_ERROR_NOT_INITIALIZEDThe library is not initialized. The library is left uninitialized; and agent_count, agents, and changed are unaltered.
AMD_DBGAPI_STATUS_ERROR_INVALID_PROCESS_IDprocess_id is invalid. agent_count, agents, and changed are unaltered.
AMD_DBGAPI_STATUS_ERROR_INVALID_ARGUMENTagent_count or agents are NULL, or changed is invalid. agent_count, agents, and changed are unaltered.
AMD_DBGAPI_STATUS_ERROR_CLIENT_CALLBACKThis will be reported if the amd_dbgapi_callbacks_s::allocate_memory callback used to allocate agents returns NULL. agent_count, agents, and changed are unaltered.