File tree Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -1553,13 +1553,27 @@ int FTN_STDCALL FTN_GET_DEVICE_NUM(void) {
15531553const char *FTN_STDCALL FTN_GET_UID_FROM_DEVICE (int device_num)
15541554 KMP_WEAK_ATTRIBUTE_EXTERNAL;
15551555const char *FTN_STDCALL FTN_GET_UID_FROM_DEVICE (int device_num) {
1556+ #if KMP_OS_DARWIN || KMP_OS_WASI || defined(KMP_STUB)
1557+ return nullptr ;
1558+ #else
1559+ const char *(*fptr)(int );
1560+ if ((*(void **)(&fptr) = KMP_DLSYM_NEXT (" omp_get_uid_from_device" )))
1561+ return (*fptr)(device_num);
15561562 // Returns the same string as used by libomptarget
15571563 return " HOST" ;
1564+ #endif
15581565}
15591566int FTN_STDCALL FTN_GET_DEVICE_FROM_UID (const char *device_uid)
15601567 KMP_WEAK_ATTRIBUTE_EXTERNAL;
15611568int FTN_STDCALL FTN_GET_DEVICE_FROM_UID (const char *device_uid) {
1569+ #if KMP_OS_DARWIN || KMP_OS_WASI || defined(KMP_STUB)
1570+ return omp_invalid_device;
1571+ #else
1572+ int (*fptr)(const char *);
1573+ if ((*(void **)(&fptr) = KMP_DLSYM_NEXT (" omp_get_device_from_uid" )))
1574+ return (*fptr)(device_uid);
15621575 return KMP_EXPAND_NAME (FTN_GET_INITIAL_DEVICE)();
1576+ #endif
15631577}
15641578
15651579// Compiler will ensure that this is only called from host in sequential region
You can’t perform that action at this time.
0 commit comments