From 79ca5236c3b4f458c3aa0a41dc7e5ece45c2d0f9 Mon Sep 17 00:00:00 2001 From: Michael Halkenhaeuser Date: Mon, 29 Apr 2024 09:55:31 -0400 Subject: [PATCH] [offload] Fix missing reference decrement introduced by merge resolution Added line which has been dropped from the 'deinitRuntime()' during merge-conflict resolution. Change-Id: Iee2c8b2fe63d8cd36cdb9befca2e8c93384087d9 --- offload/src/OffloadRTL.cpp | 1 + offload/src/interface.cpp | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/offload/src/OffloadRTL.cpp b/offload/src/OffloadRTL.cpp index 8d732f94b677d3..56c378acebdf40 100644 --- a/offload/src/OffloadRTL.cpp +++ b/offload/src/OffloadRTL.cpp @@ -54,6 +54,7 @@ void deinitRuntime() { PM = nullptr; } + RefCount--; } // HACK: These depricated device stubs still needs host versions for fallback diff --git a/offload/src/interface.cpp b/offload/src/interface.cpp index 6efc734fad21a5..1af787ac5f53ce 100644 --- a/offload/src/interface.cpp +++ b/offload/src/interface.cpp @@ -478,8 +478,8 @@ EXTERN void __tgt_push_mapper_component(void *RtMapperHandle, void *Base, } EXTERN void __tgt_set_info_flag(uint32_t NewInfoLevel) { - OMPT_IF_BUILT(ReturnAddressSetterRAII RA(__builtin_return_address(0))); assert(PM && "Runtime not initialized"); + OMPT_IF_BUILT(ReturnAddressSetterRAII RA(__builtin_return_address(0))); std::atomic &InfoLevel = getInfoLevelInternal(); InfoLevel.store(NewInfoLevel); for (auto &R : PM->pluginAdaptors()) @@ -487,8 +487,8 @@ EXTERN void __tgt_set_info_flag(uint32_t NewInfoLevel) { } EXTERN int __tgt_print_device_info(int64_t DeviceId) { - OMPT_IF_BUILT(ReturnAddressSetterRAII RA(__builtin_return_address(0))); assert(PM && "Runtime not initialized"); + OMPT_IF_BUILT(ReturnAddressSetterRAII RA(__builtin_return_address(0))); auto DeviceOrErr = PM->getDevice(DeviceId); if (!DeviceOrErr) FATAL_MESSAGE(DeviceId, "%s", toString(DeviceOrErr.takeError()).c_str());