diff --git a/projects/rocprofiler/src/core/profile.h b/projects/rocprofiler/src/core/profile.h index 223e2e5edf..9ed033759b 100644 --- a/projects/rocprofiler/src/core/profile.h +++ b/projects/rocprofiler/src/core/profile.h @@ -140,13 +140,14 @@ class Profile { if (status != HSA_STATUS_SUCCESS) AQL_EXC_RAISING(status, "aqlprofile_start"); status = api->hsa_ven_amd_aqlprofile_stop(&profile_, &stop); if (status != HSA_STATUS_SUCCESS) AQL_EXC_RAISING(status, "aqlprofile_stop"); + hsa_status_t rd_status = HSA_STATUS_ERROR; #ifdef AQLPROF_NEW_API - hsa_status_t rd_status = api->hsa_ven_amd_aqlprofile_read(&profile_, &read); + if (profile_.type == HSA_VEN_AMD_AQLPROFILE_EVENT_TYPE_PMC) { + rd_status = api->hsa_ven_amd_aqlprofile_read(&profile_, &read); + } #if 0 // Read API returns error if disabled if (rd_status != HSA_STATUS_SUCCESS) AQL_EXC_RAISING(status, "aqlprofile_read"); #endif -#else - hsa_status_t rd_status = HSA_STATUS_ERROR; #endif // Set completion signal