17#if (!defined(GPUCA_STANDALONE) || defined(GPUCA_BUILD_QA)) && !defined(GPUCA_GPUCODE)
24std::weak_ptr<GPUROOTDumpCore> GPUROOTDumpCore::sInstance;
33 for (uint32_t
i = 0;
i < mBranches.size();
i++) {
34 mBranches[
i]->write();
40std::shared_ptr<GPUROOTDumpCore> GPUROOTDumpCore::getAndCreate()
42 static std::atomic_flag lock = ATOMIC_FLAG_INIT;
43 while (lock.test_and_set(std::memory_order_acquire)) {
45 std::shared_ptr<GPUROOTDumpCore>
retVal = sInstance.lock();
47 retVal = std::make_shared<GPUROOTDumpCore>(GPUROOTDumpCorePrivate());
50 lock.clear(std::memory_order_release);
56 std::shared_ptr<GPUROOTDumpCore> p = GPUROOTDumpCore::get().lock();
58 throw std::runtime_error(
"No instance of GPUROOTDumpCore exists");
60 p->mBranches.emplace_back(
this);
62 std::remove(
"gpudebug.root");
63 p->mFile.reset(
new TFile(
"gpudebug.root",
"recreate"));
GPUROOTDumpCore(const GPUROOTDumpCore &)=delete