src/components/rocm/linux-rocm.c
// ----------------------------------------------------------------------------
// Callback function to get the number of agents
Callback function to get the number of agents
Callback function to get the number of agents
static hsa_status_t _rocm_get_gpu_handle(hsa_agent_t agent, void* arg)
{
  _rocm_context_t * gctxt = (_rocm_context_t*) arg;
  hsa_device_type_t type;
  ROCM_CALL_CK(hsa_agent_get_info,(agent, HSA_AGENT_INFO_DEVICE, &type), return (PAPI_EMISC));
  if (type == HSA_DEVICE_TYPE_GPU) {
    gctxt->availAgentSize += 1;
    gctxt->availAgentArray = (hsa_agent_t*) papi_realloc(gctxt->availAgentArray, (gctxt->availAgentSize*sizeof(hsa_agent_t)));
    gctxt->availAgentArray[gctxt->availAgentSize - 1] = agent;
  }
  return HSA_STATUS_SUCCESS;
}
static hsa_status_t _rocm_get_gpu_handle ( hsa_agent_t agent , void * arg ) { _rocm_context_t * gctxt = ( _rocm_context_t * ) arg ; hsa_device_type_t type ; ROCM_CALL_CK ( hsa_agent_get_info , ( agent , HSA_AGENT_INFO_DEVICE , & type ) , return ( PAPI_EMISC ) ) ; if ( type == HSA_DEVICE_TYPE_GPU ) { gctxt -> availAgentSize += 1 ; gctxt -> availAgentArray = ( hsa_agent_t * ) papi_realloc ( gctxt -> availAgentArray , ( gctxt -> availAgentSize * sizeof ( hsa_agent_t ) ) ) ; gctxt -> availAgentArray [ gctxt -> availAgentSize - 1 ] = agent ; } return HSA_STATUS_SUCCESS ; }
Callback function to get the number of agents
Callback function to get the number of agents
// Device is a GPU agent