From b9b9d6df615b7eaf1fce78346f384c422a2d5be8 Mon Sep 17 00:00:00 2001 From: "se.gorbunov" <se.gorbunov@gsi.de> Date: Mon, 23 Oct 2023 21:03:57 +0000 Subject: [PATCH] compiler warning fixes in algo framework --- algo/base/util/PODAllocator.h | 2 +- algo/detectors/sts/HitfinderChain.cxx | 10 +++++----- algo/unpack/Unpack.cxx | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/algo/base/util/PODAllocator.h b/algo/base/util/PODAllocator.h index 949be97171..9240927c2d 100644 --- a/algo/base/util/PODAllocator.h +++ b/algo/base/util/PODAllocator.h @@ -28,7 +28,7 @@ namespace cbm::algo void deallocate(T* p_t, size_t) { std::free(p_t); } template<class... Args> - void construct(T* obj, Args&&... args) + void construct([[maybe_unused]] T* obj, Args&&... args) { if constexpr (sizeof...(args) > 0) new (obj) T(std::forward<Args>(args)...); } diff --git a/algo/detectors/sts/HitfinderChain.cxx b/algo/detectors/sts/HitfinderChain.cxx index 4d0fb95b6a..6bdda8b11e 100644 --- a/algo/detectors/sts/HitfinderChain.cxx +++ b/algo/detectors/sts/HitfinderChain.cxx @@ -512,7 +512,7 @@ PartitionedSpan<sts::Hit> sts::HitfinderChain::FlattenHits(xpu::queue queue) xpu::h_view nHits(hfc.nHitsPerModule); size_t nHitsTotal = 0; - for (size_t m = 0; m < hfc.nModules; m++) + for (int m = 0; m < hfc.nModules; m++) nHitsTotal += GetNHits(nHits, m); L_(debug) << "STS Hitfinder Chain: Flattening " << nHitsTotal << " hits"; @@ -539,9 +539,9 @@ PartitionedSpan<sts::Hit> sts::HitfinderChain::FlattenHits(xpu::queue queue) xpu::scoped_timer t_("Flatten Hits"); xpu::t_add_bytes(nHitsTotal * sizeof(sts::Hit)); CBM_PARALLEL_FOR(schedule(dynamic)) - for (size_t m = 0; m < hfc.nModules; m++) { + for (int m = 0; m < hfc.nModules; m++) { size_t offset = 0; - for (size_t i = 0; i < m; i++) { + for (int i = 0; i < m; i++) { offset += GetNHits(nHits, i); } std::copy_n(hfc.hitsPerModule.get() + hfc.hitsAllocatedPerModule * m, GetNHits(nHits, m), hits.begin() + offset); @@ -556,7 +556,7 @@ PartitionedSpan<sts::Hit> sts::HitfinderChain::FlattenHits(xpu::queue queue) // I assume because of page faults as the allocated memory is not touched before // But even with a memset on host memory before, throughput only goes up to 3.7 GBs size_t nHitsCopied = 0; - for (size_t m = 0; m < hfc.nModules; m++) { + for (int m = 0; m < hfc.nModules; m++) { size_t numHitsInModule = GetNHits(nHits, m); queue.copy(hfc.hitsPerModule.get() + hfc.hitsAllocatedPerModule * m, hits.data() + nHitsCopied, numHitsInModule * sizeof(sts::Hit)); @@ -569,7 +569,7 @@ PartitionedSpan<sts::Hit> sts::HitfinderChain::FlattenHits(xpu::queue queue) // doesn't really matter overhead wise fHitOffsets.clear(); fHitOffsets.push_back(0); - for (size_t m = 0; m < hfc.nModules; m++) + for (int m = 0; m < hfc.nModules; m++) fHitOffsets.push_back(fHitOffsets.back() + GetNHits(nHits, m)); fAddresses = {}; diff --git a/algo/unpack/Unpack.cxx b/algo/unpack/Unpack.cxx index bb71ddcd56..c46cb91408 100644 --- a/algo/unpack/Unpack.cxx +++ b/algo/unpack/Unpack.cxx @@ -76,7 +76,7 @@ namespace cbm::algo xpu::t_add_bytes(timeslice->size_component(comp)); // Equipment ID of current component - const uint16_t equipmentId = timeslice->descriptor(comp, 0).eq_id; + // const uint16_t equipmentId = timeslice->descriptor(comp, 0).eq_id; // The current algorithms work for the format versions hard-coded as parameters to MsLoop() below. // Other versions are not yet supported. -- GitLab