diff --git a/projects/rocr-runtime/runtime/hsa-runtime/core/inc/scratch_cache.h b/projects/rocr-runtime/runtime/hsa-runtime/core/inc/scratch_cache.h index 3b81b20690..792e273516 100644 --- a/projects/rocr-runtime/runtime/hsa-runtime/core/inc/scratch_cache.h +++ b/projects/rocr-runtime/runtime/hsa-runtime/core/inc/scratch_cache.h @@ -195,6 +195,7 @@ class ScratchCache { } size_t free_bytes() const { return available_bytes_; } + size_t reserved_bytes() const { return reserved_.first; } void reserve(size_t bytes, void* base) { assert(!reserved_.first && "Already reserved memory."); diff --git a/projects/rocr-runtime/runtime/hsa-runtime/core/runtime/amd_gpu_agent.cpp b/projects/rocr-runtime/runtime/hsa-runtime/core/runtime/amd_gpu_agent.cpp index 06f30d994a..2f8b9b1257 100644 --- a/projects/rocr-runtime/runtime/hsa-runtime/core/runtime/amd_gpu_agent.cpp +++ b/projects/rocr-runtime/runtime/hsa-runtime/core/runtime/amd_gpu_agent.cpp @@ -1231,7 +1231,7 @@ hsa_status_t GpuAgent::GetInfo(hsa_agent_info_t attribute, void* value) const { for (auto r : regions()) availableBytes += ((AMD::MemoryRegion*)r)->GetCacheSize(); - availableBytes += scratch_cache_.free_bytes(); + availableBytes += scratch_cache_.free_bytes() - scratch_cache_.reserved_bytes(); *((uint64_t*)value) = availableBytes; break;