[llvm-branch-commits] [llvm] [openmp] [OpenMP] Implement omp_get_uid_from_device() / omp_get_device_from_uid() (PR #164392)
Michael Klemm via llvm-branch-commits
llvm-branch-commits at lists.llvm.org
Tue Oct 21 06:52:53 PDT 2025
================
@@ -91,6 +93,59 @@ EXTERN int omp_get_device_num(void) {
return HostDevice;
}
+EXTERN int omp_get_device_from_uid(const char *DeviceUid) {
+ TIMESCOPE();
+ OMPT_IF_BUILT(ReturnAddressSetterRAII RA(__builtin_return_address(0)));
+
+ if (!DeviceUid) {
+ DP("Call to omp_get_device_from_uid returning omp_invalid_device\n");
+ return omp_invalid_device;
+ }
+ if (strcmp(DeviceUid, GenericDeviceTy::getHostDeviceUid()) == 0) {
----------------
mjklemm wrote:
Nit: make this a `static inline` function to document what it is supposed to mean.
https://github.com/llvm/llvm-project/pull/164392
More information about the llvm-branch-commits
mailing list