From cf8b10c23d0e840a86be3754cb46ed93757205b2 Mon Sep 17 00:00:00 2001 From: David Rohr Date: Wed, 6 May 2020 15:57:43 +0200 Subject: [PATCH] GPU: Implement callback to register shared memory regions for GPU DMA --- Detectors/TPC/workflow/src/CATrackerSpec.cxx | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/Detectors/TPC/workflow/src/CATrackerSpec.cxx b/Detectors/TPC/workflow/src/CATrackerSpec.cxx index cfd6a47179aee..d46fefbdf41e7 100644 --- a/Detectors/TPC/workflow/src/CATrackerSpec.cxx +++ b/Detectors/TPC/workflow/src/CATrackerSpec.cxx @@ -25,6 +25,7 @@ #include "Framework/Logger.h" #include "Framework/CompletionPolicy.h" #include "Framework/DeviceSpec.h" +#include "Framework/CallbackService.h" #include "DataFormatsTPC/TPCSectorHeader.h" #include "DataFormatsTPC/ClusterGroupAttribute.h" #include "DataFormatsTPC/ClusterNative.h" @@ -286,6 +287,16 @@ DataProcessorSpec getCATrackerSpec(ca::Config const& specconfig, std::vectorvalidMcInputs.reset(); } + auto& callbacks = ic.services().get(); + callbacks.set(CallbackService::Id::RegionInfoCallback, [processAttributes](FairMQRegionInfo const& info) { + if (info.size) { + auto& tracker = processAttributes->tracker; + if (tracker->registerMemoryForGPU(info.ptr, info.size)) { + throw std::runtime_error("Error registering memory for GPU"); + } + } + }); + auto processingFct = [processAttributes, processMC, caClusterer, zsDecoder](ProcessingContext& pc) { if (processAttributes->readyToQuit) { return;