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());