Skip to content

Commit 9d0eb44

Browse files
committed
[libomptarget][nfc][amdgpu] Reorder function to clarify review diff
1 parent ffdf0a3 commit 9d0eb44

File tree

1 file changed

+15
-15
lines changed
  • openmp/libomptarget/plugins/amdgpu/src

1 file changed

+15
-15
lines changed

openmp/libomptarget/plugins/amdgpu/src/rtl.cpp

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -304,6 +304,21 @@ uint16_t create_header() {
304304
return header;
305305
}
306306

307+
std::pair<hsa_status_t, bool>
308+
isValidMemoryPool(hsa_amd_memory_pool_t MemoryPool) {
309+
bool AllocAllowed = false;
310+
hsa_status_t Err = hsa_amd_memory_pool_get_info(
311+
MemoryPool, HSA_AMD_MEMORY_POOL_INFO_RUNTIME_ALLOC_ALLOWED,
312+
&AllocAllowed);
313+
if (Err != HSA_STATUS_SUCCESS) {
314+
DP("Alloc allowed in memory pool check failed: %s\n",
315+
get_error_string(Err));
316+
return {Err, false};
317+
}
318+
319+
return {HSA_STATUS_SUCCESS, AllocAllowed};
320+
}
321+
307322
hsa_status_t addKernArgPool(hsa_amd_memory_pool_t MemoryPool, void *Data) {
308323
std::vector<hsa_amd_memory_pool_t> *Result =
309324
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) {
347362
return HSA_STATUS_SUCCESS;
348363
}
349364

350-
std::pair<hsa_status_t, bool>
351-
isValidMemoryPool(hsa_amd_memory_pool_t MemoryPool) {
352-
bool AllocAllowed = false;
353-
hsa_status_t Err = hsa_amd_memory_pool_get_info(
354-
MemoryPool, HSA_AMD_MEMORY_POOL_INFO_RUNTIME_ALLOC_ALLOWED,
355-
&AllocAllowed);
356-
if (Err != HSA_STATUS_SUCCESS) {
357-
DP("Alloc allowed in memory pool check failed: %s\n",
358-
get_error_string(Err));
359-
return {Err, false};
360-
}
361-
362-
return {HSA_STATUS_SUCCESS, AllocAllowed};
363-
}
364-
365365
template <typename AccumulatorFunc>
366366
hsa_status_t collectMemoryPools(const std::vector<hsa_agent_t> &Agents,
367367
AccumulatorFunc Func) {

0 commit comments

Comments
 (0)