[Openmp-commits] [PATCH] D146081: [OpenMP][libomptarget] Init device when printing device info

Kevin Sala via Phabricator via Openmp-commits openmp-commits at lists.llvm.org
Tue May 9 09:50:28 PDT 2023


This revision was automatically updated to reflect the committed changes.
Closed by commit rGaa326559c443: [OpenMP][libomptarget] Init device when printing device info (authored by kevinsala).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D146081/new/

https://reviews.llvm.org/D146081

Files:
  openmp/libomptarget/src/interface.cpp


Index: openmp/libomptarget/src/interface.cpp
===================================================================
--- openmp/libomptarget/src/interface.cpp
+++ openmp/libomptarget/src/interface.cpp
@@ -384,6 +384,12 @@
 }
 
 EXTERN int __tgt_print_device_info(int64_t DeviceId) {
+  // Make sure the device is ready.
+  if (!deviceIsReady(DeviceId)) {
+    DP("Device %" PRId64 " is not ready\n", DeviceId);
+    return OMP_TGT_FAIL;
+  }
+
   return PM->Devices[DeviceId]->printDeviceInfo(
       PM->Devices[DeviceId]->RTLDeviceID);
 }


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D146081.520734.patch
Type: text/x-patch
Size: 537 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/openmp-commits/attachments/20230509/bf59ccfd/attachment-0001.bin>


More information about the Openmp-commits mailing list