[clang] [llvm] [OpenMP] Adds omp_target_is_accessible routine (PR #138294)
via llvm-commits
llvm-commits at lists.llvm.org
Fri Sep 26 08:22:25 PDT 2025
================
@@ -3027,6 +3027,29 @@ struct AMDGPUDeviceTy : public GenericDeviceTy, AMDGenericDeviceTy {
return ((IsAPU || OMPX_ApuMaps) && IsXnackEnabled);
}
+ bool isAccessiblePtrImpl(const void *Ptr, size_t Size) override {
+ hsa_amd_pointer_info_t Info;
+ Info.size = sizeof(hsa_amd_pointer_info_t);
+
+ hsa_agent_t *Agents = nullptr;
+ uint32_t Count = 0;
+ hsa_status_t Status =
+ hsa_amd_pointer_info(Ptr, &Info, malloc, &Count, &Agents);
+
+ if (Status != HSA_STATUS_SUCCESS)
----------------
carlobertolli wrote:
I guess that the two semantically relevant errors here would be:
HSA_EXT_POINTER_TYPE_UNKNOWN
and
HSA_STATUS_ERROR_INVALID_ARGUMENT (which we should never get because we already checked whether ptr is null). The rest of the errors "out of resources, hsa not initialized" would have been caught earlier on, is my guess
https://github.com/llvm/llvm-project/pull/138294
More information about the llvm-commits
mailing list