rocr: Remove KMT usage from AMD ext
Use the core Driver in AMD's HSA extension API to make it
agnostic to the underlying OS and kernel-mode driver.
[ROCm/ROCR-Runtime commit: d3a4dc9687]
This commit is contained in:
committed by
Yat Sin, David
parent
b42578b070
commit
3b30b8a975
@@ -1218,11 +1218,11 @@ hsa_status_t hsa_amd_spm_acquire(hsa_agent_t preferred_agent) {
|
||||
TRY;
|
||||
IS_OPEN();
|
||||
const core::Agent* agent = core::Agent::Convert(preferred_agent);
|
||||
// Currently, the SPM API is only supported for GPU agents.
|
||||
if (agent == NULL || !agent->IsValid() || agent->device_type() != core::Agent::kAmdGpuDevice)
|
||||
return HSA_STATUS_ERROR_INVALID_AGENT;
|
||||
|
||||
if (hsaKmtSPMAcquire(agent->node_id()) != HSAKMT_STATUS_SUCCESS) return HSA_STATUS_ERROR;
|
||||
return HSA_STATUS_SUCCESS;
|
||||
return agent->driver().SPMAcquire(agent->node_id());
|
||||
|
||||
CATCH;
|
||||
}
|
||||
@@ -1232,12 +1232,11 @@ hsa_status_t hsa_amd_spm_release(hsa_agent_t preferred_agent) {
|
||||
IS_OPEN();
|
||||
|
||||
const core::Agent* agent = core::Agent::Convert(preferred_agent);
|
||||
// Currently, the SPM API is only supported for GPU agents.
|
||||
if (agent == NULL || !agent->IsValid() || agent->device_type() != core::Agent::kAmdGpuDevice)
|
||||
return HSA_STATUS_ERROR_INVALID_AGENT;
|
||||
|
||||
if (hsaKmtSPMRelease(agent->node_id()) != HSAKMT_STATUS_SUCCESS) return HSA_STATUS_ERROR;
|
||||
|
||||
return HSA_STATUS_SUCCESS;
|
||||
return agent->driver().SPMRelease(agent->node_id());
|
||||
|
||||
CATCH;
|
||||
}
|
||||
@@ -1249,14 +1248,12 @@ hsa_status_t hsa_amd_spm_set_dest_buffer(hsa_agent_t preferred_agent, size_t siz
|
||||
IS_OPEN();
|
||||
|
||||
const core::Agent* agent = core::Agent::Convert(preferred_agent);
|
||||
// Currently, the SPM API is only supported for GPU agents.
|
||||
if (agent == NULL || !agent->IsValid() || agent->device_type() != core::Agent::kAmdGpuDevice)
|
||||
return HSA_STATUS_ERROR_INVALID_AGENT;
|
||||
|
||||
if (hsaKmtSPMSetDestBuffer(agent->node_id(), size_in_bytes, timeout, size_copied, dest,
|
||||
is_data_loss) != HSAKMT_STATUS_SUCCESS)
|
||||
return HSA_STATUS_ERROR;
|
||||
|
||||
return HSA_STATUS_SUCCESS;
|
||||
return agent->driver().SPMSetDestBuffer(agent->node_id(), size_in_bytes, timeout, size_copied,
|
||||
dest, is_data_loss);
|
||||
CATCH;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user