From d3d0ca5fc6f94b87446816bd35dfdb8e8ec16a1b Mon Sep 17 00:00:00 2001 From: Saleel Kudchadker Date: Wed, 2 Oct 2024 13:42:39 -0400 Subject: [PATCH] SWDEV-478065 - Revert "SWDEV-478065 - Embed host thread in shared_ptr" This reverts commit 4b03017e8abe117986ec913d3d139ddb6fea40a3. Reason for revert: This blocks multithreaded callbacks Change-Id: I9944417e4fb63c9eea2b286c828c7dfa621c4fe8 --- rocclr/device/rocm/rocvirtual.cpp | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/rocclr/device/rocm/rocvirtual.cpp b/rocclr/device/rocm/rocvirtual.cpp index c173d60dd0..dfea660d1c 100644 --- a/rocclr/device/rocm/rocvirtual.cpp +++ b/rocclr/device/rocm/rocvirtual.cpp @@ -186,11 +186,9 @@ void Timestamp::checkGpuTime() { bool HsaAmdSignalHandler(hsa_signal_value_t value, void* arg) { Timestamp* ts = reinterpret_cast(arg); - static std::shared_ptr thread; - if (amd::Thread::current() == nullptr) { - thread = std::make_shared(); - } - if (thread.get() != amd::Thread::current()) { + amd::Thread* thread = amd::Thread::current(); + if (!(thread != nullptr || + ((thread = new amd::HostThread()) != nullptr && thread == amd::Thread::current()))) { return false; }