From 78e44f5d83c28e54fe92277b6b18c1ef0ead0682 Mon Sep 17 00:00:00 2001 From: Felix Schlepper Date: Wed, 13 Aug 2025 11:39:13 +0200 Subject: [PATCH] GPU: make ITS framework allocator thread-safe Signed-off-by: Felix Schlepper --- GPU/GPUTracking/Global/GPUChainITS.cxx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/GPU/GPUTracking/Global/GPUChainITS.cxx b/GPU/GPUTracking/Global/GPUChainITS.cxx index 18fb5ff1de939..a62f99f9e47e8 100644 --- a/GPU/GPUTracking/Global/GPUChainITS.cxx +++ b/GPU/GPUTracking/Global/GPUChainITS.cxx @@ -17,7 +17,7 @@ #include "DataFormatsITS/TrackITS.h" #include "ITStracking/ExternalAllocator.h" #include "GPUReconstructionIncludesITS.h" -#include +#include using namespace o2::gpu; @@ -28,6 +28,7 @@ class GPUFrameworkExternalAllocator final : public o2::its::ExternalAllocator public: void* allocate(size_t size) override { + std::scoped_lock lck(mLock); return mFWReco->AllocateDirectMemory(size, GPUMemoryResource::MEMORY_GPU); } void deallocate(char* ptr, size_t) override {} @@ -35,6 +36,7 @@ class GPUFrameworkExternalAllocator final : public o2::its::ExternalAllocator private: o2::gpu::GPUReconstruction* mFWReco; + std::mutex mLock; }; } // namespace o2::its