From daf2de39db8b29ccc8e1768041903a25c3752be6 Mon Sep 17 00:00:00 2001 From: Matteo Concas Date: Mon, 9 Sep 2024 14:07:40 +0200 Subject: [PATCH] Separate in a non ambiguous namespace --- Common/DCAFitter/GPU/cuda/DCAFitterN.cu | 20 +++++++++---------- .../GPU/cuda/test/testDCAFitterNGPU.cxx | 8 ++++---- .../DCAFitter/include/DCAFitter/DCAFitterN.h | 20 +++++++++---------- 3 files changed, 24 insertions(+), 24 deletions(-) diff --git a/Common/DCAFitter/GPU/cuda/DCAFitterN.cu b/Common/DCAFitter/GPU/cuda/DCAFitterN.cu index 9f513c499e52c..f543b7bc7cdd4 100644 --- a/Common/DCAFitter/GPU/cuda/DCAFitterN.cu +++ b/Common/DCAFitter/GPU/cuda/DCAFitterN.cu @@ -32,7 +32,7 @@ inline void gpuAssert(cudaError_t code, const char* file, int line, bool abort = } } } -namespace o2::vertexing::gpu +namespace o2::vertexing::device { namespace kernel { @@ -51,9 +51,9 @@ GPUg() void processKernel(o2::vertexing::DCAFitterN<2>* ft, o2::track::TrackParC } } // namespace kernel -void printOnDevice(o2::vertexing::DCAFitterN<2>* ft, - const int nBlocks, - const int nThreads) +void print(o2::vertexing::DCAFitterN<2>* ft, + const int nBlocks, + const int nThreads) { DCAFitterN<2>* ft_device; gpuCheckError(cudaMalloc(reinterpret_cast(&ft_device), sizeof(o2::vertexing::DCAFitterN<2>))); @@ -65,11 +65,11 @@ void printOnDevice(o2::vertexing::DCAFitterN<2>* ft, gpuCheckError(cudaDeviceSynchronize()); } -int processOnDevice(o2::vertexing::DCAFitterN<2>* fitter, - o2::track::TrackParCov& track1, - o2::track::TrackParCov& track2, - const int nBlocks, - const int nThreads) +int process(o2::vertexing::DCAFitterN<2>* fitter, + o2::track::TrackParCov& track1, + o2::track::TrackParCov& track2, + const int nBlocks, + const int nThreads) { DCAFitterN<2>* ft_device; o2::track::TrackParCov* t1_device; @@ -103,4 +103,4 @@ int processOnDevice(o2::vertexing::DCAFitterN<2>* fitter, return result; } -} // namespace o2::vertexing::gpu \ No newline at end of file +} // namespace o2::vertexing::device \ No newline at end of file diff --git a/Common/DCAFitter/GPU/cuda/test/testDCAFitterNGPU.cxx b/Common/DCAFitter/GPU/cuda/test/testDCAFitterNGPU.cxx index 8f1ee3bc30644..829ecb808f5c2 100644 --- a/Common/DCAFitter/GPU/cuda/test/testDCAFitterNGPU.cxx +++ b/Common/DCAFitter/GPU/cuda/test/testDCAFitterNGPU.cxx @@ -187,7 +187,7 @@ BOOST_AUTO_TEST_CASE(DCAFitterNProngs) auto genParent = generate(vtxGen, vctracks, bz, genPHS, k0, k0dec, forceQ); ft.setUseAbsDCA(true); swA.Start(false); - int ncA = gpu::processOnDevice(&ft, vctracks[0], vctracks[1]); // HERE WE FIT THE VERTICES + int ncA = device::process(&ft, vctracks[0], vctracks[1]); // HERE WE FIT THE VERTICES swA.Stop(); LOG(debug) << "fit abs.dist " << iev << " NC: " << ncA << " Chi2: " << (ncA ? ft.getChi2AtPCACandidate(0) : -1); if (ncA) { @@ -199,7 +199,7 @@ BOOST_AUTO_TEST_CASE(DCAFitterNProngs) ft.setUseAbsDCA(true); ft.setWeightedFinalPCA(true); swAW.Start(false); - int ncAW = gpu::processOnDevice(&ft, vctracks[0], vctracks[1]); // HERE WE FIT THE VERTICES + int ncAW = device::process(&ft, vctracks[0], vctracks[1]); // HERE WE FIT THE VERTICES swAW.Stop(); LOG(debug) << "fit abs.dist with final weighted DCA " << iev << " NC: " << ncAW << " Chi2: " << (ncAW ? ft.getChi2AtPCACandidate(0) : -1); if (ncAW) { @@ -211,7 +211,7 @@ BOOST_AUTO_TEST_CASE(DCAFitterNProngs) ft.setUseAbsDCA(false); ft.setWeightedFinalPCA(false); swW.Start(false); - int ncW = gpu::processOnDevice(&ft, vctracks[0], vctracks[1]); // HERE WE FIT THE VERTICES + int ncW = device::process(&ft, vctracks[0], vctracks[1]); // HERE WE FIT THE VERTICES swW.Stop(); LOG(debug) << "fit wgh.dist " << iev << " NC: " << ncW << " Chi2: " << (ncW ? ft.getChi2AtPCACandidate(0) : -1); if (ncW) { @@ -221,7 +221,7 @@ BOOST_AUTO_TEST_CASE(DCAFitterNProngs) } } ft.print(); - gpu::printOnDevice(&ft, 1, 1); + device::print(&ft, 1, 1); meanDA /= nfoundA ? nfoundA : 1; meanDAW /= nfoundA ? nfoundA : 1; meanDW /= nfoundW ? nfoundW : 1; diff --git a/Common/DCAFitter/include/DCAFitter/DCAFitterN.h b/Common/DCAFitter/include/DCAFitter/DCAFitterN.h index ce8f2f774508e..b74fec89d9f37 100644 --- a/Common/DCAFitter/include/DCAFitter/DCAFitterN.h +++ b/Common/DCAFitter/include/DCAFitter/DCAFitterN.h @@ -1129,17 +1129,17 @@ GPUg() void printKernel(o2::vertexing::DCAFitterN<2>* ft); GPUg() void processKernel(o2::vertexing::DCAFitterN<2>* ft, o2::track::TrackParCov* t1, o2::track::TrackParCov* t2, int* res); } // namespace gpu::kernel #endif -namespace gpu +namespace device { -void printOnDevice(o2::vertexing::DCAFitterN<2>*, - const int nBlocks = 1, - const int nThreads = 1); -int processOnDevice(o2::vertexing::DCAFitterN<2>*, - o2::track::TrackParCov&, - o2::track::TrackParCov&, - const int nBlocks = 1, - const int nThreads = 1); -} // namespace gpu +void print(o2::vertexing::DCAFitterN<2>*, + const int nBlocks = 1, + const int nThreads = 1); +int process(o2::vertexing::DCAFitterN<2>*, + o2::track::TrackParCov&, + o2::track::TrackParCov&, + const int nBlocks = 1, + const int nThreads = 1); +} // namespace device } // namespace vertexing } // namespace o2 #endif // _ALICEO2_DCA_FITTERN_