File tree Expand file tree Collapse file tree 3 files changed +6
-2
lines changed
offload/libomptarget/OpenMP Expand file tree Collapse file tree 3 files changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -93,6 +93,10 @@ EXTERN int omp_get_device_num(void) {
9393 return HostDevice;
9494}
9595
96+ static inline bool is_host_device_uid (const char *DeviceUid) {
97+ return strcmp (DeviceUid, GenericDeviceTy::getHostDeviceUid ()) == 0 ;
98+ }
99+
96100EXTERN int omp_get_device_from_uid (const char *DeviceUid) {
97101 TIMESCOPE ();
98102 OMPT_IF_BUILT (ReturnAddressSetterRAII RA (__builtin_return_address (0 )));
@@ -101,7 +105,7 @@ EXTERN int omp_get_device_from_uid(const char *DeviceUid) {
101105 DP (" Call to omp_get_device_from_uid returning omp_invalid_device\n " );
102106 return omp_invalid_device;
103107 }
104- if (strcmp (DeviceUid, GenericDeviceTy::getHostDeviceUid ()) == 0 ) {
108+ if (is_host_device_uid (DeviceUid) ) {
105109 DP (" Call to omp_get_device_from_uid returning host device number %d\n " ,
106110 omp_get_initial_device ());
107111 return omp_get_initial_device ();
Original file line number Diff line number Diff line change @@ -21,6 +21,7 @@ template <typename T> using Constant = __gpu_constant T;
2121template <typename T> using Local = __gpu_local T;
2222template <typename T> using Global = __gpu_local T;
2323
24+ // See definition in OpenMP (omp.h.var/omp_lib.(F90|h).var)
2425#define omp_invalid_device -2
2526
2627enum omp_proc_bind_t {
Original file line number Diff line number Diff line change @@ -1550,7 +1550,6 @@ int FTN_STDCALL FTN_GET_DEVICE_NUM(void) KMP_WEAK_ATTRIBUTE_EXTERNAL;
15501550int FTN_STDCALL FTN_GET_DEVICE_NUM (void ) {
15511551 return KMP_EXPAND_NAME (FTN_GET_INITIAL_DEVICE)();
15521552}
1553-
15541553const char *FTN_STDCALL FTN_GET_UID_FROM_DEVICE (int device_num)
15551554 KMP_WEAK_ATTRIBUTE_EXTERNAL;
15561555const char *FTN_STDCALL FTN_GET_UID_FROM_DEVICE (int device_num) {
You can’t perform that action at this time.
0 commit comments