PC Sampling: API to list supported configurations

Add new PC Sampling API to list the supported PC Sampling methods and
options on a specific agent. If there is already a PC Sampling session
active on this agent, the list of methods returned will be reduced to
methods that can be run simultaneously with the current active session.

Change-Id: I42ac2b8f30d5c368faf8ed4cf37ca4134db22985
This commit is contained in:
David Yat Sin
2023-09-23 15:41:40 +00:00
rodzic 0bc244e10a
commit 295acf6b27
7 zmienionych plików z 102 dodań i 0 usunięć
@@ -79,6 +79,22 @@ template <class T> static __forceinline bool IsValid(T* ptr) {
namespace pcs {
hsa_status_t hsa_ven_amd_pcs_iterate_configuration(
hsa_agent_t hsa_agent, hsa_ven_amd_pcs_iterate_configuration_callback_t configuration_callback,
void* callback_data) {
TRY;
IS_OPEN();
core::Agent* agent = core::Agent::Convert(hsa_agent);
if (agent == NULL || !agent->IsValid() || agent->device_type() != core::Agent::kAmdGpuDevice)
return HSA_STATUS_ERROR_INVALID_AGENT;
return PcsRuntime::instance()->PcSamplingIterateConfig(agent, configuration_callback,
callback_data);
CATCH;
}
void LoadPcSampling(core::PcSamplingExtTableInternal* pcs_api) {
pcs_api->hsa_ven_amd_pcs_iterate_configuration_fn = hsa_ven_amd_pcs_iterate_configuration;
pcs_api->hsa_ven_amd_pcs_create_fn = hsa_ven_amd_pcs_create;