[Openmp-commits] [openmp] 9d0eb44 - [libomptarget][nfc][amdgpu] Reorder function to clarify review diff
Pushpinder Singh via Openmp-commits
openmp-commits at lists.llvm.org
Mon Sep 27 02:31:31 PDT 2021
Author: Pushpinder Singh
Date: 2021-09-27T09:30:55Z
New Revision: 9d0eb440ff40a46a30c10a96a9ef86e50fd932a7
URL: https://github.com/llvm/llvm-project/commit/9d0eb440ff40a46a30c10a96a9ef86e50fd932a7
DIFF: https://github.com/llvm/llvm-project/commit/9d0eb440ff40a46a30c10a96a9ef86e50fd932a7.diff
LOG: [libomptarget][nfc][amdgpu] Reorder function to clarify review diff
Added:
Modified:
openmp/libomptarget/plugins/amdgpu/src/rtl.cpp
Removed:
################################################################################
diff --git a/openmp/libomptarget/plugins/amdgpu/src/rtl.cpp b/openmp/libomptarget/plugins/amdgpu/src/rtl.cpp
index e08b4b28f243..16493829f259 100644
--- a/openmp/libomptarget/plugins/amdgpu/src/rtl.cpp
+++ b/openmp/libomptarget/plugins/amdgpu/src/rtl.cpp
@@ -304,6 +304,21 @@ uint16_t create_header() {
return header;
}
+std::pair<hsa_status_t, bool>
+isValidMemoryPool(hsa_amd_memory_pool_t MemoryPool) {
+ bool AllocAllowed = false;
+ hsa_status_t Err = hsa_amd_memory_pool_get_info(
+ MemoryPool, HSA_AMD_MEMORY_POOL_INFO_RUNTIME_ALLOC_ALLOWED,
+ &AllocAllowed);
+ if (Err != HSA_STATUS_SUCCESS) {
+ DP("Alloc allowed in memory pool check failed: %s\n",
+ get_error_string(Err));
+ return {Err, false};
+ }
+
+ return {HSA_STATUS_SUCCESS, AllocAllowed};
+}
+
hsa_status_t addKernArgPool(hsa_amd_memory_pool_t MemoryPool, void *Data) {
std::vector<hsa_amd_memory_pool_t> *Result =
static_cast<std::vector<hsa_amd_memory_pool_t> *>(Data);
@@ -347,21 +362,6 @@ hsa_status_t addKernArgPool(hsa_amd_memory_pool_t MemoryPool, void *Data) {
return HSA_STATUS_SUCCESS;
}
-std::pair<hsa_status_t, bool>
-isValidMemoryPool(hsa_amd_memory_pool_t MemoryPool) {
- bool AllocAllowed = false;
- hsa_status_t Err = hsa_amd_memory_pool_get_info(
- MemoryPool, HSA_AMD_MEMORY_POOL_INFO_RUNTIME_ALLOC_ALLOWED,
- &AllocAllowed);
- if (Err != HSA_STATUS_SUCCESS) {
- DP("Alloc allowed in memory pool check failed: %s\n",
- get_error_string(Err));
- return {Err, false};
- }
-
- return {HSA_STATUS_SUCCESS, AllocAllowed};
-}
-
template <typename AccumulatorFunc>
hsa_status_t collectMemoryPools(const std::vector<hsa_agent_t> &Agents,
AccumulatorFunc Func) {
More information about the Openmp-commits
mailing list