Skip to content

Commit 78e44f5

Browse files
committed
GPU: make ITS framework allocator thread-safe
Signed-off-by: Felix Schlepper <felix.schlepper@cern.ch>
1 parent a1c484d commit 78e44f5

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

GPU/GPUTracking/Global/GPUChainITS.cxx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
#include "DataFormatsITS/TrackITS.h"
1818
#include "ITStracking/ExternalAllocator.h"
1919
#include "GPUReconstructionIncludesITS.h"
20-
#include <algorithm>
20+
#include <mutex>
2121

2222
using namespace o2::gpu;
2323

@@ -28,13 +28,15 @@ class GPUFrameworkExternalAllocator final : public o2::its::ExternalAllocator
2828
public:
2929
void* allocate(size_t size) override
3030
{
31+
std::scoped_lock lck(mLock);
3132
return mFWReco->AllocateDirectMemory(size, GPUMemoryResource::MEMORY_GPU);
3233
}
3334
void deallocate(char* ptr, size_t) override {}
3435
void setReconstructionFramework(o2::gpu::GPUReconstruction* fwr) { mFWReco = fwr; }
3536

3637
private:
3738
o2::gpu::GPUReconstruction* mFWReco;
39+
std::mutex mLock;
3840
};
3941
} // namespace o2::its
4042

0 commit comments

Comments
 (0)