From 355cf758a9b1a66a8ac9f8ddee49795a094f5243 Mon Sep 17 00:00:00 2001 From: Sean Keely Date: Wed, 29 Apr 2020 14:36:22 -0500 Subject: [PATCH] Remove PointerInfo fragment branch. All types which could be generated from a fragment need to take this branch. Taking the branch is correct for all types, it was a performance optimization only and was missing IPC. Branch removal simplifies updates for any future fragment use and will allow CQE to report any performance issues that might require bringing the branch back. Change-Id: I8041788c422e880b764e144eb1877f5126ba76f3 [ROCm/ROCR-Runtime commit: 09ebc21d13086176ccf56e0e2310e245d40ae875] --- .../runtime/hsa-runtime/core/runtime/runtime.cpp | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/projects/rocr-runtime/runtime/hsa-runtime/core/runtime/runtime.cpp b/projects/rocr-runtime/runtime/hsa-runtime/core/runtime/runtime.cpp index 2debd164ac..dd3dfab487 100644 --- a/projects/rocr-runtime/runtime/hsa-runtime/core/runtime/runtime.cpp +++ b/projects/rocr-runtime/runtime/hsa-runtime/core/runtime/runtime.cpp @@ -800,12 +800,11 @@ hsa_status_t Runtime::PtrInfo(void* ptr, hsa_amd_pointer_info_t* info, void* (*a block_info->base = (retInfo.hostBaseAddress ? retInfo.hostBaseAddress : retInfo.agentBaseAddress); block_info->length = retInfo.sizeInBytes; } - if (retInfo.type == HSA_EXT_POINTER_TYPE_HSA) { - auto fragment = allocation_map_.upper_bound(ptr); - if (fragment != allocation_map_.begin()) { - fragment--; - if ((fragment->first <= ptr) && - (ptr < reinterpret_cast(fragment->first) + fragment->second.size)) { + auto fragment = allocation_map_.upper_bound(ptr); + if (fragment != allocation_map_.begin()) { + fragment--; + if ((fragment->first <= ptr) && + (ptr < reinterpret_cast(fragment->first) + fragment->second.size)) { // agent and host address must match here. Only lock memory is allowed to have differing // addresses but lock memory has type HSA_EXT_POINTER_TYPE_LOCKED and cannot be // suballocated. @@ -813,7 +812,6 @@ hsa_status_t Runtime::PtrInfo(void* ptr, hsa_amd_pointer_info_t* info, void* (*a retInfo.hostBaseAddress = retInfo.agentBaseAddress; retInfo.sizeInBytes = fragment->second.size; retInfo.userData = fragment->second.user_ptr; - } } } } // end lock scope