[Openmp-commits] [openmp] [Libomptarget] Add a utility function for checking existence of symbols (PR #74550)
Johannes Doerfert via Openmp-commits
openmp-commits at lists.llvm.org
Wed Dec 6 13:17:23 PST 2023
================
@@ -785,14 +785,9 @@ Error GenericDeviceTy::deinit(GenericPluginTy &Plugin) {
GenericGlobalHandlerTy &GHandler = Plugin.getGlobalHandler();
for (auto *Image : LoadedImages) {
DeviceMemoryPoolTrackingTy ImageDeviceMemoryPoolTracking = {0, 0, ~0U, 0};
- GlobalTy TrackerGlobal("__omp_rtl_device_memory_pool_tracker",
- sizeof(DeviceMemoryPoolTrackingTy),
- &ImageDeviceMemoryPoolTracking);
- if (auto Err =
- GHandler.readGlobalFromDevice(*this, *Image, TrackerGlobal)) {
- consumeError(std::move(Err));
+ if (!GHandler.isSymbolInImage(*this, *Image,
+ "__omp_rtl_device_memory_pool_tracker"))
----------------
jdoerfert wrote:
This is the use of `GHandler.readGlobalFromDevice` for `__omp_rtl_device_memory_pool_tracker` that is actually needed.
The other use should be a "isSymbolInImage".
https://github.com/llvm/llvm-project/pull/74550
More information about the Openmp-commits
mailing list