Skip to content

Commit d585681

Browse files
committed
[offload] Add early exit on plugin deinit when offloading is disabled
Add early exit during plugin de-init - when `OMP_TARGET_OFFLOAD=DISABLED` Fix a potential crash due to violated assertions - Caused by an early exit in the plugin init
1 parent 5218ea3 commit d585681

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

offload/libomptarget/PluginManager.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,10 @@ void PluginManager::init() {
6363

6464
void PluginManager::deinit() {
6565
TIMESCOPE();
66+
if (OffloadPolicy::isOffloadDisabled()) {
67+
DP("Offload is disabled. Skipping plugin deinitialization\n");
68+
return;
69+
}
6670
DP("Unloading RTLs...\n");
6771

6872
#ifdef OMPT_SUPPORT

0 commit comments

Comments
 (0)