Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 13 additions & 2 deletions unified-runtime/source/adapters/hip/context.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,19 @@ struct ur_context_handle_t_ : ur::hip::handle_base {
UR_CHECK_ERROR(urAdapterRetain(ur::hip::adapter));
};

~ur_context_handle_t_() {
UR_CHECK_ERROR(urAdapterRelease(ur::hip::adapter));
~ur_context_handle_t_() noexcept {
try {
auto result = urAdapterRelease(ur::hip::adapter);
if (result != UR_RESULT_SUCCESS) {
UR_LOG(ERR, "Failed to release adapter in context destructor: {}",
result);
}
assert(result == UR_RESULT_SUCCESS &&
"Adapter release failed in context destructor");
} catch (...) {
UR_LOG(ERR, "Exception in context destructor");
assert(false && "Exception in context destructor");
}
}

ur_context_handle_t_(const ur_context_handle_t_ &) = delete;
Expand Down
Loading