Skip to content

Commit

Permalink
[offload] Fix missing reference decrement introduced by merge resolution
Browse files Browse the repository at this point in the history
Added line which has been dropped from the 'deinitRuntime()' during
merge-conflict resolution.

Change-Id: Iee2c8b2fe63d8cd36cdb9befca2e8c93384087d9
  • Loading branch information
mhalk authored and ronlieb committed Apr 30, 2024
1 parent 73aa06a commit 79ca523
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions offload/src/OffloadRTL.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ void deinitRuntime() {
PM = nullptr;
}

RefCount--;
}

// HACK: These depricated device stubs still needs host versions for fallback
Expand Down
4 changes: 2 additions & 2 deletions offload/src/interface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -478,17 +478,17 @@ 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<uint32_t> &InfoLevel = getInfoLevelInternal();
InfoLevel.store(NewInfoLevel);
for (auto &R : PM->pluginAdaptors())
R.set_info_flag(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());
Expand Down

0 comments on commit 79ca523

Please sign in to comment.