Implement async scratch reclaim

For devices where the CP FW supports asynchronous scratch reclaim, ROCr
is able to claw-back scratch memory that was assigned to an AQL queue.
With that ability, ROCr does not have to rely on using USO
(use-scratch-once) when assigning large amounts of memory to a queue.
If we reach a situation where we are running low on device memory, ROCr
will attempt to claw-back the scratch memory.

Change-Id: Iddf8ec84e37ab8b9fdc58bafbe2b61fe2acb6eb7
This commit is contained in:
David Yat Sin
2023-11-15 18:29:18 +00:00
parent 64070a9acc
commit dca8f3a21d
12 changed files with 231 additions and 11 deletions
@@ -1292,6 +1292,10 @@ hsa_status_t HSA_API hsa_amd_vmem_get_alloc_properties_from_handle(
return amdExtTable->hsa_amd_vmem_get_alloc_properties_from_handle_fn(alloc_handle, pool, type);
}
hsa_status_t HSA_API hsa_amd_agent_set_async_scratch_limit(hsa_agent_t agent, size_t threshold) {
return amdExtTable->hsa_amd_agent_set_async_scratch_limit_fn(agent, threshold);
}
// Tools only table interfaces.
namespace rocr {