diff --git a/projects/clr/hipamd/src/hip_internal.hpp b/projects/clr/hipamd/src/hip_internal.hpp index 99bdf00d49..31ec410d5c 100644 --- a/projects/clr/hipamd/src/hip_internal.hpp +++ b/projects/clr/hipamd/src/hip_internal.hpp @@ -409,7 +409,7 @@ namespace hip { Device(amd::Context* ctx, int devId): context_(ctx), deviceId_(devId), null_stream_(this, Stream::Priority::Normal, 0, true), - flags_(hipDeviceScheduleSpin), + flags_(hipDeviceScheduleSpin), isActive_(false), default_mem_pool_(nullptr), current_mem_pool_(nullptr) diff --git a/projects/clr/hipamd/src/hip_stream.cpp b/projects/clr/hipamd/src/hip_stream.cpp index 35d673b953..a0444334db 100644 --- a/projects/clr/hipamd/src/hip_stream.cpp +++ b/projects/clr/hipamd/src/hip_stream.cpp @@ -48,12 +48,8 @@ Stream::~Stream() { amd::ScopedLock lock(streamSetLock); streamSet.erase(this); - // Skip queue destruction for null stream in MT. Queue worker thread can be destroyed on - // the app exit, during the stream destruction, causing a race condition. - if (!null_ || AMD_DIRECT_DISPATCH) { - queue_->release(); - queue_ = nullptr; - } + queue_->release(); + queue_ = nullptr; } }