From 92c4b9c18c0ab0edd986c36720d72e16af5505c0 Mon Sep 17 00:00:00 2001 From: Felix Weiglhofer <weiglhofer@fias.uni-frankfurt.de> Date: Thu, 15 Jun 2023 14:40:31 +0000 Subject: [PATCH] algo: Remove span typedefs from Prelude.h --- algo/base/Prelude.h | 9 --------- algo/detectors/sts/StsHitfinderChain.cxx | 8 ++++---- algo/detectors/sts/StsHitfinderChain.h | 4 ++-- 3 files changed, 6 insertions(+), 15 deletions(-) diff --git a/algo/base/Prelude.h b/algo/base/Prelude.h index e8d6140711..31a5f5a5ea 100644 --- a/algo/base/Prelude.h +++ b/algo/base/Prelude.h @@ -5,7 +5,6 @@ #define CBM_ALGO_BASE_PRELUDE_H #include <cstdint> -#include <gsl/span> namespace cbm::algo { @@ -28,14 +27,6 @@ namespace cbm::algo using real = f32; #endif -#if !XPU_IS_CUDA && !XPU_IS_HIP // FIXME why doesn't this work with CUDA? - template<typename T> - using span = gsl::span<T>; - - template<typename T> - using cspan = gsl::span<const T>; -#endif - } // namespace cbm::algo #endif // CBM_ALGO_BASE_PRELUDE_H diff --git a/algo/detectors/sts/StsHitfinderChain.cxx b/algo/detectors/sts/StsHitfinderChain.cxx index 7cef8dd32d..f38562ed95 100644 --- a/algo/detectors/sts/StsHitfinderChain.cxx +++ b/algo/detectors/sts/StsHitfinderChain.cxx @@ -472,7 +472,7 @@ void sts::HitfinderChain::EnsureDigisSorted() } } -void sts::HitfinderChain::EnsureChannelOffsets(span<u32> channelOffsetsByModule) +void sts::HitfinderChain::EnsureChannelOffsets(gsl::span<u32> channelOffsetsByModule) { xpu::h_view digisPerModule {fHitfinder.digisPerModule}; xpu::h_view digiOffsetPerModule {fHitfinder.digiOffsetPerModule}; @@ -483,8 +483,8 @@ void sts::HitfinderChain::EnsureChannelOffsets(span<u32> channelOffsetsByModule) int offset = digiOffsetPerModule[m]; int nDigis = digiOffsetPerModule[m + 1] - offset; - span<CbmStsDigi> digis(&digisPerModule[offset], nDigis); - span<u32> channelOffsets = channelOffsetsByModule.subspan(m * nChannels, nChannels); + gsl::span<CbmStsDigi> digis(&digisPerModule[offset], nDigis); + gsl::span<u32> channelOffsets = channelOffsetsByModule.subspan(m * nChannels, nChannels); if (nDigis == 0) continue; @@ -517,7 +517,7 @@ void sts::HitfinderChain::EnsureChannelOffsets(span<u32> channelOffsetsByModule) } } -void sts::HitfinderChain::EnsureClustersSane(span<GpuClusterIdx> hClusterIdx, span<int> hNClusters) +void sts::HitfinderChain::EnsureClustersSane(gsl::span<GpuClusterIdx> hClusterIdx, gsl::span<int> hNClusters) { for (size_t m = 0; m < 2 * fPars->modules.size(); m++) { int nClusters = hNClusters[m]; diff --git a/algo/detectors/sts/StsHitfinderChain.h b/algo/detectors/sts/StsHitfinderChain.h index bb38e93f66..7676a05f17 100644 --- a/algo/detectors/sts/StsHitfinderChain.h +++ b/algo/detectors/sts/StsHitfinderChain.h @@ -98,8 +98,8 @@ namespace cbm::algo::sts // Debug functions, ensure reco produces sane results void EnsureDigiOffsets(DigiMap&); void EnsureDigisSorted(); - void EnsureChannelOffsets(span<u32>); - void EnsureClustersSane(span<GpuClusterIdx>, span<int>); + void EnsureChannelOffsets(gsl::span<u32>); + void EnsureClustersSane(gsl::span<GpuClusterIdx>, gsl::span<int>); void EnsureClustersSorted(); std::optional<const sts::HitfinderPars> fPars; -- GitLab