From 5a3261ad8d99d9ee39b63e0c086c9e401413072a Mon Sep 17 00:00:00 2001 From: Andrea Bocci Date: Mon, 31 Jul 2023 12:34:03 +0200 Subject: [PATCH] Replace the SFINAE check with static_assert Works around a rare bug in nvcc/gcc that causes a function-static variable to be emitted as a local symbol instead of a unique global symbol. --- .../AlpakaInterface/interface/CachingAllocator.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/HeterogeneousCore/AlpakaInterface/interface/CachingAllocator.h b/HeterogeneousCore/AlpakaInterface/interface/CachingAllocator.h index dfda1ee3d7e24..e42c0df623f1d 100644 --- a/HeterogeneousCore/AlpakaInterface/interface/CachingAllocator.h +++ b/HeterogeneousCore/AlpakaInterface/interface/CachingAllocator.h @@ -82,9 +82,7 @@ namespace cms::alpakatools { * - the `Queue` type can be either `Sync` _or_ `Async` on any allocation. */ - template and alpaka::isQueue>> + template class CachingAllocator { public: #ifdef ALPAKA_ACC_GPU_CUDA_ENABLED @@ -106,6 +104,8 @@ namespace cms::alpakatools { using Buffer = alpaka::Buf, size_t>; // The "memory device" type can either be the same as the "synchronisation device" type, or be the host CPU. + static_assert(alpaka::isDevice, "TDev should be an alpaka Device type."); + static_assert(alpaka::isQueue, "TQueue should be an alpaka Queue type."); static_assert(std::is_same_v> or std::is_same_v, "The \"memory device\" type can either be the same as the \"synchronisation device\" type, or be the " "host CPU.");