diff --git a/docs/source/basic/cheatsheet.rst b/docs/source/basic/cheatsheet.rst index 6f3f46497a6d..6904bf266e75 100644 --- a/docs/source/basic/cheatsheet.rst +++ b/docs/source/basic/cheatsheet.rst @@ -263,7 +263,7 @@ Allocate static shared memory variable Get dynamic shared memory pool, requires the kernel to specialize .. code-block:: c++ - traits::BlockSharedMemDynSizeBytes + trait::BlockSharedMemDynSizeBytes Type * dynamicSharedMemoryPool = getDynSharedMem(acc); Synchronize threads of the same block diff --git a/docs/source/dev/details.rst b/docs/source/dev/details.rst index 8a1096274c4b..ddc8a988daeb 100644 --- a/docs/source/dev/details.rst +++ b/docs/source/dev/details.rst @@ -251,10 +251,10 @@ These functions are dispatched in two ways to support user defined overloads of Let's take `alpaka::math::abs` as an example: When `alpaka::math::abs(acc, value)` is called, a concrete implementation of `abs` is picked via template specialization. -Concretely, something similar to `alpaka::math::traits::Abs{}(acc, value)` is called. -This allows alpaka (and the user) to specialize the template `alpaka::math::traits::Abs` for various backends and various argument types. +Concretely, something similar to `alpaka::math::trait::Abs{}(acc, value)` is called. +This allows alpaka (and the user) to specialize the template `alpaka::math::trait::Abs` for various backends and various argument types. E.g. alpaka contains specializations for `float` and `double`. -If there is no specialization within alpaka (or by the user), the default implementation of `alpaka::math::traits::Abs<....>{}(acc, value)` will just call `abs(value)`. +If there is no specialization within alpaka (or by the user), the default implementation of `alpaka::math::trait::Abs<....>{}(acc, value)` will just call `abs(value)`. This is called an unqualified call and C++ will try to find a function called `abs` in the namespace where the type of `value` is defined. This feature is called Argument Dependent Lookup (ADL). Using ADL for types which are not covered by specializations in alpaka allows a user to bring their own implementation for which `abs` is meaningful, e.g. a custom implementation of complex numbers or a fixed precision type. diff --git a/example/openMPSchedule/src/openMPSchedule.cpp b/example/openMPSchedule/src/openMPSchedule.cpp index ef19f14141aa..a8850e6a99f4 100644 --- a/example/openMPSchedule/src/openMPSchedule.cpp +++ b/example/openMPSchedule/src/openMPSchedule.cpp @@ -70,7 +70,7 @@ struct OpenMPScheduleTraitKernel : public OpenMPScheduleDefaultKernel { }; -namespace alpaka::traits +namespace alpaka::trait { //! Schedule trait specialization for OpenMPScheduleTraitKernel. //! This is the most general way to define a schedule. @@ -90,7 +90,7 @@ namespace alpaka::traits return alpaka::omp::Schedule{alpaka::omp::Schedule::Dynamic, 2}; } }; -} // namespace alpaka::traits +} // namespace alpaka::trait auto main() -> int { diff --git a/include/alpaka/acc/AccCpuFibers.hpp b/include/alpaka/acc/AccCpuFibers.hpp index 9613b6301277..acd76b82f513 100644 --- a/include/alpaka/acc/AccCpuFibers.hpp +++ b/include/alpaka/acc/AccCpuFibers.hpp @@ -124,7 +124,7 @@ namespace alpaka boost::fibers::fiber::id mutable m_masterFiberId; //!< The id of the master fiber. }; - namespace traits + namespace trait { //! The CPU fibers accelerator accelerator type trait specialization. template @@ -218,7 +218,7 @@ namespace alpaka { using type = TIdx; }; - } // namespace traits + } // namespace trait } // namespace alpaka #endif diff --git a/include/alpaka/acc/AccCpuOmp2Blocks.hpp b/include/alpaka/acc/AccCpuOmp2Blocks.hpp index 655dea78bda2..d51f8d5e24f8 100644 --- a/include/alpaka/acc/AccCpuOmp2Blocks.hpp +++ b/include/alpaka/acc/AccCpuOmp2Blocks.hpp @@ -116,7 +116,7 @@ namespace alpaka Vec mutable m_gridBlockIdx; //!< The index of the currently executed block. }; - namespace traits + namespace trait { //! The CPU OpenMP 2.0 block accelerator accelerator type trait specialization. template @@ -201,7 +201,7 @@ namespace alpaka { using type = TIdx; }; - } // namespace traits + } // namespace trait } // namespace alpaka #endif diff --git a/include/alpaka/acc/AccCpuOmp2Threads.hpp b/include/alpaka/acc/AccCpuOmp2Threads.hpp index 7f005cc558aa..3b913bc26587 100644 --- a/include/alpaka/acc/AccCpuOmp2Threads.hpp +++ b/include/alpaka/acc/AccCpuOmp2Threads.hpp @@ -121,7 +121,7 @@ namespace alpaka Vec mutable m_gridBlockIdx; //!< The index of the currently executed block. }; - namespace traits + namespace trait { //! The CPU OpenMP 2.0 thread accelerator accelerator type trait specialization. template @@ -211,7 +211,7 @@ namespace alpaka { using type = TIdx; }; - } // namespace traits + } // namespace trait } // namespace alpaka #endif diff --git a/include/alpaka/acc/AccCpuSerial.hpp b/include/alpaka/acc/AccCpuSerial.hpp index c073fa543195..0942fcaf7e8f 100644 --- a/include/alpaka/acc/AccCpuSerial.hpp +++ b/include/alpaka/acc/AccCpuSerial.hpp @@ -110,7 +110,7 @@ namespace alpaka Vec mutable m_gridBlockIdx; //!< The index of the currently executed block. }; - namespace traits + namespace trait { //! The CPU serial accelerator accelerator type trait specialization. template @@ -195,7 +195,7 @@ namespace alpaka { using type = TIdx; }; - } // namespace traits + } // namespace trait } // namespace alpaka #endif diff --git a/include/alpaka/acc/AccCpuSyclIntel.hpp b/include/alpaka/acc/AccCpuSyclIntel.hpp index 35ca89d8d468..9e19dacd9d45 100644 --- a/include/alpaka/acc/AccCpuSyclIntel.hpp +++ b/include/alpaka/acc/AccCpuSyclIntel.hpp @@ -43,7 +43,7 @@ namespace alpaka::experimental }; } // namespace alpaka::experimental -namespace alpaka::traits +namespace alpaka::trait { //! The Intel CPU SYCL accelerator name trait specialization. template @@ -81,6 +81,6 @@ namespace alpaka::traits { using type = experimental::PltfCpuSyclIntel; }; -} // namespace alpaka::traits +} // namespace alpaka::trait #endif diff --git a/include/alpaka/acc/AccCpuTbbBlocks.hpp b/include/alpaka/acc/AccCpuTbbBlocks.hpp index 9bcec02baff7..b68d91f8aad5 100644 --- a/include/alpaka/acc/AccCpuTbbBlocks.hpp +++ b/include/alpaka/acc/AccCpuTbbBlocks.hpp @@ -107,7 +107,7 @@ namespace alpaka Vec mutable m_gridBlockIdx; //!< The index of the currently executed block. }; - namespace traits + namespace trait { //! The CPU TBB block accelerator type trait specialization. template @@ -192,7 +192,7 @@ namespace alpaka { using type = TIdx; }; - } // namespace traits + } // namespace trait } // namespace alpaka #endif diff --git a/include/alpaka/acc/AccCpuThreads.hpp b/include/alpaka/acc/AccCpuThreads.hpp index 5ae3d97d85d0..3769ea9f4cb6 100644 --- a/include/alpaka/acc/AccCpuThreads.hpp +++ b/include/alpaka/acc/AccCpuThreads.hpp @@ -122,7 +122,7 @@ namespace alpaka std::thread::id mutable m_idMasterThread; //!< The id of the master thread. }; - namespace traits + namespace trait { //! The CPU threads accelerator accelerator type trait specialization. template @@ -217,7 +217,7 @@ namespace alpaka { using type = TIdx; }; - } // namespace traits + } // namespace trait } // namespace alpaka #endif diff --git a/include/alpaka/acc/AccFpgaSyclIntel.hpp b/include/alpaka/acc/AccFpgaSyclIntel.hpp index ccfdb3217304..b1a7fd807ed9 100644 --- a/include/alpaka/acc/AccFpgaSyclIntel.hpp +++ b/include/alpaka/acc/AccFpgaSyclIntel.hpp @@ -42,7 +42,7 @@ namespace alpaka::experimental }; } // namespace alpaka::experimental -namespace alpaka::traits +namespace alpaka::trait { //! The Intel FPGA SYCL accelerator name trait specialization. template @@ -80,6 +80,6 @@ namespace alpaka::traits { using type = experimental::PltfFpgaSyclIntel; }; -} // namespace alpaka::traits +} // namespace alpaka::trait #endif diff --git a/include/alpaka/acc/AccFpgaSyclXilinx.hpp b/include/alpaka/acc/AccFpgaSyclXilinx.hpp index 9b29f3c6f334..66753e46d443 100644 --- a/include/alpaka/acc/AccFpgaSyclXilinx.hpp +++ b/include/alpaka/acc/AccFpgaSyclXilinx.hpp @@ -42,7 +42,7 @@ namespace alpaka::experimental }; } // namespace alpaka::experimental -namespace alpaka::traits +namespace alpaka::trait { //! The Xilinx FPGA SYCL accelerator name trait specialization. template @@ -80,6 +80,6 @@ namespace alpaka::traits { using type = experimental::PltfFpgaSyclXilinx; }; -} // namespace alpaka::traits +} // namespace alpaka::trait #endif diff --git a/include/alpaka/acc/AccGenericSycl.hpp b/include/alpaka/acc/AccGenericSycl.hpp index 6f837bb4abad..014dbfd2eabb 100644 --- a/include/alpaka/acc/AccGenericSycl.hpp +++ b/include/alpaka/acc/AccGenericSycl.hpp @@ -115,7 +115,7 @@ namespace alpaka::experimental }; } // namespace alpaka::experimental -namespace alpaka::traits +namespace alpaka::trait { //! The SYCL accelerator type trait specialization. template typename TAcc, typename TDim, typename TIdx> @@ -179,6 +179,6 @@ namespace alpaka::traits { using type = TIdx; }; -} // namespace alpaka::traits +} // namespace alpaka::trait #endif diff --git a/include/alpaka/acc/AccGpuCudaRt.hpp b/include/alpaka/acc/AccGpuCudaRt.hpp index 2429b5764748..24cb36b5f8e1 100644 --- a/include/alpaka/acc/AccGpuCudaRt.hpp +++ b/include/alpaka/acc/AccGpuCudaRt.hpp @@ -49,7 +49,7 @@ namespace alpaka } }; - namespace traits + namespace trait { //! The GPU CUDA accelerator accelerator type trait specialization. template @@ -83,7 +83,7 @@ namespace alpaka std::forward(args)...); } }; - } // namespace traits + } // namespace trait } // namespace alpaka #endif diff --git a/include/alpaka/acc/AccGpuHipRt.hpp b/include/alpaka/acc/AccGpuHipRt.hpp index 3cd68c544927..ddd7be880756 100644 --- a/include/alpaka/acc/AccGpuHipRt.hpp +++ b/include/alpaka/acc/AccGpuHipRt.hpp @@ -49,7 +49,7 @@ namespace alpaka } }; - namespace traits + namespace trait { //! The GPU HIP accelerator accelerator type trait specialization. template @@ -83,7 +83,7 @@ namespace alpaka std::forward(args)...); } }; - } // namespace traits + } // namespace trait } // namespace alpaka #endif diff --git a/include/alpaka/acc/AccGpuSyclIntel.hpp b/include/alpaka/acc/AccGpuSyclIntel.hpp index d8404859066e..11f1ee266c68 100644 --- a/include/alpaka/acc/AccGpuSyclIntel.hpp +++ b/include/alpaka/acc/AccGpuSyclIntel.hpp @@ -42,7 +42,7 @@ namespace alpaka::experimental }; } // namespace alpaka::experimental -namespace alpaka::traits +namespace alpaka::trait { //! The Intel GPU SYCL accelerator name trait specialization. template @@ -80,6 +80,6 @@ namespace alpaka::traits { using type = experimental::PltfGpuSyclIntel; }; -} // namespace alpaka::traits +} // namespace alpaka::trait #endif diff --git a/include/alpaka/acc/AccGpuUniformCudaHipRt.hpp b/include/alpaka/acc/AccGpuUniformCudaHipRt.hpp index 3342ed99f399..a9eb520622fe 100644 --- a/include/alpaka/acc/AccGpuUniformCudaHipRt.hpp +++ b/include/alpaka/acc/AccGpuUniformCudaHipRt.hpp @@ -98,7 +98,7 @@ namespace alpaka } }; - namespace traits + namespace trait { //! The GPU CUDA accelerator accelerator type trait specialization. template @@ -222,7 +222,7 @@ namespace alpaka { using type = TDim; }; - } // namespace traits + } // namespace trait namespace detail { //! specialization of the TKernelFnObj return type evaluation @@ -239,7 +239,7 @@ namespace alpaka } }; } // namespace detail - namespace traits + namespace trait { //! The GPU CUDA accelerator execution task type trait specialization. template @@ -272,7 +272,7 @@ namespace alpaka { using type = TIdx; }; - } // namespace traits + } // namespace trait } // namespace alpaka #endif diff --git a/include/alpaka/acc/AccOacc.hpp b/include/alpaka/acc/AccOacc.hpp index 7dbc5a0ca46b..78a76eb9e2ff 100644 --- a/include/alpaka/acc/AccOacc.hpp +++ b/include/alpaka/acc/AccOacc.hpp @@ -99,7 +99,7 @@ namespace alpaka CtxBlockOacc& m_blockShared; }; - namespace traits + namespace trait { //! The OpenACC accelerator accelerator type trait specialization. template @@ -344,7 +344,7 @@ namespace alpaka workDiv.m_blockShared); } }; - } // namespace traits + } // namespace trait } // namespace alpaka #endif diff --git a/include/alpaka/acc/AccOmp5.hpp b/include/alpaka/acc/AccOmp5.hpp index 53dc18739a05..fa1fb93f46e1 100644 --- a/include/alpaka/acc/AccOmp5.hpp +++ b/include/alpaka/acc/AccOmp5.hpp @@ -169,7 +169,7 @@ namespace alpaka } }; - namespace traits + namespace trait { //! The OpenMP 5.0 accelerator accelerator type trait specialization. template @@ -280,7 +280,7 @@ namespace alpaka { using type = TIdx; }; - } // namespace traits + } // namespace trait } // namespace alpaka #endif diff --git a/include/alpaka/acc/Traits.hpp b/include/alpaka/acc/Traits.hpp index c9eba9144381..85dd286c7c64 100644 --- a/include/alpaka/acc/Traits.hpp +++ b/include/alpaka/acc/Traits.hpp @@ -1,4 +1,4 @@ -/* Copyright 2020 Benjamin Worpitz, Bernhard Manfred Gruber +/* Copyright 2022 Benjamin Worpitz, Bernhard Manfred Gruber * * This file is part of alpaka. * @@ -33,7 +33,7 @@ namespace alpaka { }; //! The accelerator traits. - namespace traits + namespace trait { //! The accelerator type trait. template @@ -59,25 +59,25 @@ namespace alpaka template struct GetAccDevProps::value>> { - ALPAKA_FN_HOST static auto getAccDevProps(typename alpaka::traits::DevType::type const& dev) - -> AccDevProps::type, typename traits::IdxType::type> + ALPAKA_FN_HOST static auto getAccDevProps(typename alpaka::trait::DevType::type const& dev) + -> AccDevProps::type, typename trait::IdxType::type> { using ImplementationBase = typename concepts::ImplementationBase; return GetAccDevProps::getAccDevProps(dev); } }; - } // namespace traits + } // namespace trait //! The accelerator type trait alias template to remove the ::type. template - using Acc = typename traits::AccType::type; + using Acc = typename trait::AccType::type; //! \return The acceleration properties on the given device. template ALPAKA_FN_HOST auto getAccDevProps(TDev const& dev) -> AccDevProps, Idx> { using ImplementationBase = concepts::ImplementationBase; - return traits::GetAccDevProps::getAccDevProps(dev); + return trait::GetAccDevProps::getAccDevProps(dev); } //! \return The accelerator name @@ -86,7 +86,7 @@ namespace alpaka template ALPAKA_FN_HOST auto getAccName() -> std::string { - return traits::GetAccName::getAccName(); + return trait::GetAccName::getAccName(); } namespace detail @@ -105,7 +105,7 @@ namespace alpaka }; } // namespace detail - namespace traits + namespace trait { //! The GPU HIP accelerator device type trait specialization. template @@ -142,7 +142,7 @@ namespace alpaka template struct QueueType::value>> { - using type = typename QueueType::type, TProperty>::type; + using type = typename QueueType::type, TProperty>::type; }; - } // namespace traits + } // namespace trait } // namespace alpaka diff --git a/include/alpaka/atomic/AtomicAtomicRef.hpp b/include/alpaka/atomic/AtomicAtomicRef.hpp index 5687c3790654..5fac610324b3 100644 --- a/include/alpaka/atomic/AtomicAtomicRef.hpp +++ b/include/alpaka/atomic/AtomicAtomicRef.hpp @@ -1,4 +1,4 @@ -/* Copyright 2021 Felice Pantaleo, Andrea Bocci +/* Copyright 2022 Felice Pantaleo, Andrea Bocci * * This file is part of alpaka. * @@ -37,7 +37,7 @@ namespace alpaka "ALPAKA_DISABLE_ATOMIC_ATOMICREF."); } - namespace traits + namespace trait { //! The CPU accelerators AtomicAdd. template @@ -214,5 +214,5 @@ namespace alpaka return old; } }; - } // namespace traits + } // namespace trait } // namespace alpaka diff --git a/include/alpaka/atomic/AtomicGenericSycl.hpp b/include/alpaka/atomic/AtomicGenericSycl.hpp index 6595f23d2bea..eb621b9d0abf 100644 --- a/include/alpaka/atomic/AtomicGenericSycl.hpp +++ b/include/alpaka/atomic/AtomicGenericSycl.hpp @@ -101,7 +101,7 @@ namespace alpaka::experimental } // namespace detail } // namespace alpaka::experimental -namespace alpaka::traits +namespace alpaka::trait { // Add. //! The SYCL accelerator atomic operation. @@ -318,6 +318,6 @@ namespace alpaka::traits } } }; -} // namespace alpaka::traits +} // namespace alpaka::trait #endif diff --git a/include/alpaka/atomic/AtomicNoOp.hpp b/include/alpaka/atomic/AtomicNoOp.hpp index af39811e8174..444cc839b9d5 100644 --- a/include/alpaka/atomic/AtomicNoOp.hpp +++ b/include/alpaka/atomic/AtomicNoOp.hpp @@ -18,7 +18,7 @@ namespace alpaka { }; - namespace traits + namespace trait { //! The CPU fibers accelerator atomic operation. template @@ -38,5 +38,5 @@ namespace alpaka return TOp()(addr, compare, value); } }; - } // namespace traits + } // namespace trait } // namespace alpaka diff --git a/include/alpaka/atomic/AtomicOaccBuiltIn.hpp b/include/alpaka/atomic/AtomicOaccBuiltIn.hpp index 606686d5c8da..b0b8b88b8193 100644 --- a/include/alpaka/atomic/AtomicOaccBuiltIn.hpp +++ b/include/alpaka/atomic/AtomicOaccBuiltIn.hpp @@ -1,4 +1,4 @@ -/* Copyright 2021 Jeffrey Kelling, Bernhard Manfred Gruber +/* Copyright 2022 Jeffrey Kelling, Bernhard Manfred Gruber * * This file is part of Alpaka. * @@ -28,7 +28,7 @@ namespace alpaka { }; - namespace traits + namespace trait { // "omp atomic update capture" is not supported before OpenACC 2.5 and by PGI // "omp atomic capture {}" works for PGI and GCC, using this even though non-standart @@ -146,7 +146,7 @@ namespace alpaka } }; - } // namespace traits + } // namespace trait } // namespace alpaka #endif diff --git a/include/alpaka/atomic/AtomicOaccExtended.hpp b/include/alpaka/atomic/AtomicOaccExtended.hpp index 046f2c0396e2..ff9894b37e98 100644 --- a/include/alpaka/atomic/AtomicOaccExtended.hpp +++ b/include/alpaka/atomic/AtomicOaccExtended.hpp @@ -1,4 +1,4 @@ -/* Copyright 2021 Jeffrey Kelling, Bernhard Manfred Gruber +/* Copyright 2022 Jeffrey Kelling, Bernhard Manfred Gruber * * This file is part of Alpaka. * @@ -37,7 +37,7 @@ namespace alpaka mutable std::uint32_t mutex[2] = {0u, 0u}; }; - namespace traits + namespace trait { namespace detail { @@ -213,7 +213,7 @@ namespace alpaka } }; - } // namespace traits + } // namespace trait } // namespace alpaka #endif diff --git a/include/alpaka/atomic/AtomicOmpBuiltIn.hpp b/include/alpaka/atomic/AtomicOmpBuiltIn.hpp index 4df8c414707f..20a18e72ebd3 100644 --- a/include/alpaka/atomic/AtomicOmpBuiltIn.hpp +++ b/include/alpaka/atomic/AtomicOmpBuiltIn.hpp @@ -1,4 +1,4 @@ -/* Copyright 2021 René Widera, Bernhard Manfred Gruber +/* Copyright 2022 René Widera, Bernhard Manfred Gruber * * This file is part of alpaka. * @@ -25,7 +25,7 @@ namespace alpaka { }; - namespace traits + namespace trait { // check for OpenMP 3.1+ // "omp atomic capture" is not supported before OpenMP 3.1 @@ -325,7 +325,7 @@ namespace alpaka # endif // _OPENMP >= 202011 - } // namespace traits + } // namespace trait } // namespace alpaka #endif diff --git a/include/alpaka/atomic/AtomicStdLibLock.hpp b/include/alpaka/atomic/AtomicStdLibLock.hpp index ab95884af646..91b6db749c3e 100644 --- a/include/alpaka/atomic/AtomicStdLibLock.hpp +++ b/include/alpaka/atomic/AtomicStdLibLock.hpp @@ -1,4 +1,4 @@ -/* Copyright 2021 Benjamin Worpitz, Matthias Werner, René Widera, Bernhard Manfred Gruber +/* Copyright 2022 Benjamin Worpitz, Matthias Werner, René Widera, Bernhard Manfred Gruber * * This file is part of alpaka. * @@ -29,7 +29,7 @@ namespace alpaka { public: template - friend struct traits::AtomicOp; + friend struct trait::AtomicOp; static constexpr auto nextPowerOf2(size_t const value, size_t const bit = 0u) -> size_t { @@ -75,7 +75,7 @@ namespace alpaka } }; - namespace traits + namespace trait { //! The CPU threads accelerator atomic operation. template @@ -99,5 +99,5 @@ namespace alpaka return TOp()(addr, compare, value); } }; - } // namespace traits + } // namespace trait } // namespace alpaka diff --git a/include/alpaka/atomic/AtomicUniformCudaHipBuiltIn.hpp b/include/alpaka/atomic/AtomicUniformCudaHipBuiltIn.hpp index 1765c57b399f..8f1407c8f51f 100644 --- a/include/alpaka/atomic/AtomicUniformCudaHipBuiltIn.hpp +++ b/include/alpaka/atomic/AtomicUniformCudaHipBuiltIn.hpp @@ -38,7 +38,7 @@ namespace alpaka # error If ALPAKA_ACC_GPU_HIP_ENABLED is set, the compiler has to support HIP! # endif - namespace traits + namespace trait { //! The specializations to execute the requested atomic ops of the CUDA/HIP accelerator. // See: http://docs.nvidia.com/cuda/cuda-c-programming-guide/#atomic-functions how to implement everything with @@ -800,7 +800,7 @@ namespace alpaka return T(); } }; - } // namespace traits + } // namespace trait # endif diff --git a/include/alpaka/atomic/Traits.hpp b/include/alpaka/atomic/Traits.hpp index 304db08b2d69..9cd559c8b516 100644 --- a/include/alpaka/atomic/Traits.hpp +++ b/include/alpaka/atomic/Traits.hpp @@ -1,4 +1,4 @@ -/* Copyright 2020 Benjamin Worpitz, René Widera, Bernhard Manfred Gruber +/* Copyright 2022 Benjamin Worpitz, René Widera, Bernhard Manfred Gruber * * This file is part of alpaka. * @@ -55,13 +55,13 @@ namespace alpaka template using AtomicHierarchyConcept = typename detail::AtomicHierarchyConceptType::type; - //! The atomic operation traits. - namespace traits + //! The atomic operation trait. + namespace trait { //! The atomic operation trait. template struct AtomicOp; - } // namespace traits + } // namespace trait //! Executes the given operation atomically. //! @@ -80,7 +80,7 @@ namespace alpaka THierarchy const& = THierarchy()) -> T { using ImplementationBase = typename concepts::ImplementationBase, TAtomic>; - return traits::AtomicOp::atomicOp(atomic, addr, value); + return trait::AtomicOp::atomicOp(atomic, addr, value); } //! Executes the given operation atomically. @@ -102,7 +102,7 @@ namespace alpaka THierarchy const& = THierarchy()) -> T { using ImplementationBase = typename concepts::ImplementationBase, TAtomic>; - return traits::AtomicOp::atomicOp(atomic, addr, compare, value); + return trait::AtomicOp::atomicOp(atomic, addr, compare, value); } //! Executes an atomic add operation. diff --git a/include/alpaka/block/shared/dyn/BlockSharedMemDynGenericSycl.hpp b/include/alpaka/block/shared/dyn/BlockSharedMemDynGenericSycl.hpp index 4b20be530442..b26d4a4a62ad 100644 --- a/include/alpaka/block/shared/dyn/BlockSharedMemDynGenericSycl.hpp +++ b/include/alpaka/block/shared/dyn/BlockSharedMemDynGenericSycl.hpp @@ -37,7 +37,7 @@ namespace alpaka::experimental }; } // namespace alpaka::experimental -namespace alpaka::traits +namespace alpaka::trait { template struct GetDynSharedMem @@ -49,6 +49,6 @@ namespace alpaka::traits return t_ptr.get(); } }; -} // namespace alpaka::traits +} // namespace alpaka::trait #endif diff --git a/include/alpaka/block/shared/dyn/BlockSharedMemDynMember.hpp b/include/alpaka/block/shared/dyn/BlockSharedMemDynMember.hpp index d5b70ff5058d..9200fa8826d4 100644 --- a/include/alpaka/block/shared/dyn/BlockSharedMemDynMember.hpp +++ b/include/alpaka/block/shared/dyn/BlockSharedMemDynMember.hpp @@ -92,7 +92,7 @@ namespace alpaka # pragma warning(pop) #endif - namespace traits + namespace trait { template struct GetDynSharedMem> @@ -114,5 +114,5 @@ namespace alpaka # pragma GCC diagnostic pop #endif }; - } // namespace traits + } // namespace trait } // namespace alpaka diff --git a/include/alpaka/block/shared/dyn/BlockSharedMemDynOmp5BuiltIn.hpp b/include/alpaka/block/shared/dyn/BlockSharedMemDynOmp5BuiltIn.hpp index 24ca0dd998d3..3a9f0d903217 100644 --- a/include/alpaka/block/shared/dyn/BlockSharedMemDynOmp5BuiltIn.hpp +++ b/include/alpaka/block/shared/dyn/BlockSharedMemDynOmp5BuiltIn.hpp @@ -98,7 +98,7 @@ namespace alpaka # pragma warning(pop) # endif - namespace traits + namespace trait { template struct GetDynSharedMem @@ -112,7 +112,7 @@ namespace alpaka return reinterpret_cast(dyn.mem()); } }; - } // namespace traits + } // namespace trait } // namespace alpaka #endif diff --git a/include/alpaka/block/shared/dyn/BlockSharedMemDynUniformCudaHipBuiltIn.hpp b/include/alpaka/block/shared/dyn/BlockSharedMemDynUniformCudaHipBuiltIn.hpp index 52bcfc49251a..194491217100 100644 --- a/include/alpaka/block/shared/dyn/BlockSharedMemDynUniformCudaHipBuiltIn.hpp +++ b/include/alpaka/block/shared/dyn/BlockSharedMemDynUniformCudaHipBuiltIn.hpp @@ -35,7 +35,7 @@ namespace alpaka # error If ALPAKA_ACC_GPU_HIP_ENABLED is set, the compiler has to support HIP! # endif - namespace traits + namespace trait { template struct GetDynSharedMem @@ -50,7 +50,7 @@ namespace alpaka return reinterpret_cast(shMem); } }; - } // namespace traits + } // namespace trait # endif diff --git a/include/alpaka/block/shared/dyn/Traits.hpp b/include/alpaka/block/shared/dyn/Traits.hpp index 6381807e501f..2f7bc8f3466c 100644 --- a/include/alpaka/block/shared/dyn/Traits.hpp +++ b/include/alpaka/block/shared/dyn/Traits.hpp @@ -1,4 +1,4 @@ -/* Copyright 2020 Benjamin Worpitz, Bernhard Manfred Gruber +/* Copyright 2022 Benjamin Worpitz, Bernhard Manfred Gruber * * This file is part of alpaka. * @@ -21,12 +21,12 @@ namespace alpaka }; //! The block shared dynamic memory operation traits. - namespace traits + namespace trait { //! The block shared dynamic memory get trait. template struct GetDynSharedMem; - } // namespace traits + } // namespace trait //! Get block shared dynamic memory. //! @@ -44,6 +44,6 @@ namespace alpaka ALPAKA_FN_ACC auto getDynSharedMem(TBlockSharedMemDyn const& blockSharedMemDyn) -> T* { using ImplementationBase = concepts::ImplementationBase; - return traits::GetDynSharedMem::getMem(blockSharedMemDyn); + return trait::GetDynSharedMem::getMem(blockSharedMemDyn); } } // namespace alpaka diff --git a/include/alpaka/block/shared/st/BlockSharedMemStGenericSycl.hpp b/include/alpaka/block/shared/st/BlockSharedMemStGenericSycl.hpp index 27c784dd529c..cc32c5f6010f 100644 --- a/include/alpaka/block/shared/st/BlockSharedMemStGenericSycl.hpp +++ b/include/alpaka/block/shared/st/BlockSharedMemStGenericSycl.hpp @@ -41,7 +41,7 @@ namespace alpaka::experimental }; } // namespace alpaka::experimental -namespace alpaka::traits +namespace alpaka::trait { template struct DeclareSharedVar @@ -68,6 +68,6 @@ namespace alpaka::traits // shared memory block data will be reused } }; -} // namespace alpaka::traits +} // namespace alpaka::trait #endif diff --git a/include/alpaka/block/shared/st/BlockSharedMemStMember.hpp b/include/alpaka/block/shared/st/BlockSharedMemStMember.hpp index de91c95f72d3..4046e4c44ec4 100644 --- a/include/alpaka/block/shared/st/BlockSharedMemStMember.hpp +++ b/include/alpaka/block/shared/st/BlockSharedMemStMember.hpp @@ -1,4 +1,4 @@ -/* Copyright 2020 Jeffrey Kelling, Rene Widera, Bernhard Manfred Gruber +/* Copyright 2022 Jeffrey Kelling, Rene Widera, Bernhard Manfred Gruber * * This file is part of alpaka. * @@ -33,7 +33,7 @@ namespace alpaka using detail::BlockSharedMemStMemberImpl::BlockSharedMemStMemberImpl; }; - namespace traits + namespace trait { template struct DeclareSharedVar> @@ -59,5 +59,5 @@ namespace alpaka // shared memory block data will be reused } }; - } // namespace traits + } // namespace trait } // namespace alpaka diff --git a/include/alpaka/block/shared/st/BlockSharedMemStMemberMasterSync.hpp b/include/alpaka/block/shared/st/BlockSharedMemStMemberMasterSync.hpp index e4cd14f92d8c..a0bcedc228f6 100644 --- a/include/alpaka/block/shared/st/BlockSharedMemStMemberMasterSync.hpp +++ b/include/alpaka/block/shared/st/BlockSharedMemStMemberMasterSync.hpp @@ -1,4 +1,4 @@ -/* Copyright 2019 Benjamin Worpitz, Erik Zenker, Matthias Werner, René Widera +/* Copyright 2022 Benjamin Worpitz, Erik Zenker, Matthias Werner, René Widera * * This file is part of alpaka. * @@ -44,7 +44,7 @@ namespace alpaka std::function m_isMasterThreadFn; }; - namespace traits + namespace trait { #if BOOST_COMP_GNUC # pragma GCC diagnostic push @@ -88,5 +88,5 @@ namespace alpaka // shared memory block data will be reused } }; - } // namespace traits + } // namespace trait } // namespace alpaka diff --git a/include/alpaka/block/shared/st/BlockSharedMemStOmp5.hpp b/include/alpaka/block/shared/st/BlockSharedMemStOmp5.hpp index 55d0bfb354ba..76293a21cf0e 100644 --- a/include/alpaka/block/shared/st/BlockSharedMemStOmp5.hpp +++ b/include/alpaka/block/shared/st/BlockSharedMemStOmp5.hpp @@ -1,4 +1,4 @@ -/* Copyright 2020 Benjamin Worpitz, Erik Zenker, René Widera, Bernhard Manfred Gruber +/* Copyright 2022 Benjamin Worpitz, Erik Zenker, René Widera, Bernhard Manfred Gruber * * This file is part of Alpaka. * @@ -34,7 +34,7 @@ namespace alpaka using BlockSharedMemStMemberImpl<4>::BlockSharedMemStMemberImpl; }; - namespace traits + namespace trait { template struct DeclareSharedVar @@ -66,7 +66,7 @@ namespace alpaka // shared memory block data will be reused } }; - } // namespace traits + } // namespace trait } // namespace alpaka #endif diff --git a/include/alpaka/block/shared/st/BlockSharedMemStOmp5BuiltIn.hpp b/include/alpaka/block/shared/st/BlockSharedMemStOmp5BuiltIn.hpp index 22fa3ef864c7..077c7952d372 100644 --- a/include/alpaka/block/shared/st/BlockSharedMemStOmp5BuiltIn.hpp +++ b/include/alpaka/block/shared/st/BlockSharedMemStOmp5BuiltIn.hpp @@ -23,7 +23,7 @@ namespace alpaka { }; - namespace traits + namespace trait { template struct DeclareSharedVar @@ -43,7 +43,7 @@ namespace alpaka // Nothing to do. OpenMP runtime frees block shared memory at the end of the parallel region. } }; - } // namespace traits + } // namespace trait } // namespace alpaka #endif diff --git a/include/alpaka/block/shared/st/BlockSharedMemStUniformCudaHipBuiltIn.hpp b/include/alpaka/block/shared/st/BlockSharedMemStUniformCudaHipBuiltIn.hpp index 8e5f0284b1a2..1fc077d6fa52 100644 --- a/include/alpaka/block/shared/st/BlockSharedMemStUniformCudaHipBuiltIn.hpp +++ b/include/alpaka/block/shared/st/BlockSharedMemStUniformCudaHipBuiltIn.hpp @@ -36,7 +36,7 @@ namespace alpaka # error If ALPAKA_ACC_GPU_HIP_ENABLED is set, the compiler has to support HIP! # endif - namespace traits + namespace trait { template struct DeclareSharedVar @@ -55,7 +55,7 @@ namespace alpaka // Nothing to do. CUDA/HIP block shared memory is automatically freed when all threads left the block. } }; - } // namespace traits + } // namespace trait # endif diff --git a/include/alpaka/block/shared/st/Traits.hpp b/include/alpaka/block/shared/st/Traits.hpp index 7ebf83266a56..881badf5c318 100644 --- a/include/alpaka/block/shared/st/Traits.hpp +++ b/include/alpaka/block/shared/st/Traits.hpp @@ -1,4 +1,4 @@ -/* Copyright 2020 Benjamin Worpitz, Erik Zenker, Matthias Werner, René Widera, Bernhard Manfred Gruber +/* Copyright 2022 Benjamin Worpitz, Erik Zenker, Matthias Werner, René Widera, Bernhard Manfred Gruber * * This file is part of alpaka. * @@ -20,8 +20,8 @@ namespace alpaka { }; - //! The block shared static memory operation traits. - namespace traits + //! The block shared static memory operation trait. + namespace trait { //! The block shared static memory variable allocation operation trait. template @@ -29,7 +29,7 @@ namespace alpaka //! The block shared static memory free operation trait. template struct FreeSharedVars; - } // namespace traits + } // namespace trait //! Declare a block shared variable. //! @@ -47,7 +47,7 @@ namespace alpaka ALPAKA_FN_ACC auto declareSharedVar(TBlockSharedMemSt const& blockSharedMemSt) -> T& { using ImplementationBase = concepts::ImplementationBase; - return traits::DeclareSharedVar::declareVar(blockSharedMemSt); + return trait::DeclareSharedVar::declareVar(blockSharedMemSt); } //! Frees all memory used by block shared variables. @@ -59,6 +59,6 @@ namespace alpaka ALPAKA_FN_ACC auto freeSharedVars(TBlockSharedMemSt& blockSharedMemSt) -> void { using ImplementationBase = concepts::ImplementationBase; - traits::FreeSharedVars::freeVars(blockSharedMemSt); + trait::FreeSharedVars::freeVars(blockSharedMemSt); } } // namespace alpaka diff --git a/include/alpaka/block/sync/BlockSyncBarrierFiber.hpp b/include/alpaka/block/sync/BlockSyncBarrierFiber.hpp index a86c6c26de37..dfaad3727ad0 100644 --- a/include/alpaka/block/sync/BlockSyncBarrierFiber.hpp +++ b/include/alpaka/block/sync/BlockSyncBarrierFiber.hpp @@ -1,4 +1,4 @@ -/* Copyright 2021 Benjamin Worpitz, Bernhard Manfred Gruber +/* Copyright 2022 Benjamin Worpitz, Bernhard Manfred Gruber * * This file is part of alpaka. * @@ -41,7 +41,7 @@ namespace alpaka int mutable m_result[2u]; }; - namespace traits + namespace trait { template struct SyncBlockThreads> @@ -86,7 +86,7 @@ namespace alpaka return blockSync.m_result[generationMod2]; } }; - } // namespace traits + } // namespace trait } // namespace alpaka #endif diff --git a/include/alpaka/block/sync/BlockSyncBarrierOmp.hpp b/include/alpaka/block/sync/BlockSyncBarrierOmp.hpp index 7f4b04ca54fb..2a4afe4a43c4 100644 --- a/include/alpaka/block/sync/BlockSyncBarrierOmp.hpp +++ b/include/alpaka/block/sync/BlockSyncBarrierOmp.hpp @@ -24,7 +24,7 @@ namespace alpaka int mutable m_result[2]; }; - namespace traits + namespace trait { template<> struct SyncBlockThreads @@ -102,7 +102,7 @@ namespace alpaka return blockSync.m_result[generationMod2]; } }; - } // namespace traits + } // namespace trait } // namespace alpaka #endif diff --git a/include/alpaka/block/sync/BlockSyncBarrierThread.hpp b/include/alpaka/block/sync/BlockSyncBarrierThread.hpp index e4e51d39d331..d083bb44efc3 100644 --- a/include/alpaka/block/sync/BlockSyncBarrierThread.hpp +++ b/include/alpaka/block/sync/BlockSyncBarrierThread.hpp @@ -1,4 +1,4 @@ -/* Copyright 2021 Benjamin Worpitz, Bernhard Manfred Gruber +/* Copyright 2022 Benjamin Worpitz, Bernhard Manfred Gruber * * This file is part of alpaka. * @@ -39,7 +39,7 @@ namespace alpaka BarrierWithPredicate mutable m_barrierWithPredicate; }; - namespace traits + namespace trait { template struct SyncBlockThreads> @@ -61,7 +61,7 @@ namespace alpaka return blockSync.m_barrierWithPredicate.template wait(predicate); } }; - } // namespace traits + } // namespace trait } // namespace alpaka #endif diff --git a/include/alpaka/block/sync/BlockSyncGenericSycl.hpp b/include/alpaka/block/sync/BlockSyncGenericSycl.hpp index 710895efa379..b965d94fcbe1 100644 --- a/include/alpaka/block/sync/BlockSyncGenericSycl.hpp +++ b/include/alpaka/block/sync/BlockSyncGenericSycl.hpp @@ -32,7 +32,7 @@ namespace alpaka::experimental }; } // namespace alpaka::experimental -namespace alpaka::traits +namespace alpaka::trait { template struct SyncBlockThreads> @@ -82,6 +82,6 @@ namespace alpaka::traits return static_cast(sycl::any_of_group(group, static_cast(predicate))); } }; -} // namespace alpaka::traits +} // namespace alpaka::trait #endif diff --git a/include/alpaka/block/sync/BlockSyncNoOp.hpp b/include/alpaka/block/sync/BlockSyncNoOp.hpp index 64741a99c322..d357aee19b50 100644 --- a/include/alpaka/block/sync/BlockSyncNoOp.hpp +++ b/include/alpaka/block/sync/BlockSyncNoOp.hpp @@ -19,7 +19,7 @@ namespace alpaka { }; - namespace traits + namespace trait { template<> struct SyncBlockThreads @@ -41,5 +41,5 @@ namespace alpaka return predicate; } }; - } // namespace traits + } // namespace trait } // namespace alpaka diff --git a/include/alpaka/block/sync/BlockSyncUniformCudaHipBuiltIn.hpp b/include/alpaka/block/sync/BlockSyncUniformCudaHipBuiltIn.hpp index 9d83d72d69d9..a1c1cc49dbdc 100644 --- a/include/alpaka/block/sync/BlockSyncUniformCudaHipBuiltIn.hpp +++ b/include/alpaka/block/sync/BlockSyncUniformCudaHipBuiltIn.hpp @@ -33,7 +33,7 @@ namespace alpaka # error If ALPAKA_ACC_GPU_HIP_ENABLED is set, the compiler has to support HIP! # endif - namespace traits + namespace trait { template<> struct SyncBlockThreads @@ -118,7 +118,7 @@ namespace alpaka # endif } }; - } // namespace traits + } // namespace trait # endif diff --git a/include/alpaka/block/sync/Traits.hpp b/include/alpaka/block/sync/Traits.hpp index a0da71720c17..5d86971ee8dc 100644 --- a/include/alpaka/block/sync/Traits.hpp +++ b/include/alpaka/block/sync/Traits.hpp @@ -1,4 +1,4 @@ -/* Copyright 2020 Benjamin Worpitz, Bernhard Manfred Gruber +/* Copyright 2022 Benjamin Worpitz, Bernhard Manfred Gruber * * This file is part of alpaka. * @@ -21,7 +21,7 @@ namespace alpaka }; //! The block synchronization traits. - namespace traits + namespace trait { //! The block synchronization operation trait. template @@ -30,7 +30,7 @@ namespace alpaka //! The block synchronization and predicate operation trait. template struct SyncBlockThreadsPredicate; - } // namespace traits + } // namespace trait //! Synchronizes all threads within the current block (independently for all blocks). //! @@ -41,7 +41,7 @@ namespace alpaka ALPAKA_FN_ACC auto syncBlockThreads(TBlockSync const& blockSync) -> void { using ImplementationBase = concepts::ImplementationBase; - traits::SyncBlockThreads::syncBlockThreads(blockSync); + trait::SyncBlockThreads::syncBlockThreads(blockSync); } //! The counting function object. @@ -103,7 +103,7 @@ namespace alpaka ALPAKA_FN_ACC auto syncBlockThreadsPredicate(TBlockSync const& blockSync, int predicate) -> int { using ImplementationBase = concepts::ImplementationBase; - return traits::SyncBlockThreadsPredicate::syncBlockThreadsPredicate( + return trait::SyncBlockThreadsPredicate::syncBlockThreadsPredicate( blockSync, predicate); } diff --git a/include/alpaka/core/CudaHipCommon.hpp b/include/alpaka/core/CudaHipCommon.hpp index c8488c60bb8b..734c70167223 100644 --- a/include/alpaka/core/CudaHipCommon.hpp +++ b/include/alpaka/core/CudaHipCommon.hpp @@ -80,22 +80,22 @@ namespace alpaka } // namespace detail # ifdef ALPAKA_ACC_GPU_CUDA_ENABLED - namespace cuda::traits + namespace cuda::trait { template inline constexpr auto isCudaBuiltInType = alpaka::detail::isCudaHipBuiltInType; - } // namespace cuda::traits + } // namespace cuda::trait # endif # ifdef ALPAKA_ACC_GPU_HIP_ENABLED - namespace hip::traits + namespace hip::trait { template inline constexpr auto isHipBuiltInType = alpaka::detail::isCudaHipBuiltInType; - } // namespace hip::traits + } // namespace hip::trait # endif - namespace traits + namespace trait { //! The CUDA/HIP vectors 1D dimension get trait specialization. template @@ -353,7 +353,7 @@ namespace alpaka { using type = std::size_t; }; - } // namespace traits + } // namespace trait } // namespace alpaka #endif diff --git a/include/alpaka/core/Sycl.hpp b/include/alpaka/core/Sycl.hpp index 69c4f6507837..89eb950b663b 100644 --- a/include/alpaka/core/Sycl.hpp +++ b/include/alpaka/core/Sycl.hpp @@ -136,7 +136,7 @@ namespace alpaka::experimental }; } // namespace alpaka::experimental -namespace alpaka::traits +namespace alpaka::trait { //! SYCL's types get trait specialization. template @@ -151,9 +151,9 @@ namespace alpaka::traits { using type = std::conditional_t, T, typename T::element_type>; }; -} // namespace alpaka::traits +} // namespace alpaka::trait -namespace alpaka::traits +namespace alpaka::trait { //! The SYCL vectors' extent get trait specialization. template @@ -243,6 +243,6 @@ namespace alpaka::traits { using type = std::size_t; }; -} // namespace alpaka::traits +} // namespace alpaka::trait #endif diff --git a/include/alpaka/ctx/block/CtxBlockOacc.hpp b/include/alpaka/ctx/block/CtxBlockOacc.hpp index 30c2f83fe196..152c4f07e3e1 100644 --- a/include/alpaka/ctx/block/CtxBlockOacc.hpp +++ b/include/alpaka/ctx/block/CtxBlockOacc.hpp @@ -1,4 +1,4 @@ -/* Copyright 2021 Jeffrey Kelling, Bernhard Manfred Gruber +/* Copyright 2022 Jeffrey Kelling, Bernhard Manfred Gruber * * This file is part of Alpaka. * @@ -76,7 +76,7 @@ namespace alpaka } }; - namespace traits + namespace trait { template struct SyncBlockThreads> @@ -215,7 +215,7 @@ namespace alpaka if(!data) { - traits::SyncBlockThreads>::masterOpBlockThreads( + trait::SyncBlockThreads>::masterOpBlockThreads( smem, [&data, &smem]() { smem.template alloc(TuniqueId); }); data = smem.template getLatestVarPtr(); @@ -233,7 +233,7 @@ namespace alpaka // Nothing to do. Block shared memory is automatically freed when all threads left the block. } }; - } // namespace traits + } // namespace trait } // namespace alpaka #endif diff --git a/include/alpaka/dev/DevCpu.hpp b/include/alpaka/dev/DevCpu.hpp index 24ae0129e7c5..c4991a0b6914 100644 --- a/include/alpaka/dev/DevCpu.hpp +++ b/include/alpaka/dev/DevCpu.hpp @@ -37,7 +37,7 @@ namespace alpaka { using ICpuQueue = IGenericThreadsQueue; } - namespace traits + namespace trait { template struct GetDevByIdx; @@ -95,7 +95,7 @@ namespace alpaka : public concepts::Implements , public concepts::Implements { - friend struct traits::GetDevByIdx; + friend struct trait::GetDevByIdx; protected: DevCpu() : m_spDevCpuImpl(std::make_shared()) @@ -133,7 +133,7 @@ namespace alpaka std::shared_ptr m_spDevCpuImpl; }; - namespace traits + namespace trait { //! The CPU device name get trait specialization. template<> @@ -195,12 +195,12 @@ namespace alpaka return dev.getNativeHandle(); } }; - } // namespace traits + } // namespace trait template class BufCpu; - namespace traits + namespace trait { //! The CPU device memory buffer type trait specialization. template @@ -215,11 +215,11 @@ namespace alpaka { using type = PltfCpu; }; - } // namespace traits + } // namespace trait using QueueCpuNonBlocking = QueueGenericThreadsNonBlocking; using QueueCpuBlocking = QueueGenericThreadsBlocking; - namespace traits + namespace trait { template<> struct QueueType @@ -232,5 +232,5 @@ namespace alpaka { using type = QueueCpuNonBlocking; }; - } // namespace traits + } // namespace trait } // namespace alpaka diff --git a/include/alpaka/dev/DevGenericSycl.hpp b/include/alpaka/dev/DevGenericSycl.hpp index 965e34aa7e5f..edecf4fa8244 100644 --- a/include/alpaka/dev/DevGenericSycl.hpp +++ b/include/alpaka/dev/DevGenericSycl.hpp @@ -139,7 +139,7 @@ namespace alpaka::experimental }; } // namespace alpaka::experimental -namespace alpaka::traits +namespace alpaka::trait { //! The SYCL device name get trait specialization. template @@ -242,6 +242,6 @@ namespace alpaka::traits { using type = experimental::detail::QueueGenericSyclBase, false>; }; -} // namespace alpaka::traits +} // namespace alpaka::trait #endif diff --git a/include/alpaka/dev/DevOacc.hpp b/include/alpaka/dev/DevOacc.hpp index c4aadabfee19..f8d81c145732 100644 --- a/include/alpaka/dev/DevOacc.hpp +++ b/include/alpaka/dev/DevOacc.hpp @@ -141,7 +141,7 @@ namespace alpaka : public concepts::Implements , public concepts::Implements { - friend struct traits::GetDevByIdx; + friend struct trait::GetDevByIdx; template class OnceInitialized @@ -226,7 +226,7 @@ namespace alpaka oacc::detail::DevOaccImpl* m_devOaccImpl; }; - namespace traits + namespace trait { //! The OpenACC device name get trait specialization. template<> @@ -287,12 +287,12 @@ namespace alpaka return dev.getNativeHandle(); } }; - } // namespace traits + } // namespace trait template class BufOacc; - namespace traits + namespace trait { //! The OpenACC device memory buffer type trait specialization. template @@ -307,12 +307,12 @@ namespace alpaka { using type = PltfOacc; }; - } // namespace traits + } // namespace trait using QueueOaccNonBlocking = QueueGenericThreadsNonBlocking; using QueueOaccBlocking = QueueGenericThreadsBlocking; - namespace traits + namespace trait { template<> struct QueueType @@ -369,7 +369,7 @@ namespace alpaka return {static_cast(devIdx)}; } }; - } // namespace traits + } // namespace trait } // namespace alpaka #endif diff --git a/include/alpaka/dev/DevOmp5.hpp b/include/alpaka/dev/DevOmp5.hpp index 774dbf0e5391..cc5d511a96b2 100644 --- a/include/alpaka/dev/DevOmp5.hpp +++ b/include/alpaka/dev/DevOmp5.hpp @@ -37,7 +37,7 @@ namespace alpaka { class DevOmp5; - namespace traits + namespace trait { template struct GetDevByIdx; @@ -141,7 +141,7 @@ namespace alpaka : public concepts::Implements , public concepts::Implements { - friend struct traits::GetDevByIdx; + friend struct trait::GetDevByIdx; DevOmp5(int iDevice) : m_spDevOmp5Impl(std::make_shared(iDevice)) { @@ -186,7 +186,7 @@ namespace alpaka std::shared_ptr m_spDevOmp5Impl; }; - namespace traits + namespace trait { //! The OpenMP 5.0 device name get trait specialization. template<> @@ -252,12 +252,12 @@ namespace alpaka return dev.getNativeHandle(); } }; - } // namespace traits + } // namespace trait template class BufOmp5; - namespace traits + namespace trait { //! The OpenMP 5.0 device memory buffer type trait specialization. template @@ -272,11 +272,11 @@ namespace alpaka { using type = PltfOmp5; }; - } // namespace traits + } // namespace trait using QueueOmp5NonBlocking = QueueGenericThreadsNonBlocking; using QueueOmp5Blocking = QueueGenericThreadsBlocking; - namespace traits + namespace trait { template<> struct QueueType @@ -304,7 +304,7 @@ namespace alpaka generic::currentThreadWaitForDevice(dev); } }; - } // namespace traits + } // namespace trait } // namespace alpaka #endif diff --git a/include/alpaka/dev/DevUniformCudaHipRt.hpp b/include/alpaka/dev/DevUniformCudaHipRt.hpp index 40e993d45c21..f7b40ba9254b 100644 --- a/include/alpaka/dev/DevUniformCudaHipRt.hpp +++ b/include/alpaka/dev/DevUniformCudaHipRt.hpp @@ -33,7 +33,7 @@ namespace alpaka { - namespace traits + namespace trait { template struct GetDevByIdx; @@ -47,7 +47,7 @@ namespace alpaka : public concepts::Implements , public concepts::Implements { - friend struct traits::GetDevByIdx; + friend struct trait::GetDevByIdx; protected: DevUniformCudaHipRt() = default; @@ -81,7 +81,7 @@ namespace alpaka # endif - namespace traits + namespace trait { //! The CUDA/HIP RT device name get trait specialization. template<> @@ -180,12 +180,12 @@ namespace alpaka return dev.getNativeHandle(); } }; - } // namespace traits + } // namespace trait template class BufUniformCudaHipRt; - namespace traits + namespace trait { //! The CUDA/HIP RT device memory buffer type trait specialization. template @@ -229,7 +229,7 @@ namespace alpaka { using type = QueueUniformCudaHipRtNonBlocking; }; - } // namespace traits + } // namespace trait } // namespace alpaka #endif diff --git a/include/alpaka/dev/Traits.hpp b/include/alpaka/dev/Traits.hpp index f4b32a326b35..5ebfd5ac2ce8 100644 --- a/include/alpaka/dev/Traits.hpp +++ b/include/alpaka/dev/Traits.hpp @@ -19,7 +19,7 @@ namespace alpaka { //! The device traits. - namespace traits + namespace trait { //! The device type trait. template @@ -48,11 +48,11 @@ namespace alpaka //! The device reset trait. template struct Reset; - } // namespace traits + } // namespace trait //! The device type trait alias template to remove the ::type. template - using Dev = typename traits::DevType::type; + using Dev = typename trait::DevType::type; struct ConceptGetDev; @@ -63,14 +63,14 @@ namespace alpaka ALPAKA_FN_HOST auto getDev(T const& t) { using ImplementationBase = concepts::ImplementationBase; - return traits::GetDev::getDev(t); + return trait::GetDev::getDev(t); } //! \return The device name. template ALPAKA_FN_HOST auto getName(TDev const& dev) -> std::string { - return traits::GetName::getName(dev); + return trait::GetName::getName(dev); } //! \return The memory on the device in Bytes. Returns 0 if querying memory @@ -78,7 +78,7 @@ namespace alpaka template ALPAKA_FN_HOST auto getMemBytes(TDev const& dev) -> std::size_t { - return traits::GetMemBytes::getMemBytes(dev); + return trait::GetMemBytes::getMemBytes(dev); } //! \return The free memory on the device in Bytes. @@ -87,14 +87,14 @@ namespace alpaka template ALPAKA_FN_HOST auto getFreeMemBytes(TDev const& dev) -> std::size_t { - return traits::GetFreeMemBytes::getFreeMemBytes(dev); + return trait::GetFreeMemBytes::getFreeMemBytes(dev); } //! \return The supported warp sizes on the device in number of threads. template ALPAKA_FN_HOST auto getWarpSizes(TDev const& dev) -> std::vector { - return traits::GetWarpSizes::getWarpSizes(dev); + return trait::GetWarpSizes::getWarpSizes(dev); } //! Resets the device. @@ -102,10 +102,10 @@ namespace alpaka template ALPAKA_FN_HOST auto reset(TDev const& dev) -> void { - traits::Reset::reset(dev); + trait::Reset::reset(dev); } - namespace traits + namespace trait { //! Get device type template @@ -113,5 +113,5 @@ namespace alpaka { using type = typename concepts::ImplementationBase; }; - } // namespace traits + } // namespace trait } // namespace alpaka diff --git a/include/alpaka/dev/cpu/Wait.hpp b/include/alpaka/dev/cpu/Wait.hpp index e09fc6ea4354..c4100d71198e 100644 --- a/include/alpaka/dev/cpu/Wait.hpp +++ b/include/alpaka/dev/cpu/Wait.hpp @@ -1,4 +1,4 @@ -/* Copyright 2020 Benjamin Worpitz, Rene Widera, Bernhard Manfred Gruber +/* Copyright 2022 Benjamin Worpitz, Rene Widera, Bernhard Manfred Gruber * * This file is part of alpaka. * @@ -15,7 +15,7 @@ namespace alpaka { - namespace traits + namespace trait { //! The CPU device thread wait specialization. //! @@ -31,5 +31,5 @@ namespace alpaka generic::currentThreadWaitForDevice(dev); } }; - } // namespace traits + } // namespace trait } // namespace alpaka diff --git a/include/alpaka/dim/DimArithmetic.hpp b/include/alpaka/dim/DimArithmetic.hpp index 945759e1ec4f..1d36ef18c49f 100644 --- a/include/alpaka/dim/DimArithmetic.hpp +++ b/include/alpaka/dim/DimArithmetic.hpp @@ -13,7 +13,7 @@ #include -namespace alpaka::traits +namespace alpaka::trait { //! The arithmetic type dimension getter trait specialization. template @@ -21,4 +21,4 @@ namespace alpaka::traits { using type = DimInt<1u>; }; -} // namespace alpaka::traits +} // namespace alpaka::trait diff --git a/include/alpaka/dim/Traits.hpp b/include/alpaka/dim/Traits.hpp index e171f8f731ac..8cc03a96b460 100644 --- a/include/alpaka/dim/Traits.hpp +++ b/include/alpaka/dim/Traits.hpp @@ -11,15 +11,15 @@ namespace alpaka { - //! The dimension traits. - namespace traits + //! The dimension trait. + namespace trait { //! The dimension getter type trait. template struct DimType; - } // namespace traits + } // namespace trait //! The dimension type trait alias template to remove the ::type. template - using Dim = typename traits::DimType::type; + using Dim = typename trait::DimType::type; } // namespace alpaka diff --git a/include/alpaka/elem/Traits.hpp b/include/alpaka/elem/Traits.hpp index c779b4f90e3d..ed4c16bbc47a 100644 --- a/include/alpaka/elem/Traits.hpp +++ b/include/alpaka/elem/Traits.hpp @@ -1,4 +1,4 @@ -/* Copyright 2020 Benjamin Worpitz, Bernhard Manfred Gruber +/* Copyright 2022 Benjamin Worpitz, Bernhard Manfred Gruber * * This file is part of alpaka. * @@ -13,20 +13,20 @@ namespace alpaka { - //! The element traits. - namespace traits + //! The element trait. + namespace trait { //! The element type trait. template struct ElemType; - } // namespace traits + } // namespace trait //! The element type trait alias template to remove the ::type. template - using Elem = std::remove_volatile_t::type>; + using Elem = std::remove_volatile_t::type>; // Trait specializations for unsigned integral types. - namespace traits + namespace trait { //! The fundamental type elem type trait specialization. template @@ -34,5 +34,5 @@ namespace alpaka { using type = T; }; - } // namespace traits + } // namespace trait } // namespace alpaka diff --git a/include/alpaka/event/EventGenericSycl.hpp b/include/alpaka/event/EventGenericSycl.hpp index 6df958fec1b9..b806dc4c8759 100644 --- a/include/alpaka/event/EventGenericSycl.hpp +++ b/include/alpaka/event/EventGenericSycl.hpp @@ -62,7 +62,7 @@ namespace alpaka::experimental }; } // namespace alpaka::experimental -namespace alpaka::traits +namespace alpaka::trait { //! The SYCL device event device get trait specialization. template @@ -169,6 +169,6 @@ namespace alpaka::traits return event.getNativeHandle(); } }; -} // namespace alpaka::traits +} // namespace alpaka::trait #endif diff --git a/include/alpaka/event/EventGenericThreads.hpp b/include/alpaka/event/EventGenericThreads.hpp index ad67726748e8..a7e3979538f4 100644 --- a/include/alpaka/event/EventGenericThreads.hpp +++ b/include/alpaka/event/EventGenericThreads.hpp @@ -95,7 +95,7 @@ namespace alpaka public: std::shared_ptr> m_spEventImpl; }; - namespace traits + namespace trait { //! The CPU device event device type trait specialization. template @@ -228,8 +228,8 @@ namespace alpaka alpaka::enqueue(*queue.m_spQueueImpl, event); } }; - } // namespace traits - namespace traits + } // namespace trait + namespace trait { namespace generic { @@ -395,5 +395,5 @@ namespace alpaka wait(event); } }; - } // namespace traits + } // namespace trait } // namespace alpaka diff --git a/include/alpaka/event/EventUniformCudaHipRt.hpp b/include/alpaka/event/EventUniformCudaHipRt.hpp index e81e81c0540e..1d83d2bfc46b 100644 --- a/include/alpaka/event/EventUniformCudaHipRt.hpp +++ b/include/alpaka/event/EventUniformCudaHipRt.hpp @@ -116,7 +116,7 @@ namespace alpaka public: std::shared_ptr m_spEventImpl; }; - namespace traits + namespace trait { //! The CUDA/HIP RT device event device type trait specialization. template<> @@ -249,7 +249,7 @@ namespace alpaka return event.getNativeHandle(); } }; - } // namespace traits + } // namespace trait } // namespace alpaka #endif diff --git a/include/alpaka/event/Traits.hpp b/include/alpaka/event/Traits.hpp index c991052b0c0b..e57b7e35119f 100644 --- a/include/alpaka/event/Traits.hpp +++ b/include/alpaka/event/Traits.hpp @@ -1,4 +1,4 @@ -/* Copyright 2020 Benjamin Worpitz, Bernhard Manfred Gruber +/* Copyright 2022 Benjamin Worpitz, Bernhard Manfred Gruber * * This file is part of alpaka. * @@ -15,7 +15,7 @@ namespace alpaka { //! The event management traits. - namespace traits + namespace trait { //! The event type trait. template @@ -24,11 +24,11 @@ namespace alpaka //! The event tester trait. template struct IsComplete; - } // namespace traits + } // namespace trait //! The event type trait alias template to remove the ::type. template - using Event = typename traits::EventType::type; + using Event = typename trait::EventType::type; //! Tests if the given event has already been completed. //! @@ -38,6 +38,6 @@ namespace alpaka template ALPAKA_FN_HOST auto isComplete(TEvent const& event) -> bool { - return traits::IsComplete::isComplete(event); + return trait::IsComplete::isComplete(event); } } // namespace alpaka diff --git a/include/alpaka/extent/Traits.hpp b/include/alpaka/extent/Traits.hpp index 2c4205a0eb88..31e0b82aa714 100644 --- a/include/alpaka/extent/Traits.hpp +++ b/include/alpaka/extent/Traits.hpp @@ -21,7 +21,7 @@ namespace alpaka { //! The extent traits. - namespace traits + namespace trait { //! The extent get trait. //! @@ -39,14 +39,14 @@ namespace alpaka //! The extent set trait. template struct SetExtent; - } // namespace traits + } // namespace trait //! \return The extent in the given dimension. ALPAKA_NO_HOST_ACC_WARNING template ALPAKA_FN_HOST_ACC auto getExtent(TExtent const& extent = TExtent()) -> Idx { - return traits::GetExtent, TExtent>::getExtent(extent); + return trait::GetExtent, TExtent>::getExtent(extent); } //! \return The width. ALPAKA_NO_HOST_ACC_WARNING @@ -96,7 +96,7 @@ namespace alpaka template ALPAKA_FN_HOST_ACC auto setExtent(TExtent& extent, TExtentVal const& extentVal) -> void { - traits::SetExtent, TExtent, TExtentVal>::setExtent(extent, extentVal); + trait::SetExtent, TExtent, TExtentVal>::setExtent(extent, extentVal); } //! Sets the width. ALPAKA_NO_HOST_ACC_WARNING @@ -121,7 +121,7 @@ namespace alpaka } // Trait specializations for unsigned integral types. - namespace traits + namespace trait { //! The unsigned integral width get trait specialization. template @@ -143,5 +143,5 @@ namespace alpaka extent = extentVal; } }; - } // namespace traits + } // namespace trait } // namespace alpaka diff --git a/include/alpaka/idx/Accessors.hpp b/include/alpaka/idx/Accessors.hpp index 45716ad6da77..f0f3340cfce4 100644 --- a/include/alpaka/idx/Accessors.hpp +++ b/include/alpaka/idx/Accessors.hpp @@ -27,17 +27,17 @@ namespace alpaka template ALPAKA_FN_HOST_ACC auto getIdx(TIdx const& idx, TWorkDiv const& workDiv) -> Vec, Idx> { - return traits::GetIdx::getIdx(idx, workDiv); + return trait::GetIdx::getIdx(idx, workDiv); } //! Get the indices requested. ALPAKA_NO_HOST_ACC_WARNING template ALPAKA_FN_HOST_ACC auto getIdx(TIdxWorkDiv const& idxWorkDiv) -> Vec, Idx> { - return traits::GetIdx::getIdx(idxWorkDiv, idxWorkDiv); + return trait::GetIdx::getIdx(idxWorkDiv, idxWorkDiv); } - namespace traits + namespace trait { //! The grid block index get trait specialization for classes with IdxGbBase member type. template @@ -50,7 +50,7 @@ namespace alpaka ALPAKA_FN_HOST_ACC static auto getIdx(TIdxGb const& idx, TWorkDiv const& workDiv) -> Vec, Idx> { - return traits::GetIdx::getIdx(idx, workDiv); + return trait::GetIdx::getIdx(idx, workDiv); } }; @@ -65,7 +65,7 @@ namespace alpaka ALPAKA_FN_HOST_ACC static auto getIdx(TIdxBt const& idx, TWorkDiv const& workDiv) -> Vec, Idx> { - return traits::GetIdx::getIdx(idx, workDiv); + return trait::GetIdx::getIdx(idx, workDiv); } }; @@ -83,7 +83,7 @@ namespace alpaka + alpaka::getIdx(idx, workDiv); } }; - } // namespace traits + } // namespace trait //! Get the index of the first element this thread computes. ALPAKA_NO_HOST_ACC_WARNING template diff --git a/include/alpaka/idx/Traits.hpp b/include/alpaka/idx/Traits.hpp index fcfc8c2cf99d..ed9d8c92cd05 100644 --- a/include/alpaka/idx/Traits.hpp +++ b/include/alpaka/idx/Traits.hpp @@ -1,4 +1,4 @@ -/* Copyright 2020 Benjamin Worpitz, Bernhard Manfred Gruber +/* Copyright 2022 Benjamin Worpitz, Bernhard Manfred Gruber * * This file is part of alpaka. * @@ -21,18 +21,18 @@ namespace alpaka { }; - //! The idx traits. - namespace traits + //! The idx trait. + namespace trait { //! The idx type trait. template struct IdxType; - } // namespace traits + } // namespace trait template - using Idx = typename traits::IdxType::type; + using Idx = typename trait::IdxType::type; - namespace traits + namespace trait { //! The arithmetic idx type trait specialization. template @@ -44,5 +44,5 @@ namespace alpaka //! The index get trait. template struct GetIdx; - } // namespace traits + } // namespace trait } // namespace alpaka diff --git a/include/alpaka/idx/bt/IdxBtGenericSycl.hpp b/include/alpaka/idx/bt/IdxBtGenericSycl.hpp index dceea86ab5ba..8e19bfe31e46 100644 --- a/include/alpaka/idx/bt/IdxBtGenericSycl.hpp +++ b/include/alpaka/idx/bt/IdxBtGenericSycl.hpp @@ -36,7 +36,7 @@ namespace alpaka::experimental::bt }; } // namespace alpaka::experimental::bt -namespace alpaka::traits +namespace alpaka::trait { //! The SYCL accelerator index dimension get trait specialization. template @@ -78,6 +78,6 @@ namespace alpaka::traits { using type = TIdx; }; -} // namespace alpaka::traits +} // namespace alpaka::trait #endif diff --git a/include/alpaka/idx/bt/IdxBtLinear.hpp b/include/alpaka/idx/bt/IdxBtLinear.hpp index 53d136f4f415..112df0b3f092 100644 --- a/include/alpaka/idx/bt/IdxBtLinear.hpp +++ b/include/alpaka/idx/bt/IdxBtLinear.hpp @@ -33,7 +33,7 @@ namespace alpaka }; } // namespace bt - namespace traits + namespace trait { //! The IdxBtLinear index dimension get trait specialization. template @@ -73,5 +73,5 @@ namespace alpaka { using type = TIdx; }; - } // namespace traits + } // namespace trait } // namespace alpaka diff --git a/include/alpaka/idx/bt/IdxBtOmp.hpp b/include/alpaka/idx/bt/IdxBtOmp.hpp index e672ceff9d08..c6075d82b220 100644 --- a/include/alpaka/idx/bt/IdxBtOmp.hpp +++ b/include/alpaka/idx/bt/IdxBtOmp.hpp @@ -32,7 +32,7 @@ namespace alpaka }; } // namespace bt - namespace traits + namespace trait { //! The OpenMP accelerator index dimension get trait specialization. template @@ -76,7 +76,7 @@ namespace alpaka { using type = TIdx; }; - } // namespace traits + } // namespace trait } // namespace alpaka #endif diff --git a/include/alpaka/idx/bt/IdxBtRefFiberIdMap.hpp b/include/alpaka/idx/bt/IdxBtRefFiberIdMap.hpp index 2c20cd9b04af..494faa786246 100644 --- a/include/alpaka/idx/bt/IdxBtRefFiberIdMap.hpp +++ b/include/alpaka/idx/bt/IdxBtRefFiberIdMap.hpp @@ -43,7 +43,7 @@ namespace alpaka }; } // namespace bt - namespace traits + namespace trait { //! The CPU fibers accelerator index dimension get trait specialization. template @@ -75,7 +75,7 @@ namespace alpaka { using type = TIdx; }; - } // namespace traits + } // namespace trait } // namespace alpaka #endif diff --git a/include/alpaka/idx/bt/IdxBtRefThreadIdMap.hpp b/include/alpaka/idx/bt/IdxBtRefThreadIdMap.hpp index dae111575d10..84afb27667a8 100644 --- a/include/alpaka/idx/bt/IdxBtRefThreadIdMap.hpp +++ b/include/alpaka/idx/bt/IdxBtRefThreadIdMap.hpp @@ -43,7 +43,7 @@ namespace alpaka }; } // namespace bt - namespace traits + namespace trait { //! The CPU threads accelerator index dimension get trait specialization. template @@ -75,7 +75,7 @@ namespace alpaka { using type = TIdx; }; - } // namespace traits + } // namespace trait } // namespace alpaka #endif diff --git a/include/alpaka/idx/bt/IdxBtUniformCudaHipBuiltIn.hpp b/include/alpaka/idx/bt/IdxBtUniformCudaHipBuiltIn.hpp index cc1ee0e418b1..0dcb86db7197 100644 --- a/include/alpaka/idx/bt/IdxBtUniformCudaHipBuiltIn.hpp +++ b/include/alpaka/idx/bt/IdxBtUniformCudaHipBuiltIn.hpp @@ -47,7 +47,7 @@ namespace alpaka # error If ALPAKA_ACC_GPU_HIP_ENABLED is set, the compiler has to support HIP! # endif - namespace traits + namespace trait { //! The GPU CUDA/HIP accelerator index dimension get trait specialization. template @@ -82,7 +82,7 @@ namespace alpaka { using type = TIdx; }; - } // namespace traits + } // namespace trait # endif diff --git a/include/alpaka/idx/bt/IdxBtZero.hpp b/include/alpaka/idx/bt/IdxBtZero.hpp index d3a4cf404202..b3229ded5317 100644 --- a/include/alpaka/idx/bt/IdxBtZero.hpp +++ b/include/alpaka/idx/bt/IdxBtZero.hpp @@ -25,7 +25,7 @@ namespace alpaka }; } // namespace bt - namespace traits + namespace trait { //! The zero block thread index provider dimension get trait specialization. template @@ -54,5 +54,5 @@ namespace alpaka { using type = TIdx; }; - } // namespace traits + } // namespace trait } // namespace alpaka diff --git a/include/alpaka/idx/gb/IdxGbGenericSycl.hpp b/include/alpaka/idx/gb/IdxGbGenericSycl.hpp index e04bc03505a4..f1d4a54653a8 100644 --- a/include/alpaka/idx/gb/IdxGbGenericSycl.hpp +++ b/include/alpaka/idx/gb/IdxGbGenericSycl.hpp @@ -36,7 +36,7 @@ namespace alpaka::experimental::gb }; } // namespace alpaka::experimental::gb -namespace alpaka::traits +namespace alpaka::trait { //! The SYCL accelerator index dimension get trait specialization. template @@ -77,6 +77,6 @@ namespace alpaka::traits { using type = TIdx; }; -} // namespace alpaka::traits +} // namespace alpaka::trait #endif diff --git a/include/alpaka/idx/gb/IdxGbLinear.hpp b/include/alpaka/idx/gb/IdxGbLinear.hpp index 7d6dcb4aea86..99d83c078873 100644 --- a/include/alpaka/idx/gb/IdxGbLinear.hpp +++ b/include/alpaka/idx/gb/IdxGbLinear.hpp @@ -33,7 +33,7 @@ namespace alpaka }; } // namespace gb - namespace traits + namespace trait { //! The IdxGbLinear index dimension get trait specialization. template @@ -74,5 +74,5 @@ namespace alpaka { using type = TIdx; }; - } // namespace traits + } // namespace trait } // namespace alpaka diff --git a/include/alpaka/idx/gb/IdxGbRef.hpp b/include/alpaka/idx/gb/IdxGbRef.hpp index 4123ab40411e..b86b2c197a92 100644 --- a/include/alpaka/idx/gb/IdxGbRef.hpp +++ b/include/alpaka/idx/gb/IdxGbRef.hpp @@ -32,7 +32,7 @@ namespace alpaka }; } // namespace gb - namespace traits + namespace trait { //! The IdxGbRef grid block index dimension get trait specialization. template @@ -60,5 +60,5 @@ namespace alpaka { using type = TIdx; }; - } // namespace traits + } // namespace trait } // namespace alpaka diff --git a/include/alpaka/idx/gb/IdxGbUniformCudaHipBuiltIn.hpp b/include/alpaka/idx/gb/IdxGbUniformCudaHipBuiltIn.hpp index 2b852962f637..02003cfe79ec 100644 --- a/include/alpaka/idx/gb/IdxGbUniformCudaHipBuiltIn.hpp +++ b/include/alpaka/idx/gb/IdxGbUniformCudaHipBuiltIn.hpp @@ -47,7 +47,7 @@ namespace alpaka # error If ALPAKA_ACC_GPU_HIP_ENABLED is set, the compiler has to support HIP! # endif - namespace traits + namespace trait { //! The GPU CUDA/HIP accelerator index dimension get trait specialization. template @@ -82,7 +82,7 @@ namespace alpaka { using type = TIdx; }; - } // namespace traits + } // namespace trait # endif diff --git a/include/alpaka/intrinsic/IntrinsicCpu.hpp b/include/alpaka/intrinsic/IntrinsicCpu.hpp index ca497bfeddc3..e51c1566c99e 100644 --- a/include/alpaka/intrinsic/IntrinsicCpu.hpp +++ b/include/alpaka/intrinsic/IntrinsicCpu.hpp @@ -1,4 +1,4 @@ -/* Copyright 2021 Sergei Bastrakov, Bernhard Manfred Gruber +/* Copyright 2022 Sergei Bastrakov, Bernhard Manfred Gruber * * This file is part of alpaka. * @@ -26,7 +26,7 @@ namespace alpaka { }; - namespace traits + namespace trait { template<> struct Popcount @@ -93,5 +93,5 @@ namespace alpaka #endif } }; - } // namespace traits + } // namespace trait } // namespace alpaka diff --git a/include/alpaka/intrinsic/IntrinsicFallback.hpp b/include/alpaka/intrinsic/IntrinsicFallback.hpp index 7cab051dabe4..c885429554e1 100644 --- a/include/alpaka/intrinsic/IntrinsicFallback.hpp +++ b/include/alpaka/intrinsic/IntrinsicFallback.hpp @@ -1,4 +1,4 @@ -/* Copyright 2021 Sergei Bastrakov, Jeffrey Kelling, Bernhard Manfred Gruber +/* Copyright 2022 Sergei Bastrakov, Jeffrey Kelling, Bernhard Manfred Gruber * * This file is part of alpaka. * @@ -49,7 +49,7 @@ namespace alpaka { }; - namespace traits + namespace trait { template<> struct Popcount @@ -78,5 +78,5 @@ namespace alpaka return alpaka::detail::ffsFallback(value); } }; - } // namespace traits + } // namespace trait } // namespace alpaka diff --git a/include/alpaka/intrinsic/IntrinsicGenericSycl.hpp b/include/alpaka/intrinsic/IntrinsicGenericSycl.hpp index 00951ca95284..d77c612ef5c3 100644 --- a/include/alpaka/intrinsic/IntrinsicGenericSycl.hpp +++ b/include/alpaka/intrinsic/IntrinsicGenericSycl.hpp @@ -26,7 +26,7 @@ namespace alpaka::experimental }; } // namespace alpaka::experimental -namespace alpaka::traits +namespace alpaka::trait { template<> struct Popcount @@ -57,6 +57,6 @@ namespace alpaka::traits return (value == 0l) ? 0 : static_cast(sycl::popcount(value ^ ~(-value))); } }; -} // namespace alpaka::traits +} // namespace alpaka::trait #endif diff --git a/include/alpaka/intrinsic/IntrinsicUniformCudaHipBuiltIn.hpp b/include/alpaka/intrinsic/IntrinsicUniformCudaHipBuiltIn.hpp index e21b3c5b606e..cdb23960f9ed 100644 --- a/include/alpaka/intrinsic/IntrinsicUniformCudaHipBuiltIn.hpp +++ b/include/alpaka/intrinsic/IntrinsicUniformCudaHipBuiltIn.hpp @@ -33,7 +33,7 @@ namespace alpaka # error If ALPAKA_ACC_GPU_HIP_ENABLED is set, the compiler has to support HIP! # endif - namespace traits + namespace trait { template<> struct Popcount @@ -74,7 +74,7 @@ namespace alpaka return static_cast(__ffsll(static_cast(value))); } }; - } // namespace traits + } // namespace trait # endif diff --git a/include/alpaka/intrinsic/Traits.hpp b/include/alpaka/intrinsic/Traits.hpp index e08764d5cf43..09b7bfbaebca 100644 --- a/include/alpaka/intrinsic/Traits.hpp +++ b/include/alpaka/intrinsic/Traits.hpp @@ -1,4 +1,4 @@ -/* Copyright 2020 Sergei Bastrakov, Bernhard Manfred Gruber +/* Copyright 2022 Sergei Bastrakov, Bernhard Manfred Gruber * * This file is part of alpaka. * @@ -22,7 +22,7 @@ namespace alpaka }; //! The intrinsics traits. - namespace traits + namespace trait { //! The popcount trait. template @@ -31,7 +31,7 @@ namespace alpaka //! The ffs trait. template struct Ffs; - } // namespace traits + } // namespace trait //! Returns the number of 1 bits in the given 32-bit value. //! @@ -43,7 +43,7 @@ namespace alpaka ALPAKA_FN_ACC auto popcount(TIntrinsic const& intrinsic, std::uint32_t value) -> std::int32_t { using ImplementationBase = concepts::ImplementationBase; - return traits::Popcount::popcount(intrinsic, value); + return trait::Popcount::popcount(intrinsic, value); } //! Returns the number of 1 bits in the given 64-bit value. @@ -56,7 +56,7 @@ namespace alpaka ALPAKA_FN_ACC auto popcount(TIntrinsic const& intrinsic, std::uint64_t value) -> std::int32_t { using ImplementationBase = concepts::ImplementationBase; - return traits::Popcount::popcount(intrinsic, value); + return trait::Popcount::popcount(intrinsic, value); } //! Returns the 1-based position of the least significant bit set to 1 @@ -70,7 +70,7 @@ namespace alpaka ALPAKA_FN_ACC auto ffs(TIntrinsic const& intrinsic, std::int32_t value) -> std::int32_t { using ImplementationBase = concepts::ImplementationBase; - return traits::Ffs::ffs(intrinsic, value); + return trait::Ffs::ffs(intrinsic, value); } //! Returns the 1-based position of the least significant bit set to 1 @@ -84,6 +84,6 @@ namespace alpaka ALPAKA_FN_ACC auto ffs(TIntrinsic const& intrinsic, std::int64_t value) -> std::int32_t { using ImplementationBase = concepts::ImplementationBase; - return traits::Ffs::ffs(intrinsic, value); + return trait::Ffs::ffs(intrinsic, value); } } // namespace alpaka diff --git a/include/alpaka/kernel/TaskKernelCpuFibers.hpp b/include/alpaka/kernel/TaskKernelCpuFibers.hpp index 43d40b9787de..7bd21c00edc6 100644 --- a/include/alpaka/kernel/TaskKernelCpuFibers.hpp +++ b/include/alpaka/kernel/TaskKernelCpuFibers.hpp @@ -239,7 +239,7 @@ namespace alpaka std::tuple...> m_args; }; - namespace traits + namespace trait { //! The CPU fibers execution task accelerator type trait specialization. template @@ -275,7 +275,7 @@ namespace alpaka { using type = TIdx; }; - } // namespace traits + } // namespace trait } // namespace alpaka #endif diff --git a/include/alpaka/kernel/TaskKernelCpuOmp2Blocks.hpp b/include/alpaka/kernel/TaskKernelCpuOmp2Blocks.hpp index 30653531ed17..52ad7553ed50 100644 --- a/include/alpaka/kernel/TaskKernelCpuOmp2Blocks.hpp +++ b/include/alpaka/kernel/TaskKernelCpuOmp2Blocks.hpp @@ -1,4 +1,4 @@ -/* Copyright 2021 Benjamin Worpitz, Bert Wesarg, René Widera, Sergei Bastrakov, Bernhard Manfred Gruber +/* Copyright 2022 Benjamin Worpitz, Bert Wesarg, René Widera, Sergei Bastrakov, Bernhard Manfred Gruber * * This file is part of alpaka. * @@ -915,7 +915,7 @@ namespace alpaka std::tuple...> m_args; }; - namespace traits + namespace trait { //! The CPU OpenMP 2.0 grid block execution task accelerator type trait specialization. template @@ -951,7 +951,7 @@ namespace alpaka { using type = TIdx; }; - } // namespace traits + } // namespace trait } // namespace alpaka #endif diff --git a/include/alpaka/kernel/TaskKernelCpuOmp2Threads.hpp b/include/alpaka/kernel/TaskKernelCpuOmp2Threads.hpp index 1ce82a156c5c..35b048171db9 100644 --- a/include/alpaka/kernel/TaskKernelCpuOmp2Threads.hpp +++ b/include/alpaka/kernel/TaskKernelCpuOmp2Threads.hpp @@ -161,7 +161,7 @@ namespace alpaka std::tuple...> m_args; }; - namespace traits + namespace trait { //! The CPU OpenMP 2.0 block thread execution task accelerator type trait specialization. template @@ -197,7 +197,7 @@ namespace alpaka { using type = TIdx; }; - } // namespace traits + } // namespace trait } // namespace alpaka #endif diff --git a/include/alpaka/kernel/TaskKernelCpuSerial.hpp b/include/alpaka/kernel/TaskKernelCpuSerial.hpp index 61fdb02b6734..e4baa387e8b2 100644 --- a/include/alpaka/kernel/TaskKernelCpuSerial.hpp +++ b/include/alpaka/kernel/TaskKernelCpuSerial.hpp @@ -106,7 +106,7 @@ namespace alpaka std::tuple...> m_args; }; - namespace traits + namespace trait { //! The CPU serial execution task accelerator type trait specialization. template @@ -142,7 +142,7 @@ namespace alpaka { using type = TIdx; }; - } // namespace traits + } // namespace trait } // namespace alpaka #endif diff --git a/include/alpaka/kernel/TaskKernelCpuTbbBlocks.hpp b/include/alpaka/kernel/TaskKernelCpuTbbBlocks.hpp index 01f72da683ff..16cc1896e2d9 100644 --- a/include/alpaka/kernel/TaskKernelCpuTbbBlocks.hpp +++ b/include/alpaka/kernel/TaskKernelCpuTbbBlocks.hpp @@ -1,4 +1,4 @@ -/* Copyright 2021 Benjamin Worpitz, Erik Zenker, René Widera, Felice Pantaleo, Bernhard Manfred Gruber +/* Copyright 2022 Benjamin Worpitz, Erik Zenker, René Widera, Felice Pantaleo, Bernhard Manfred Gruber * * This file is part of alpaka. * @@ -118,7 +118,7 @@ namespace alpaka std::tuple...> m_args; }; - namespace traits + namespace trait { //! The CPU TBB block execution task accelerator type trait specialization. template @@ -154,7 +154,7 @@ namespace alpaka { using type = TIdx; }; - } // namespace traits + } // namespace trait } // namespace alpaka #endif diff --git a/include/alpaka/kernel/TaskKernelCpuThreads.hpp b/include/alpaka/kernel/TaskKernelCpuThreads.hpp index a9d513f7ffc4..8a5e0f3b9814 100644 --- a/include/alpaka/kernel/TaskKernelCpuThreads.hpp +++ b/include/alpaka/kernel/TaskKernelCpuThreads.hpp @@ -236,7 +236,7 @@ namespace alpaka std::tuple...> m_args; }; - namespace traits + namespace trait { //! The CPU threads execution task accelerator type trait specialization. template @@ -272,7 +272,7 @@ namespace alpaka { using type = TIdx; }; - } // namespace traits + } // namespace trait } // namespace alpaka #endif diff --git a/include/alpaka/kernel/TaskKernelGenericSycl.hpp b/include/alpaka/kernel/TaskKernelGenericSycl.hpp index df58ea17863c..721cb4cff9ad 100644 --- a/include/alpaka/kernel/TaskKernelGenericSycl.hpp +++ b/include/alpaka/kernel/TaskKernelGenericSycl.hpp @@ -220,7 +220,7 @@ namespace alpaka::experimental }; } // namespace alpaka::experimental -namespace alpaka::traits +namespace alpaka::trait { //! The SYCL execution task accelerator type trait specialization. template @@ -256,6 +256,6 @@ namespace alpaka::traits { using type = TIdx; }; -} // namespace alpaka::traits +} // namespace alpaka::trait #endif diff --git a/include/alpaka/kernel/TaskKernelGpuUniformCudaHipRt.hpp b/include/alpaka/kernel/TaskKernelGpuUniformCudaHipRt.hpp index 885f73a0e89e..749749ab6b8c 100644 --- a/include/alpaka/kernel/TaskKernelGpuUniformCudaHipRt.hpp +++ b/include/alpaka/kernel/TaskKernelGpuUniformCudaHipRt.hpp @@ -145,7 +145,7 @@ namespace alpaka std::tuple>...> m_args; }; - namespace traits + namespace trait { //! The GPU CUDA/HIP execution task accelerator type trait specialization. template @@ -431,7 +431,7 @@ namespace alpaka } } }; - } // namespace traits + } // namespace trait } // namespace alpaka # endif diff --git a/include/alpaka/kernel/TaskKernelOacc.hpp b/include/alpaka/kernel/TaskKernelOacc.hpp index 5274804527b8..770d3cffe9cd 100644 --- a/include/alpaka/kernel/TaskKernelOacc.hpp +++ b/include/alpaka/kernel/TaskKernelOacc.hpp @@ -1,4 +1,4 @@ -/* Copyright 2021 Benjamin Worpitz, René Widera, Bernhard Manfred Gruber +/* Copyright 2022 Benjamin Worpitz, René Widera, Bernhard Manfred Gruber * * This file is part of Alpaka. * @@ -165,7 +165,7 @@ namespace alpaka core::Tuple...> m_args; }; - namespace traits + namespace trait { //! The OpenACC execution task accelerator type trait specialization. template @@ -230,7 +230,7 @@ namespace alpaka { task(queue.m_spQueueImpl->m_dev); }); } }; - } // namespace traits + } // namespace trait } // namespace alpaka #endif diff --git a/include/alpaka/kernel/TaskKernelOmp5.hpp b/include/alpaka/kernel/TaskKernelOmp5.hpp index 016febb4e0a8..8b7b9daefa89 100644 --- a/include/alpaka/kernel/TaskKernelOmp5.hpp +++ b/include/alpaka/kernel/TaskKernelOmp5.hpp @@ -200,7 +200,7 @@ namespace alpaka TKernelFnObj m_kernelFnObj; core::Tuple...> m_args; }; - namespace traits + namespace trait { //! The OpenMP 5.0 execution task accelerator type trait specialization. template @@ -265,7 +265,7 @@ namespace alpaka { task(queue.m_spQueueImpl->m_dev); }); } }; - } // namespace traits + } // namespace trait } // namespace alpaka #endif diff --git a/include/alpaka/kernel/Traits.hpp b/include/alpaka/kernel/Traits.hpp index 67c0c3c2d6ef..5742aaa9e4ef 100644 --- a/include/alpaka/kernel/Traits.hpp +++ b/include/alpaka/kernel/Traits.hpp @@ -27,7 +27,7 @@ namespace alpaka { //! The kernel traits. - namespace traits + namespace trait { //! The kernel execution task creation trait. template< @@ -125,7 +125,7 @@ namespace alpaka return TraitNotSpecialized{}; } }; - } // namespace traits + } // namespace trait #if BOOST_COMP_CLANG # pragma clang diagnostic push @@ -150,7 +150,7 @@ namespace alpaka Vec> const& threadElemExtent, TArgs const&... args) -> std::size_t { - return traits::BlockSharedMemDynSizeBytes::getBlockSharedMemDynSizeBytes( + return trait::BlockSharedMemDynSizeBytes::getBlockSharedMemDynSizeBytes( kernelFnObj, blockThreadExtent, threadElemExtent, @@ -179,7 +179,7 @@ namespace alpaka Vec> const& threadElemExtent, TArgs const&... args) { - return traits::OmpSchedule::getOmpSchedule( + return trait::OmpSchedule::getOmpSchedule( kernelFnObj, blockThreadExtent, threadElemExtent, @@ -236,7 +236,7 @@ namespace alpaka std::cout << __func__ << " workDiv: " << workDiv << ", kernelFnObj: " << typeid(kernelFnObj).name() << std::endl; #endif - return traits::CreateTaskKernel::createTaskKernel( + return trait::CreateTaskKernel::createTaskKernel( workDiv, kernelFnObj, std::forward(args)...); diff --git a/include/alpaka/math/MathGenericSycl.hpp b/include/alpaka/math/MathGenericSycl.hpp index a271bea58765..0ed5dbb827c9 100644 --- a/include/alpaka/math/MathGenericSycl.hpp +++ b/include/alpaka/math/MathGenericSycl.hpp @@ -189,7 +189,7 @@ namespace alpaka::experimental::math }; } // namespace alpaka::experimental::math -namespace alpaka::math::traits +namespace alpaka::math::trait { //! The SYCL abs trait specialization. template @@ -544,6 +544,6 @@ namespace alpaka::math::traits return sycl::trunc(arg); } }; -} // namespace alpaka::math::traits +} // namespace alpaka::math::trait #endif diff --git a/include/alpaka/math/MathStdLib.hpp b/include/alpaka/math/MathStdLib.hpp index 1d09e3cda817..34564b032605 100644 --- a/include/alpaka/math/MathStdLib.hpp +++ b/include/alpaka/math/MathStdLib.hpp @@ -182,7 +182,7 @@ namespace alpaka::math { }; - namespace traits + namespace trait { //! The standard library max trait specialization. template @@ -229,6 +229,6 @@ namespace alpaka::math ALPAKA_UNREACHABLE(std::common_type_t{}); } }; - } // namespace traits + } // namespace trait } // namespace alpaka::math diff --git a/include/alpaka/math/MathUniformCudaHipBuiltIn.hpp b/include/alpaka/math/MathUniformCudaHipBuiltIn.hpp index 438da57c554c..af7b245a68bf 100644 --- a/include/alpaka/math/MathUniformCudaHipBuiltIn.hpp +++ b/include/alpaka/math/MathUniformCudaHipBuiltIn.hpp @@ -202,7 +202,7 @@ namespace alpaka::math # error If ALPAKA_ACC_GPU_HIP_ENABLED is set, the compiler has to support HIP! # endif - namespace traits + namespace trait { //! The CUDA built in abs trait specialization. template @@ -742,7 +742,7 @@ namespace alpaka::math ALPAKA_UNREACHABLE(TArg{}); } }; - } // namespace traits + } // namespace trait # endif } // namespace alpaka::math diff --git a/include/alpaka/math/Traits.hpp b/include/alpaka/math/Traits.hpp index 5faa6825a036..7793d13d7d76 100644 --- a/include/alpaka/math/Traits.hpp +++ b/include/alpaka/math/Traits.hpp @@ -125,7 +125,7 @@ namespace alpaka::math }; //! The math traits. - namespace traits + namespace trait { //! The abs trait. template @@ -528,7 +528,7 @@ namespace alpaka::math return trunc(arg); } }; - } // namespace traits + } // namespace trait //! Computes the absolute value. //! @@ -541,7 +541,7 @@ namespace alpaka::math ALPAKA_FN_HOST_ACC auto abs(T const& abs_ctx, TArg const& arg) { using ImplementationBase = concepts::ImplementationBase; - return traits::Abs{}(abs_ctx, arg); + return trait::Abs{}(abs_ctx, arg); } //! Computes the principal value of the arc cosine. @@ -558,7 +558,7 @@ namespace alpaka::math ALPAKA_FN_HOST_ACC auto acos(T const& acos_ctx, TArg const& arg) { using ImplementationBase = concepts::ImplementationBase; - return traits::Acos{}(acos_ctx, arg); + return trait::Acos{}(acos_ctx, arg); } //! Computes the principal value of the arc sine. @@ -575,7 +575,7 @@ namespace alpaka::math ALPAKA_FN_HOST_ACC auto asin(T const& asin_ctx, TArg const& arg) { using ImplementationBase = concepts::ImplementationBase; - return traits::Asin{}(asin_ctx, arg); + return trait::Asin{}(asin_ctx, arg); } //! Computes the principal value of the arc tangent. @@ -588,7 +588,7 @@ namespace alpaka::math ALPAKA_FN_HOST_ACC auto atan(T const& atan_ctx, TArg const& arg) { using ImplementationBase = concepts::ImplementationBase; - return traits::Atan{}(atan_ctx, arg); + return trait::Atan{}(atan_ctx, arg); } //! Computes the arc tangent of y/x using the signs of arguments to determine the correct quadrant. @@ -604,7 +604,7 @@ namespace alpaka::math ALPAKA_FN_HOST_ACC auto atan2(T const& atan2_ctx, Ty const& y, Tx const& x) { using ImplementationBase = concepts::ImplementationBase; - return traits::Atan2{}(atan2_ctx, y, x); + return trait::Atan2{}(atan2_ctx, y, x); } //! Computes the cbrt. @@ -618,7 +618,7 @@ namespace alpaka::math ALPAKA_FN_HOST_ACC auto cbrt(T const& cbrt_ctx, TArg const& arg) { using ImplementationBase = concepts::ImplementationBase; - return traits::Cbrt{}(cbrt_ctx, arg); + return trait::Cbrt{}(cbrt_ctx, arg); } //! Computes the smallest integer value not less than arg. @@ -632,7 +632,7 @@ namespace alpaka::math ALPAKA_FN_HOST_ACC auto ceil(T const& ceil_ctx, TArg const& arg) { using ImplementationBase = concepts::ImplementationBase; - return traits::Ceil{}(ceil_ctx, arg); + return trait::Ceil{}(ceil_ctx, arg); } //! Computes the cosine (measured in radians). @@ -646,7 +646,7 @@ namespace alpaka::math ALPAKA_FN_HOST_ACC auto cos(T const& cos_ctx, TArg const& arg) { using ImplementationBase = concepts::ImplementationBase; - return traits::Cos{}(cos_ctx, arg); + return trait::Cos{}(cos_ctx, arg); } //! Computes the error function of arg. @@ -660,7 +660,7 @@ namespace alpaka::math ALPAKA_FN_HOST_ACC auto erf(T const& erf_ctx, TArg const& arg) { using ImplementationBase = concepts::ImplementationBase; - return traits::Erf{}(erf_ctx, arg); + return trait::Erf{}(erf_ctx, arg); } //! Computes the e (Euler's number, 2.7182818) raised to the given power arg. @@ -674,7 +674,7 @@ namespace alpaka::math ALPAKA_FN_HOST_ACC auto exp(T const& exp_ctx, TArg const& arg) { using ImplementationBase = concepts::ImplementationBase; - return traits::Exp{}(exp_ctx, arg); + return trait::Exp{}(exp_ctx, arg); } //! Computes the largest integer value not greater than arg. @@ -688,7 +688,7 @@ namespace alpaka::math ALPAKA_FN_HOST_ACC auto floor(T const& floor_ctx, TArg const& arg) { using ImplementationBase = concepts::ImplementationBase; - return traits::Floor{}(floor_ctx, arg); + return trait::Floor{}(floor_ctx, arg); } //! Computes the floating-point remainder of the division operation x/y. @@ -704,7 +704,7 @@ namespace alpaka::math ALPAKA_FN_HOST_ACC auto fmod(T const& fmod_ctx, Tx const& x, Ty const& y) { using ImplementationBase = concepts::ImplementationBase; - return traits::Fmod{}(fmod_ctx, x, y); + return trait::Fmod{}(fmod_ctx, x, y); } //! Checks if given value is finite. @@ -718,7 +718,7 @@ namespace alpaka::math ALPAKA_FN_HOST_ACC auto isfinite(T const& ctx, TArg const& arg) { using ImplementationBase = concepts::ImplementationBase; - return traits::Isfinite{}(ctx, arg); + return trait::Isfinite{}(ctx, arg); } //! Checks if given value is inf. @@ -732,7 +732,7 @@ namespace alpaka::math ALPAKA_FN_HOST_ACC auto isinf(T const& ctx, TArg const& arg) { using ImplementationBase = concepts::ImplementationBase; - return traits::Isinf{}(ctx, arg); + return trait::Isinf{}(ctx, arg); } //! Checks if given value is NaN. @@ -746,7 +746,7 @@ namespace alpaka::math ALPAKA_FN_HOST_ACC auto isnan(T const& ctx, TArg const& arg) { using ImplementationBase = concepts::ImplementationBase; - return traits::Isnan{}(ctx, arg); + return trait::Isnan{}(ctx, arg); } //! Computes the the natural (base e) logarithm of arg. @@ -764,7 +764,7 @@ namespace alpaka::math ALPAKA_FN_HOST_ACC auto log(T const& log_ctx, TArg const& arg) { using ImplementationBase = concepts::ImplementationBase; - return traits::Log{}(log_ctx, arg); + return trait::Log{}(log_ctx, arg); } //! Returns the larger of two arguments. @@ -781,7 +781,7 @@ namespace alpaka::math ALPAKA_FN_HOST_ACC auto max(T const& max_ctx, Tx const& x, Ty const& y) { using ImplementationBase = concepts::ImplementationBase; - return traits::Max{}(max_ctx, x, y); + return trait::Max{}(max_ctx, x, y); } //! Returns the smaller of two arguments. @@ -798,7 +798,7 @@ namespace alpaka::math ALPAKA_FN_HOST_ACC auto min(T const& min_ctx, Tx const& x, Ty const& y) { using ImplementationBase = concepts::ImplementationBase; - return traits::Min{}(min_ctx, x, y); + return trait::Min{}(min_ctx, x, y); } //! Computes the value of base raised to the power exp. @@ -818,7 +818,7 @@ namespace alpaka::math ALPAKA_FN_HOST_ACC auto pow(T const& pow_ctx, TBase const& base, TExp const& exp) { using ImplementationBase = concepts::ImplementationBase; - return traits::Pow{}(pow_ctx, base, exp); + return trait::Pow{}(pow_ctx, base, exp); } //! Computes the IEEE remainder of the floating point division operation x/y. @@ -834,7 +834,7 @@ namespace alpaka::math ALPAKA_FN_HOST_ACC auto remainder(T const& remainder_ctx, Tx const& x, Ty const& y) { using ImplementationBase = concepts::ImplementationBase; - return traits::Remainder{}(remainder_ctx, x, y); + return trait::Remainder{}(remainder_ctx, x, y); } //! Computes the nearest integer value to arg (in floating-point format), rounding halfway cases away from @@ -849,7 +849,7 @@ namespace alpaka::math ALPAKA_FN_HOST_ACC auto round(T const& round_ctx, TArg const& arg) { using ImplementationBase = concepts::ImplementationBase; - return traits::Round{}(round_ctx, arg); + return trait::Round{}(round_ctx, arg); } //! Computes the nearest integer value to arg (in integer format), rounding halfway cases away from zero, //! regardless of the current rounding mode. @@ -863,7 +863,7 @@ namespace alpaka::math ALPAKA_FN_HOST_ACC auto lround(T const& lround_ctx, TArg const& arg) -> long int { using ImplementationBase = concepts::ImplementationBase; - return traits::Lround{}(lround_ctx, arg); + return trait::Lround{}(lround_ctx, arg); } //! Computes the nearest integer value to arg (in integer format), rounding halfway cases away from zero, //! regardless of the current rounding mode. @@ -877,7 +877,7 @@ namespace alpaka::math ALPAKA_FN_HOST_ACC auto llround(T const& llround_ctx, TArg const& arg) -> long long int { using ImplementationBase = concepts::ImplementationBase; - return traits::Llround{}(llround_ctx, arg); + return trait::Llround{}(llround_ctx, arg); } //! Computes the rsqrt. @@ -895,7 +895,7 @@ namespace alpaka::math ALPAKA_FN_HOST_ACC auto rsqrt(T const& rsqrt_ctx, TArg const& arg) { using ImplementationBase = concepts::ImplementationBase; - return traits::Rsqrt{}(rsqrt_ctx, arg); + return trait::Rsqrt{}(rsqrt_ctx, arg); } //! Computes the sine (measured in radians). @@ -909,7 +909,7 @@ namespace alpaka::math ALPAKA_FN_HOST_ACC auto sin(T const& sin_ctx, TArg const& arg) { using ImplementationBase = concepts::ImplementationBase; - return traits::Sin{}(sin_ctx, arg); + return trait::Sin{}(sin_ctx, arg); } //! Computes the sine and cosine (measured in radians). @@ -925,7 +925,7 @@ namespace alpaka::math ALPAKA_FN_HOST_ACC auto sincos(T const& sincos_ctx, TArg const& arg, TArg& result_sin, TArg& result_cos) -> void { using ImplementationBase = concepts::ImplementationBase; - traits::SinCos{}(sincos_ctx, arg, result_sin, result_cos); + trait::SinCos{}(sincos_ctx, arg, result_sin, result_cos); } @@ -944,7 +944,7 @@ namespace alpaka::math ALPAKA_FN_HOST_ACC auto sqrt(T const& sqrt_ctx, TArg const& arg) { using ImplementationBase = concepts::ImplementationBase; - return traits::Sqrt{}(sqrt_ctx, arg); + return trait::Sqrt{}(sqrt_ctx, arg); } //! Computes the tangent (measured in radians). @@ -958,7 +958,7 @@ namespace alpaka::math ALPAKA_FN_HOST_ACC auto tan(T const& tan_ctx, TArg const& arg) { using ImplementationBase = concepts::ImplementationBase; - return traits::Tan{}(tan_ctx, arg); + return trait::Tan{}(tan_ctx, arg); } //! Computes the nearest integer not greater in magnitude than arg. @@ -972,6 +972,6 @@ namespace alpaka::math ALPAKA_FN_HOST_ACC auto trunc(T const& trunc_ctx, TArg const& arg) { using ImplementationBase = concepts::ImplementationBase; - return traits::Trunc{}(trunc_ctx, arg); + return trait::Trunc{}(trunc_ctx, arg); } } // namespace alpaka::math diff --git a/include/alpaka/mem/alloc/AllocCpuAligned.hpp b/include/alpaka/mem/alloc/AllocCpuAligned.hpp index 12a1bb5b8ead..3154a7699454 100644 --- a/include/alpaka/mem/alloc/AllocCpuAligned.hpp +++ b/include/alpaka/mem/alloc/AllocCpuAligned.hpp @@ -26,7 +26,7 @@ namespace alpaka { }; - namespace traits + namespace trait { //! The CPU boost aligned allocator memory allocation trait specialization. template @@ -64,5 +64,5 @@ namespace alpaka core::alignedFree(const_cast(reinterpret_cast(ptr))); } }; - } // namespace traits + } // namespace trait } // namespace alpaka diff --git a/include/alpaka/mem/alloc/AllocCpuNew.hpp b/include/alpaka/mem/alloc/AllocCpuNew.hpp index 803a940168cb..cc840c168252 100644 --- a/include/alpaka/mem/alloc/AllocCpuNew.hpp +++ b/include/alpaka/mem/alloc/AllocCpuNew.hpp @@ -19,7 +19,7 @@ namespace alpaka { }; - namespace traits + namespace trait { //! The CPU new allocator memory allocation trait specialization. template @@ -40,5 +40,5 @@ namespace alpaka return delete[] ptr; } }; - } // namespace traits + } // namespace trait } // namespace alpaka diff --git a/include/alpaka/mem/alloc/Traits.hpp b/include/alpaka/mem/alloc/Traits.hpp index 0894860c3aad..dfd8f78571d3 100644 --- a/include/alpaka/mem/alloc/Traits.hpp +++ b/include/alpaka/mem/alloc/Traits.hpp @@ -1,4 +1,4 @@ -/* Copyright 2020 Benjamin Worpitz, Matthias Werner, Bernhard Manfred Gruber +/* Copyright 2022 Benjamin Worpitz, Matthias Werner, Bernhard Manfred Gruber * * This file is part of alpaka. * @@ -22,7 +22,7 @@ namespace alpaka }; //! The allocator traits. - namespace traits + namespace trait { //! The memory allocation trait. template @@ -31,14 +31,14 @@ namespace alpaka //! The memory free trait. template struct Free; - } // namespace traits + } // namespace trait //! \return The pointer to the allocated memory. template ALPAKA_FN_HOST auto malloc(TAlloc const& alloc, std::size_t const& sizeElems) -> T* { using ImplementationBase = concepts::ImplementationBase; - return traits::Malloc::malloc(alloc, sizeElems); + return trait::Malloc::malloc(alloc, sizeElems); } //! Frees the memory identified by the given pointer. @@ -46,6 +46,6 @@ namespace alpaka ALPAKA_FN_HOST auto free(TAlloc const& alloc, T const* const ptr) -> void { using ImplementationBase = concepts::ImplementationBase; - traits::Free::free(alloc, ptr); + trait::Free::free(alloc, ptr); } } // namespace alpaka diff --git a/include/alpaka/mem/buf/BufCpu.hpp b/include/alpaka/mem/buf/BufCpu.hpp index 4854bfcca62c..7ff9a30fea76 100644 --- a/include/alpaka/mem/buf/BufCpu.hpp +++ b/include/alpaka/mem/buf/BufCpu.hpp @@ -123,7 +123,7 @@ namespace alpaka std::shared_ptr> m_spBufCpuImpl; }; - namespace traits + namespace trait { //! The BufCpu device type trait specialization. template @@ -420,7 +420,7 @@ namespace alpaka { using type = TIdx; }; - } // namespace traits + } // namespace trait } // namespace alpaka #include diff --git a/include/alpaka/mem/buf/BufGenericSycl.hpp b/include/alpaka/mem/buf/BufGenericSycl.hpp index ecc4811926b0..772f5fa3053d 100644 --- a/include/alpaka/mem/buf/BufGenericSycl.hpp +++ b/include/alpaka/mem/buf/BufGenericSycl.hpp @@ -64,7 +64,7 @@ namespace alpaka::experimental }; } // namespace alpaka::experimental -namespace alpaka::traits +namespace alpaka::trait { //! The BufGenericSycl device type trait specialization. template @@ -333,7 +333,7 @@ namespace alpaka::traits return nullptr; } }; -} // namespace alpaka::traits +} // namespace alpaka::trait # include # include diff --git a/include/alpaka/mem/buf/BufOacc.hpp b/include/alpaka/mem/buf/BufOacc.hpp index b223bca176e0..7373368dcc6b 100644 --- a/include/alpaka/mem/buf/BufOacc.hpp +++ b/include/alpaka/mem/buf/BufOacc.hpp @@ -111,7 +111,7 @@ namespace alpaka std::shared_ptr> m_spBufImpl; }; - namespace traits + namespace trait { //! The BufOacc device type trait specialization. template @@ -385,7 +385,7 @@ namespace alpaka throw std::runtime_error("Mapping host memory to OpenACC device not implemented!"); } }; - } // namespace traits + } // namespace trait } // namespace alpaka # include diff --git a/include/alpaka/mem/buf/BufOmp5.hpp b/include/alpaka/mem/buf/BufOmp5.hpp index 9ad32e21a4b8..685f487e6e43 100644 --- a/include/alpaka/mem/buf/BufOmp5.hpp +++ b/include/alpaka/mem/buf/BufOmp5.hpp @@ -1,5 +1,4 @@ -/* Copyright 2022 Alexander Matthes, Benjamin Worpitz, Matthias Werner, René Widera, Bernhard Manfred Gruber, Antonio - * Di Pilato +/* Copyright 2022 Alexander Matthes, Benjamin Worpitz, Matthias Werner, René Widera, Bernhard Manfred Gruber * * This file is part of Alpaka. * @@ -110,7 +109,7 @@ namespace alpaka std::shared_ptr> m_spBufImpl; }; - namespace traits + namespace trait { //! The BufOmp5 device type trait specialization. template @@ -383,7 +382,7 @@ namespace alpaka throw std::runtime_error("Mapping host memory to OMP5 device not implemented!"); } }; - } // namespace traits + } // namespace trait } // namespace alpaka # include diff --git a/include/alpaka/mem/buf/BufUniformCudaHipRt.hpp b/include/alpaka/mem/buf/BufUniformCudaHipRt.hpp index 85c825ff3f90..ddc92fd5d4e2 100644 --- a/include/alpaka/mem/buf/BufUniformCudaHipRt.hpp +++ b/include/alpaka/mem/buf/BufUniformCudaHipRt.hpp @@ -81,7 +81,7 @@ namespace alpaka TIdx m_pitchBytes; }; - namespace traits + namespace trait { //! The BufUniformCudaHipRt device type trait specialization. template @@ -465,7 +465,7 @@ namespace alpaka return pDev; } }; - } // namespace traits + } // namespace trait } // namespace alpaka # include diff --git a/include/alpaka/mem/buf/SetKernel.hpp b/include/alpaka/mem/buf/SetKernel.hpp index 60fcb51d7936..5abe4c50f0cd 100644 --- a/include/alpaka/mem/buf/SetKernel.hpp +++ b/include/alpaka/mem/buf/SetKernel.hpp @@ -1,4 +1,4 @@ -/* Copyright 2020 Jeffrey Kelling, Bernhard Manfred Gruber +/* Copyright 2022 Jeffrey Kelling, Bernhard Manfred Gruber * * This file is part of Alpaka. * @@ -40,7 +40,7 @@ namespace alpaka TExtent extent, TPitch pitch) const -> void { - using Idx = typename alpaka::traits::IdxType::type; + using Idx = typename alpaka::trait::IdxType::type; auto const gridThreadIdx(alpaka::getIdx(acc)); auto const threadElemExtent(alpaka::getWorkDiv(acc)); auto const idxThreadFirstElem = getIdxThreadFirstElem(acc, gridThreadIdx, threadElemExtent); diff --git a/include/alpaka/mem/buf/Traits.hpp b/include/alpaka/mem/buf/Traits.hpp index 0ff20b5e863d..6b6f6dc7fa54 100644 --- a/include/alpaka/mem/buf/Traits.hpp +++ b/include/alpaka/mem/buf/Traits.hpp @@ -1,4 +1,4 @@ -/* Copyright 2021 Alexander Matthes, Benjamin Worpitz, Andrea Bocci, Bernhard Manfred Gruber +/* Copyright 2022 Alexander Matthes, Benjamin Worpitz, Andrea Bocci, Bernhard Manfred Gruber * * This file is part of alpaka. * @@ -15,7 +15,7 @@ namespace alpaka { //! The buffer traits. - namespace traits + namespace trait { //! The memory buffer type trait. template @@ -58,11 +58,11 @@ namespace alpaka //! The memory prepareForAsyncCopy trait. template struct PrepareForAsyncCopy; - } // namespace traits + } // namespace trait //! The memory buffer type trait alias template to remove the ::type. template - using Buf = typename traits::BufType, TElem, TDim, TIdx>::type; + using Buf = typename trait::BufType, TElem, TDim, TIdx>::type; //! Allocates memory on the given device. //! @@ -76,7 +76,7 @@ namespace alpaka template ALPAKA_FN_HOST auto allocBuf(TDev const& dev, TExtent const& extent = TExtent()) { - return traits::BufAlloc, TIdx, TDev>::allocBuf(dev, extent); + return trait::BufAlloc, TIdx, TDev>::allocBuf(dev, extent); } //! Allocates stream-ordered memory on the given device. @@ -91,7 +91,7 @@ namespace alpaka template ALPAKA_FN_HOST auto allocAsyncBuf(TQueue queue, TExtent const& extent = TExtent()) { - return traits::AsyncBufAlloc, TIdx, alpaka::Dev>::allocAsyncBuf(queue, extent); + return trait::AsyncBufAlloc, TIdx, alpaka::Dev>::allocAsyncBuf(queue, extent); } //! Check if the given device can allocate a stream-ordered memory buffer of the given dimensionality. @@ -105,7 +105,7 @@ namespace alpaka # pragma clang diagnostic ignored "-Wmissing-variable-declarations" #endif template - constexpr inline bool hasAsyncBufSupport = traits::HasAsyncBufSupport::value; + constexpr inline bool hasAsyncBufSupport = trait::HasAsyncBufSupport::value; #if BOOST_COMP_CLANG # pragma clang diagnostic pop #endif @@ -119,7 +119,7 @@ namespace alpaka template ALPAKA_FN_HOST auto map(TBuf& buf, TDev const& dev) -> void { - return traits::Map::map(buf, dev); + return trait::Map::map(buf, dev); } //! Unmaps the buffer from the memory of the given device. @@ -131,7 +131,7 @@ namespace alpaka template ALPAKA_FN_HOST auto unmap(TBuf& buf, TDev const& dev) -> void { - return traits::Unmap::unmap(buf, dev); + return trait::Unmap::unmap(buf, dev); } //! Pins the buffer. @@ -141,7 +141,7 @@ namespace alpaka template ALPAKA_FN_HOST auto pin(TBuf& buf) -> void { - return traits::Pin::pin(buf); + return trait::Pin::pin(buf); } //! Unpins the buffer. @@ -151,7 +151,7 @@ namespace alpaka template ALPAKA_FN_HOST auto unpin(TBuf& buf) -> void { - return traits::Unpin::unpin(buf); + return trait::Unpin::unpin(buf); } //! The pin state of the buffer. @@ -161,7 +161,7 @@ namespace alpaka template ALPAKA_FN_HOST auto isPinned(TBuf const& buf) -> bool { - return traits::IsPinned::isPinned(buf); + return trait::IsPinned::isPinned(buf); } //! Prepares the buffer for non-blocking copy operations, e.g. pinning if @@ -172,6 +172,6 @@ namespace alpaka template ALPAKA_FN_HOST auto prepareForAsyncCopy(TBuf& buf) -> void { - return traits::PrepareForAsyncCopy::prepareForAsyncCopy(buf); + return trait::PrepareForAsyncCopy::prepareForAsyncCopy(buf); } } // namespace alpaka diff --git a/include/alpaka/mem/buf/cpu/Copy.hpp b/include/alpaka/mem/buf/cpu/Copy.hpp index 5e79cd090145..b01ee56dc262 100644 --- a/include/alpaka/mem/buf/cpu/Copy.hpp +++ b/include/alpaka/mem/buf/cpu/Copy.hpp @@ -250,7 +250,7 @@ namespace alpaka }; } // namespace detail - namespace traits + namespace trait { //! The CPU device memory copy trait specialization. //! @@ -267,5 +267,5 @@ namespace alpaka return alpaka::detail::TaskCopyCpu(viewDst, viewSrc, extent); } }; - } // namespace traits + } // namespace trait } // namespace alpaka diff --git a/include/alpaka/mem/buf/cpu/Set.hpp b/include/alpaka/mem/buf/cpu/Set.hpp index 745eb4edb5eb..38a431f30461 100644 --- a/include/alpaka/mem/buf/cpu/Set.hpp +++ b/include/alpaka/mem/buf/cpu/Set.hpp @@ -197,7 +197,7 @@ namespace alpaka }; } // namespace detail - namespace traits + namespace trait { //! The CPU device memory set trait specialization. template @@ -210,5 +210,5 @@ namespace alpaka return alpaka::detail::TaskSetCpu(view, byte, extent); } }; - } // namespace traits + } // namespace trait } // namespace alpaka diff --git a/include/alpaka/mem/buf/oacc/Copy.hpp b/include/alpaka/mem/buf/oacc/Copy.hpp index d2ccd9592817..106984fc2759 100644 --- a/include/alpaka/mem/buf/oacc/Copy.hpp +++ b/include/alpaka/mem/buf/oacc/Copy.hpp @@ -278,7 +278,7 @@ namespace alpaka } // namespace oacc // Trait specializations for CreateTaskCopy. - namespace traits + namespace trait { //! The CPU to OpenACC memory copy trait specialization. template @@ -371,7 +371,7 @@ namespace alpaka } } }; - } // namespace traits + } // namespace trait } // namespace alpaka #endif diff --git a/include/alpaka/mem/buf/oacc/Set.hpp b/include/alpaka/mem/buf/oacc/Set.hpp index cdb970b00c49..97b3bf196e35 100644 --- a/include/alpaka/mem/buf/oacc/Set.hpp +++ b/include/alpaka/mem/buf/oacc/Set.hpp @@ -38,7 +38,7 @@ namespace alpaka namespace alpaka { - namespace traits + namespace trait { //! The OpenACC device memory set trait specialization. template @@ -47,7 +47,7 @@ namespace alpaka template ALPAKA_FN_HOST static auto createTaskMemset(TView& view, std::uint8_t const& byte, TExtent const& extent) { - using Idx = typename traits::IdxType::type; + using Idx = typename trait::IdxType::type; auto pitch = getPitchBytesVec(view); auto byteExtent = getExtentVec(extent); byteExtent[TDim::value - 1] *= static_cast(sizeof(Elem)); @@ -98,7 +98,7 @@ namespace alpaka std::uint8_t const& byte, TExtent const& /* extent */) { - using Idx = typename traits::IdxType::type; + using Idx = typename trait::IdxType::type; using Dim1D = DimInt<1u>; using Vec1D = Vec; @@ -114,7 +114,7 @@ namespace alpaka Vec1D::zeros()); } }; - } // namespace traits + } // namespace trait } // namespace alpaka #endif diff --git a/include/alpaka/mem/buf/omp5/Copy.hpp b/include/alpaka/mem/buf/omp5/Copy.hpp index 07ea1fec7557..ee82355fd86c 100644 --- a/include/alpaka/mem/buf/omp5/Copy.hpp +++ b/include/alpaka/mem/buf/omp5/Copy.hpp @@ -294,7 +294,7 @@ namespace alpaka } // namespace detail // Trait specializations for CreateTaskMemcpy. - namespace traits + namespace trait { namespace detail { @@ -384,7 +384,7 @@ namespace alpaka getDev(viewSrc).getNativeHandle()); } }; - } // namespace traits + } // namespace trait } // namespace alpaka #endif diff --git a/include/alpaka/mem/buf/omp5/Set.hpp b/include/alpaka/mem/buf/omp5/Set.hpp index a8225962cbe0..1a3942b7ea4e 100644 --- a/include/alpaka/mem/buf/omp5/Set.hpp +++ b/include/alpaka/mem/buf/omp5/Set.hpp @@ -35,7 +35,7 @@ namespace alpaka { class DevOmp5; - namespace traits + namespace trait { //! The OMP5 device memory set trait specialization. template @@ -44,7 +44,7 @@ namespace alpaka template ALPAKA_FN_HOST static auto createTaskMemset(TView& view, std::uint8_t const& byte, TExtent const& extent) { - using Idx = typename alpaka::traits::IdxType::type; + using Idx = typename alpaka::trait::IdxType::type; auto pitch = getPitchBytesVec(view); auto byteExtent = getExtentVec(extent); constexpr auto lastDim = TDim::value - 1; @@ -96,7 +96,7 @@ namespace alpaka std::uint8_t const& byte, TExtent const& /* extent */) { - using Idx = typename alpaka::traits::IdxType::type; + using Idx = typename alpaka::trait::IdxType::type; using Dim1D = DimInt<1u>; using Vec1D = Vec; @@ -112,7 +112,7 @@ namespace alpaka Vec1D::zeros()); } }; - } // namespace traits + } // namespace trait } // namespace alpaka #endif diff --git a/include/alpaka/mem/buf/sycl/Accessor.hpp b/include/alpaka/mem/buf/sycl/Accessor.hpp index 4c383191acad..3014b41ab719 100644 --- a/include/alpaka/mem/buf/sycl/Accessor.hpp +++ b/include/alpaka/mem/buf/sycl/Accessor.hpp @@ -116,7 +116,7 @@ namespace alpaka::experimental VecType extents; }; - namespace traits + namespace trait { namespace internal { @@ -138,7 +138,7 @@ namespace alpaka::experimental buffer.m_extentElements}; } }; - } // namespace traits + } // namespace trait } // namespace alpaka::experimental #endif diff --git a/include/alpaka/mem/buf/sycl/Copy.hpp b/include/alpaka/mem/buf/sycl/Copy.hpp index d6d95ef23e4d..27b4e85bc39f 100644 --- a/include/alpaka/mem/buf/sycl/Copy.hpp +++ b/include/alpaka/mem/buf/sycl/Copy.hpp @@ -69,7 +69,7 @@ namespace alpaka::experimental::detail } // namespace alpaka::experimental::detail // Trait specializations for CreateTaskMemcpy. -namespace alpaka::traits +namespace alpaka::trait { //! The SYCL host-to-device memory copy trait specialization. template @@ -186,6 +186,6 @@ namespace alpaka::traits DstType{viewDst.m_buffer, range, offset_dst}}; } }; -} // namespace alpaka::traits +} // namespace alpaka::trait #endif diff --git a/include/alpaka/mem/buf/sycl/Set.hpp b/include/alpaka/mem/buf/sycl/Set.hpp index 433db0c8fba5..21cbc9ebfa2e 100644 --- a/include/alpaka/mem/buf/sycl/Set.hpp +++ b/include/alpaka/mem/buf/sycl/Set.hpp @@ -59,7 +59,7 @@ namespace alpaka } // namespace detail } // namespace experimental - namespace traits + namespace trait { //! The SYCL device memory set trait specialization. template @@ -82,7 +82,7 @@ namespace alpaka return experimental::detail::TaskSetSycl{DstType{buf, range}, byte_val}; } }; - } // namespace traits + } // namespace trait } // namespace alpaka #endif diff --git a/include/alpaka/mem/buf/uniformCudaHip/Copy.hpp b/include/alpaka/mem/buf/uniformCudaHip/Copy.hpp index c95cd9c7ce19..b8d3d4f1f119 100644 --- a/include/alpaka/mem/buf/uniformCudaHip/Copy.hpp +++ b/include/alpaka/mem/buf/uniformCudaHip/Copy.hpp @@ -495,7 +495,7 @@ namespace alpaka } // namespace detail // Trait specializations for CreateTaskMemcpy. - namespace traits + namespace trait { //! The CUDA/HIP to CPU memory copy trait specialization. template @@ -702,7 +702,7 @@ namespace alpaka ALPAKA_UNIFORM_CUDA_HIP_RT_CHECK(ALPAKA_API_PREFIX(StreamSynchronize)(queue.getNativeHandle())); } }; - } // namespace traits + } // namespace trait } // namespace alpaka #endif diff --git a/include/alpaka/mem/buf/uniformCudaHip/Set.hpp b/include/alpaka/mem/buf/uniformCudaHip/Set.hpp index ff22f7e1d55a..d6d73a6502df 100644 --- a/include/alpaka/mem/buf/uniformCudaHip/Set.hpp +++ b/include/alpaka/mem/buf/uniformCudaHip/Set.hpp @@ -269,7 +269,7 @@ namespace alpaka }; } // namespace detail - namespace traits + namespace trait { //! The CUDA device memory set trait specialization. template @@ -411,7 +411,7 @@ namespace alpaka wait(queue); } }; - } // namespace traits + } // namespace trait } // namespace alpaka #endif diff --git a/include/alpaka/mem/fence/MemFenceCpu.hpp b/include/alpaka/mem/fence/MemFenceCpu.hpp index e6be01015e14..09ff95f4d3f2 100644 --- a/include/alpaka/mem/fence/MemFenceCpu.hpp +++ b/include/alpaka/mem/fence/MemFenceCpu.hpp @@ -1,4 +1,4 @@ -/* Copyright 2021 Jan Stephan, Bernhard Manfred Gruber +/* Copyright 2022 Jan Stephan, Bernhard Manfred Gruber * * This file is part of alpaka. * @@ -21,7 +21,7 @@ namespace alpaka { }; - namespace traits + namespace trait { template struct MemFence @@ -68,5 +68,5 @@ namespace alpaka dummy.store(x, std::memory_order_relaxed); } }; - } // namespace traits + } // namespace trait } // namespace alpaka diff --git a/include/alpaka/mem/fence/MemFenceCpuSerial.hpp b/include/alpaka/mem/fence/MemFenceCpuSerial.hpp index fd63e8a263e1..ceb57543d80e 100644 --- a/include/alpaka/mem/fence/MemFenceCpuSerial.hpp +++ b/include/alpaka/mem/fence/MemFenceCpuSerial.hpp @@ -21,7 +21,7 @@ namespace alpaka { }; - namespace traits + namespace trait { template<> struct MemFence @@ -57,5 +57,5 @@ namespace alpaka dummy.store(x, std::memory_order_relaxed); } }; - } // namespace traits + } // namespace trait } // namespace alpaka diff --git a/include/alpaka/mem/fence/MemFenceGenericSycl.hpp b/include/alpaka/mem/fence/MemFenceGenericSycl.hpp index 82db94063f90..f2e6a97f4965 100644 --- a/include/alpaka/mem/fence/MemFenceGenericSycl.hpp +++ b/include/alpaka/mem/fence/MemFenceGenericSycl.hpp @@ -56,7 +56,7 @@ namespace alpaka::experimental }; } // namespace alpaka::experimental -namespace alpaka::traits +namespace alpaka::trait { template struct MemFence @@ -77,6 +77,6 @@ namespace alpaka::traits dummy.store(dummy_val); } }; -} // namespace alpaka::traits +} // namespace alpaka::trait #endif diff --git a/include/alpaka/mem/fence/MemFenceOacc.hpp b/include/alpaka/mem/fence/MemFenceOacc.hpp index 2c961cd05c09..b06bb5302afc 100644 --- a/include/alpaka/mem/fence/MemFenceOacc.hpp +++ b/include/alpaka/mem/fence/MemFenceOacc.hpp @@ -1,4 +1,4 @@ -/* Copyright 2021 Jan Stephan, Bernhard Manfred Gruber +/* Copyright 2022 Jan Stephan, Bernhard Manfred Gruber * * This file is part of alpaka. * @@ -25,7 +25,7 @@ namespace alpaka { }; - namespace traits + namespace trait { template struct MemFence @@ -52,7 +52,7 @@ namespace alpaka static_assert(!sizeof(TMemScope), "Memory fences are not available in the OpenACC back-end"); } }; - } // namespace traits + } // namespace trait } // namespace alpaka #endif diff --git a/include/alpaka/mem/fence/MemFenceOmp2Blocks.hpp b/include/alpaka/mem/fence/MemFenceOmp2Blocks.hpp index 3ebe2be70469..f449e4f505b8 100644 --- a/include/alpaka/mem/fence/MemFenceOmp2Blocks.hpp +++ b/include/alpaka/mem/fence/MemFenceOmp2Blocks.hpp @@ -25,7 +25,7 @@ namespace alpaka { }; - namespace traits + namespace trait { template<> struct MemFence @@ -53,7 +53,7 @@ namespace alpaka # pragma omp flush } }; - } // namespace traits + } // namespace trait } // namespace alpaka #endif diff --git a/include/alpaka/mem/fence/MemFenceOmp2Threads.hpp b/include/alpaka/mem/fence/MemFenceOmp2Threads.hpp index 5ae280ddd1eb..8fb54025f3af 100644 --- a/include/alpaka/mem/fence/MemFenceOmp2Threads.hpp +++ b/include/alpaka/mem/fence/MemFenceOmp2Threads.hpp @@ -1,4 +1,4 @@ -/* Copyright 2021 Jan Stephan, Bernhard Manfred Gruber +/* Copyright 2022 Jan Stephan, Bernhard Manfred Gruber * * This file is part of alpaka. * @@ -25,7 +25,7 @@ namespace alpaka { }; - namespace traits + namespace trait { template struct MemFence @@ -65,6 +65,6 @@ namespace alpaka # pragma omp flush } }; - } // namespace traits + } // namespace trait } // namespace alpaka #endif diff --git a/include/alpaka/mem/fence/MemFenceOmp5.hpp b/include/alpaka/mem/fence/MemFenceOmp5.hpp index 36e728b7f5e3..27ed4b5e2994 100644 --- a/include/alpaka/mem/fence/MemFenceOmp5.hpp +++ b/include/alpaka/mem/fence/MemFenceOmp5.hpp @@ -1,4 +1,4 @@ -/* Copyright 2021 Jan Stephan, Bernhard Manfred Gruber +/* Copyright 2022 Jan Stephan, Bernhard Manfred Gruber * * This file is part of alpaka. * @@ -25,7 +25,7 @@ namespace alpaka { }; - namespace traits + namespace trait { template struct MemFence @@ -36,7 +36,7 @@ namespace alpaka # pragma omp flush acq_rel } }; - } // namespace traits + } // namespace trait } // namespace alpaka #endif diff --git a/include/alpaka/mem/fence/MemFenceUniformCudaHipBuiltIn.hpp b/include/alpaka/mem/fence/MemFenceUniformCudaHipBuiltIn.hpp index 4fefee494b37..bc690d58412e 100644 --- a/include/alpaka/mem/fence/MemFenceUniformCudaHipBuiltIn.hpp +++ b/include/alpaka/mem/fence/MemFenceUniformCudaHipBuiltIn.hpp @@ -32,7 +32,7 @@ namespace alpaka # error If ALPAKA_ACC_GPU_HIP_ENABLED is set, the compiler has to support HIP! # endif - namespace traits + namespace trait { template<> struct MemFence @@ -61,7 +61,7 @@ namespace alpaka __threadfence(); } }; - } // namespace traits + } // namespace trait # endif diff --git a/include/alpaka/mem/fence/Traits.hpp b/include/alpaka/mem/fence/Traits.hpp index b0338ef52498..e2ee8ba79a59 100644 --- a/include/alpaka/mem/fence/Traits.hpp +++ b/include/alpaka/mem/fence/Traits.hpp @@ -36,13 +36,13 @@ namespace alpaka }; } // namespace memory_scope - //! The memory fence traits. - namespace traits + //! The memory fence trait. + namespace trait { //! The mem_fence trait. template struct MemFence; - } // namespace traits + } // namespace trait //! Issues memory fence instructions. // @@ -66,6 +66,6 @@ namespace alpaka ALPAKA_FN_ACC auto mem_fence(TMemFence const& fence, TMemScope const& scope) -> void { using ImplementationBase = concepts::ImplementationBase; - traits::MemFence::mem_fence(fence, scope); + trait::MemFence::mem_fence(fence, scope); } } // namespace alpaka diff --git a/include/alpaka/mem/view/Accessor.hpp b/include/alpaka/mem/view/Accessor.hpp index 2aa8c0bad130..626e95ecc487 100644 --- a/include/alpaka/mem/view/Accessor.hpp +++ b/include/alpaka/mem/view/Accessor.hpp @@ -1,4 +1,4 @@ -/* Copyright 2021 Bernhard Manfred Gruber +/* Copyright 2022 Bernhard Manfred Gruber * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above @@ -51,7 +51,7 @@ namespace alpaka::experimental template struct Accessor; - namespace traits + namespace trait { //! The customization point for how to build an accessor for a given memory object. template @@ -65,7 +65,7 @@ namespace alpaka::experimental "BuildAccessor is not specialized for your TMemoryObject."); } }; - } // namespace traits + } // namespace trait namespace internal { @@ -106,7 +106,7 @@ namespace alpaka::experimental typename = std::enable_if_t>::value>> ALPAKA_FN_HOST_ACC auto accessWith(TMemoryObject&& memoryObject) { - return traits::BuildAccessor>::template buildAccessor( + return trait::BuildAccessor>::template buildAccessor( memoryObject); } diff --git a/include/alpaka/mem/view/Traits.hpp b/include/alpaka/mem/view/Traits.hpp index 6caa8d47c869..538d5391a355 100644 --- a/include/alpaka/mem/view/Traits.hpp +++ b/include/alpaka/mem/view/Traits.hpp @@ -28,7 +28,7 @@ namespace alpaka { //! The view traits. - namespace traits + namespace trait { //! The native pointer get trait. template @@ -91,7 +91,7 @@ namespace alpaka //! The sub view creation trait. template struct CreateSubView; - } // namespace traits + } // namespace trait //! Gets the native pointer of the memory view. //! @@ -100,7 +100,7 @@ namespace alpaka template ALPAKA_FN_HOST auto getPtrNative(TView const& view) -> Elem const* { - return traits::GetPtrNative::getPtrNative(view); + return trait::GetPtrNative::getPtrNative(view); } //! Gets the native pointer of the memory view. @@ -110,7 +110,7 @@ namespace alpaka template ALPAKA_FN_HOST auto getPtrNative(TView& view) -> Elem* { - return traits::GetPtrNative::getPtrNative(view); + return trait::GetPtrNative::getPtrNative(view); } //! Gets the pointer to the view on the given device. @@ -121,7 +121,7 @@ namespace alpaka template ALPAKA_FN_HOST auto getPtrDev(TView const& view, TDev const& dev) -> Elem const* { - return traits::GetPtrDev::getPtrDev(view, dev); + return trait::GetPtrDev::getPtrDev(view, dev); } //! Gets the pointer to the view on the given device. @@ -132,7 +132,7 @@ namespace alpaka template ALPAKA_FN_HOST auto getPtrDev(TView& view, TDev const& dev) -> Elem* { - return traits::GetPtrDev::getPtrDev(view, dev); + return trait::GetPtrDev::getPtrDev(view, dev); } //! \return The pitch in bytes. This is the distance in bytes between two consecutive elements in the given @@ -141,7 +141,7 @@ namespace alpaka template ALPAKA_FN_HOST_ACC auto getPitchBytes(TView const& view) -> Idx { - return traits::GetPitchBytes, TView>::getPitchBytes(view); + return trait::GetPitchBytes, TView>::getPitchBytes(view); } //! Create a memory set task. @@ -156,7 +156,7 @@ namespace alpaka Dim::value == Dim::value, "The view and the extent are required to have the same dimensionality!"); - return traits::CreateTaskMemset, Dev>::createTaskMemset(view, byte, extent); + return trait::CreateTaskMemset, Dev>::createTaskMemset(view, byte, extent); } //! Sets the memory to the given value. @@ -200,7 +200,7 @@ namespace alpaka std::is_same_v, std::remove_const_t>>, "The source and the destination view are required to have the same element type!"); - return traits::CreateTaskMemcpy, Dev, Dev>::createTaskMemcpy( + return trait::CreateTaskMemcpy, Dev, Dev>::createTaskMemcpy( viewDst, viewSrc, extent); @@ -377,7 +377,7 @@ namespace alpaka template auto createStaticDevMemView(TElem* pMem, TDev const& dev, TExtent const& extent) { - return traits::CreateStaticDevMemView::createStaticDevMemView(pMem, dev, extent); + return trait::CreateStaticDevMemView::createStaticDevMemView(pMem, dev, extent); } //! Creates a view to a device pointer @@ -394,7 +394,7 @@ namespace alpaka using Dim = alpaka::Dim; using Idx = alpaka::Idx; auto const extentVec = Vec(extent); - return traits::CreateViewPlainPtr::createViewPlainPtr( + return trait::CreateViewPlainPtr::createViewPlainPtr( dev, pMem, extentVec, @@ -413,7 +413,7 @@ namespace alpaka template auto createView(TDev const& dev, TElem* pMem, TExtent const& extent, TPitch const& pitch) { - return traits::CreateViewPlainPtr::createViewPlainPtr(dev, pMem, extent, pitch); + return trait::CreateViewPlainPtr::createViewPlainPtr(dev, pMem, extent, pitch); } //! Creates a view to a contiguous container of device-accessible memory. @@ -451,7 +451,7 @@ namespace alpaka template auto createSubView(TView& view, TExtent const& extent, TOffsets const& offset = TExtent()) { - return traits::CreateSubView::type>::createSubView(view, extent, offset); + return trait::CreateSubView::type>::createSubView(view, extent, offset); } } // namespace alpaka diff --git a/include/alpaka/mem/view/ViewAccessOps.hpp b/include/alpaka/mem/view/ViewAccessOps.hpp index 4158e918b055..682bf6a8f361 100644 --- a/include/alpaka/mem/view/ViewAccessOps.hpp +++ b/include/alpaka/mem/view/ViewAccessOps.hpp @@ -37,7 +37,7 @@ namespace alpaka::internal public: ViewAccessOps() { - static_assert(experimental::traits::internal::IsView::value); + static_assert(experimental::trait::internal::IsView::value); } ALPAKA_FN_HOST auto data() -> pointer diff --git a/include/alpaka/mem/view/ViewAccessor.hpp b/include/alpaka/mem/view/ViewAccessor.hpp index 9f1570684e83..8e5f70eededc 100644 --- a/include/alpaka/mem/view/ViewAccessor.hpp +++ b/include/alpaka/mem/view/ViewAccessor.hpp @@ -1,4 +1,4 @@ -/* Copyright 2021 Bernhard Manfred Gruber +/* Copyright 2022 Bernhard Manfred Gruber * Permission to use, copy, modify, and/or distribute this software for any * purpose with or without fee is hereby granted, provided that the above @@ -184,7 +184,7 @@ namespace alpaka::experimental Vec, TBufferIdx> extents; }; - namespace traits + namespace trait { namespace internal { @@ -268,5 +268,5 @@ namespace alpaka::experimental std::make_index_sequence{}); } }; - } // namespace traits + } // namespace trait } // namespace alpaka::experimental diff --git a/include/alpaka/mem/view/ViewPlainPtr.hpp b/include/alpaka/mem/view/ViewPlainPtr.hpp index 107fd161627f..294a7ff7b692 100644 --- a/include/alpaka/mem/view/ViewPlainPtr.hpp +++ b/include/alpaka/mem/view/ViewPlainPtr.hpp @@ -1,4 +1,4 @@ -/* Copyright 2021 Benjamin Worpitz, Matthias Werner, René Widera, Bernhard Manfred Gruber +/* Copyright 2022 Benjamin Worpitz, Matthias Werner, René Widera, Bernhard Manfred Gruber * * This file is part of alpaka. * @@ -71,7 +71,7 @@ namespace alpaka }; // Trait specializations for ViewPlainPtr. - namespace traits + namespace trait { //! The ViewPlainPtr device type trait specialization. template @@ -103,8 +103,8 @@ namespace alpaka { using type = TElem; }; - } // namespace traits - namespace traits + } // namespace trait + namespace trait { //! The ViewPlainPtr width get trait specialization. template @@ -120,9 +120,9 @@ namespace alpaka return extent.m_extentElements[TIdxIntegralConst::value]; } }; - } // namespace traits + } // namespace trait - namespace traits + namespace trait { //! The ViewPlainPtr native pointer get trait specialization. template @@ -304,5 +304,5 @@ namespace alpaka { using type = TIdx; }; - } // namespace traits + } // namespace trait } // namespace alpaka diff --git a/include/alpaka/mem/view/ViewStdArray.hpp b/include/alpaka/mem/view/ViewStdArray.hpp index cab51fbb85d4..956b53198204 100644 --- a/include/alpaka/mem/view/ViewStdArray.hpp +++ b/include/alpaka/mem/view/ViewStdArray.hpp @@ -19,7 +19,7 @@ #include -namespace alpaka::traits +namespace alpaka::trait { //! The std::array device type trait specialization. template @@ -93,4 +93,4 @@ namespace alpaka::traits { using type = std::size_t; }; -} // namespace alpaka::traits +} // namespace alpaka::trait diff --git a/include/alpaka/mem/view/ViewStdVector.hpp b/include/alpaka/mem/view/ViewStdVector.hpp index 3ba87e531805..fc7e3eb50bd8 100644 --- a/include/alpaka/mem/view/ViewStdVector.hpp +++ b/include/alpaka/mem/view/ViewStdVector.hpp @@ -19,7 +19,7 @@ #include -namespace alpaka::traits +namespace alpaka::trait { //! The std::vector device type trait specialization. template @@ -94,4 +94,4 @@ namespace alpaka::traits { using type = std::size_t; }; -} // namespace alpaka::traits +} // namespace alpaka::trait diff --git a/include/alpaka/mem/view/ViewSubView.hpp b/include/alpaka/mem/view/ViewSubView.hpp index 1b41b91ab6ce..03ee6bed360a 100644 --- a/include/alpaka/mem/view/ViewSubView.hpp +++ b/include/alpaka/mem/view/ViewSubView.hpp @@ -1,4 +1,4 @@ -/* Copyright 2020 Benjamin Worpitz, Matthias Werner, Bernhard Manfred Gruber +/* Copyright 2022 Benjamin Worpitz, Matthias Werner, Bernhard Manfred Gruber * * This file is part of alpaka. * @@ -138,7 +138,7 @@ namespace alpaka }; // Trait specializations for ViewSubView. - namespace traits + namespace trait { //! The ViewSubView device type trait specialization. template @@ -277,9 +277,9 @@ namespace alpaka { using Dim = alpaka::Dim; using Idx = alpaka::Idx; - using Elem = typename traits::ElemType::type; + using Elem = typename trait::ElemType::type; return ViewSubView(view, extentElements, relativeOffsetsElements); } }; - } // namespace traits + } // namespace trait } // namespace alpaka diff --git a/include/alpaka/offset/Traits.hpp b/include/alpaka/offset/Traits.hpp index 8f609031e805..b8c0e081558f 100644 --- a/include/alpaka/offset/Traits.hpp +++ b/include/alpaka/offset/Traits.hpp @@ -1,4 +1,4 @@ -/* Copyright 2020 Benjamin Worpitz, Bernhard Manfred Gruber +/* Copyright 2022 Benjamin Worpitz, Bernhard Manfred Gruber * * This file is part of alpaka. * @@ -18,7 +18,7 @@ namespace alpaka { //! The offset traits. - namespace traits + namespace trait { //! The x offset get trait. //! @@ -36,14 +36,14 @@ namespace alpaka //! The x offset set trait. template struct SetOffset; - } // namespace traits + } // namespace trait //! \return The offset in the given dimension. ALPAKA_NO_HOST_ACC_WARNING template ALPAKA_FN_HOST_ACC auto getOffset(TOffsets const& offsets) -> Idx { - return traits::GetOffset, TOffsets>::getOffset(offsets); + return trait::GetOffset, TOffsets>::getOffset(offsets); } //! \return The offset in x dimension. ALPAKA_NO_HOST_ACC_WARNING @@ -72,7 +72,7 @@ namespace alpaka template ALPAKA_FN_HOST_ACC auto setOffset(TOffsets const& offsets, TOffset const& offset) -> void { - traits::SetOffset, TOffsets, TOffset>::setOffset(offsets, offset); + trait::SetOffset, TOffsets, TOffset>::setOffset(offsets, offset); } //! Sets the offset in x dimension. ALPAKA_NO_HOST_ACC_WARNING @@ -97,7 +97,7 @@ namespace alpaka } // Trait specializations for unsigned integral types. - namespace traits + namespace trait { //! The unsigned integral x offset get trait specialization. template @@ -119,5 +119,5 @@ namespace alpaka offsets = offset; } }; - } // namespace traits + } // namespace trait } // namespace alpaka diff --git a/include/alpaka/pltf/PltfCpu.hpp b/include/alpaka/pltf/PltfCpu.hpp index 4489c12f33cf..b7278659e3fc 100644 --- a/include/alpaka/pltf/PltfCpu.hpp +++ b/include/alpaka/pltf/PltfCpu.hpp @@ -1,4 +1,4 @@ -/* Copyright 2020 Benjamin Worpitz, Bernhard Manfred Gruber +/* Copyright 2022 Benjamin Worpitz, Bernhard Manfred Gruber * * This file is part of alpaka. * @@ -25,7 +25,7 @@ namespace alpaka ALPAKA_FN_HOST PltfCpu() = delete; }; - namespace traits + namespace trait { //! The CPU device device type trait specialization. template<> @@ -66,5 +66,5 @@ namespace alpaka return {}; } }; - } // namespace traits + } // namespace trait } // namespace alpaka diff --git a/include/alpaka/pltf/PltfCpuSyclIntel.hpp b/include/alpaka/pltf/PltfCpuSyclIntel.hpp index cbf34824b478..d220ee213537 100644 --- a/include/alpaka/pltf/PltfCpuSyclIntel.hpp +++ b/include/alpaka/pltf/PltfCpuSyclIntel.hpp @@ -54,7 +54,7 @@ namespace alpaka::experimental }; } // namespace alpaka::experimental -namespace alpaka::traits +namespace alpaka::trait { //! The SYCL device manager device type trait specialization. template<> @@ -62,6 +62,6 @@ namespace alpaka::traits { using type = experimental::DevGenericSycl; // = DevCpuSyclIntel }; -} // namespace alpaka::traits +} // namespace alpaka::trait #endif diff --git a/include/alpaka/pltf/PltfFpgaSyclIntel.hpp b/include/alpaka/pltf/PltfFpgaSyclIntel.hpp index 65d788bee451..b2061c559775 100644 --- a/include/alpaka/pltf/PltfFpgaSyclIntel.hpp +++ b/include/alpaka/pltf/PltfFpgaSyclIntel.hpp @@ -36,7 +36,7 @@ namespace alpaka::experimental }; } // namespace alpaka::experimental -namespace alpaka::traits +namespace alpaka::trait { //! The SYCL device manager device type trait specialization. template<> @@ -44,6 +44,6 @@ namespace alpaka::traits { using type = experimental::DevGenericSycl; // = DevFpgaSyclIntel }; -} // namespace alpaka::traits +} // namespace alpaka::trait #endif diff --git a/include/alpaka/pltf/PltfFpgaSyclXilinx.hpp b/include/alpaka/pltf/PltfFpgaSyclXilinx.hpp index 5f8bae64178e..e21ee82aa29c 100644 --- a/include/alpaka/pltf/PltfFpgaSyclXilinx.hpp +++ b/include/alpaka/pltf/PltfFpgaSyclXilinx.hpp @@ -54,7 +54,7 @@ namespace alpaka::experimental }; } // namespace alpaka::experimental -namespace alpaka::traits +namespace alpaka::trait { //! The SYCL device manager device type trait specialization. template<> @@ -62,6 +62,6 @@ namespace alpaka::traits { using type = experimental::DevGenericSycl; // = DevFpgaSyclXilinx }; -} // namespace alpaka::traits +} // namespace alpaka::trait #endif diff --git a/include/alpaka/pltf/PltfGenericSycl.hpp b/include/alpaka/pltf/PltfGenericSycl.hpp index 9d2167bdb071..1a3bed8cf05e 100644 --- a/include/alpaka/pltf/PltfGenericSycl.hpp +++ b/include/alpaka/pltf/PltfGenericSycl.hpp @@ -33,7 +33,7 @@ namespace alpaka::experimental }; } // namespace alpaka::experimental -namespace alpaka::traits +namespace alpaka::trait { //! The SYCL platform device count get trait specialization. template @@ -682,6 +682,6 @@ namespace alpaka::traits } # endif }; -} // namespace alpaka::traits +} // namespace alpaka::trait #endif diff --git a/include/alpaka/pltf/PltfGpuSyclIntel.hpp b/include/alpaka/pltf/PltfGpuSyclIntel.hpp index 9fed08dc46a1..7dd4d9810717 100644 --- a/include/alpaka/pltf/PltfGpuSyclIntel.hpp +++ b/include/alpaka/pltf/PltfGpuSyclIntel.hpp @@ -55,7 +55,7 @@ namespace alpaka::experimental }; } // namespace alpaka::experimental -namespace alpaka::traits +namespace alpaka::trait { //! The SYCL device manager device type trait specialization. template<> @@ -63,6 +63,6 @@ namespace alpaka::traits { using type = experimental::DevGenericSycl; // = DevGpuSyclIntel }; -} // namespace alpaka::traits +} // namespace alpaka::trait #endif diff --git a/include/alpaka/pltf/PltfOacc.hpp b/include/alpaka/pltf/PltfOacc.hpp index 6c533eb5cda9..baa26fb4f3e8 100644 --- a/include/alpaka/pltf/PltfOacc.hpp +++ b/include/alpaka/pltf/PltfOacc.hpp @@ -1,4 +1,4 @@ -/* Copyright 2020 Benjamin Worpitz, Bernhard Manfred Gruber +/* Copyright 2022 Benjamin Worpitz, Bernhard Manfred Gruber * * This file is part of Alpaka. * @@ -31,7 +31,7 @@ namespace alpaka ALPAKA_FN_HOST PltfOacc() = delete; }; - namespace traits + namespace trait { //! The OpenACC platform device count get trait specialization. template<> @@ -44,7 +44,7 @@ namespace alpaka return static_cast(::acc_get_num_devices(::acc_get_device_type())); } }; - } // namespace traits + } // namespace trait } // namespace alpaka #endif diff --git a/include/alpaka/pltf/PltfOmp5.hpp b/include/alpaka/pltf/PltfOmp5.hpp index e83abc1e03d0..b4f813fd676f 100644 --- a/include/alpaka/pltf/PltfOmp5.hpp +++ b/include/alpaka/pltf/PltfOmp5.hpp @@ -1,4 +1,4 @@ -/* Copyright 2020 Benjamin Worpitz, Bernhard Manfred Gruber +/* Copyright 2022 Benjamin Worpitz, Bernhard Manfred Gruber * * This file is part of Alpaka. * @@ -32,7 +32,7 @@ namespace alpaka ALPAKA_FN_HOST PltfOmp5() = delete; }; - namespace traits + namespace trait { //! The OpenMP 5 device device type trait specialization. template<> @@ -83,7 +83,7 @@ namespace alpaka return {devIdxOmp5}; } }; - } // namespace traits + } // namespace trait } // namespace alpaka #endif diff --git a/include/alpaka/pltf/PltfUniformCudaHipRt.hpp b/include/alpaka/pltf/PltfUniformCudaHipRt.hpp index f1b65917c6e1..03dc446e881e 100644 --- a/include/alpaka/pltf/PltfUniformCudaHipRt.hpp +++ b/include/alpaka/pltf/PltfUniformCudaHipRt.hpp @@ -36,7 +36,7 @@ namespace alpaka ALPAKA_FN_HOST PltfUniformCudaHipRt() = delete; }; - namespace traits + namespace trait { //! The CUDA/HIP RT platform device type trait specialization. template<> @@ -268,7 +268,7 @@ namespace alpaka } # endif }; - } // namespace traits + } // namespace trait } // namespace alpaka #endif diff --git a/include/alpaka/pltf/Traits.hpp b/include/alpaka/pltf/Traits.hpp index b676c63856ba..8d4402896ea1 100644 --- a/include/alpaka/pltf/Traits.hpp +++ b/include/alpaka/pltf/Traits.hpp @@ -1,4 +1,4 @@ -/* Copyright 2020 Benjamin Worpitz, Bernhard Manfred Gruber +/* Copyright 2022 Benjamin Worpitz, Bernhard Manfred Gruber * * This file is part of alpaka. * @@ -24,7 +24,7 @@ namespace alpaka }; //! The platform traits. - namespace traits + namespace trait { //! The platform type trait. template @@ -43,24 +43,24 @@ namespace alpaka //! The device get trait. template struct GetDevByIdx; - } // namespace traits + } // namespace trait //! The platform type trait alias template to remove the ::type. template - using Pltf = typename traits::PltfType::type; + using Pltf = typename trait::PltfType::type; //! \return The device identified by its index. template ALPAKA_FN_HOST auto getDevCount() { - return traits::GetDevCount>::getDevCount(); + return trait::GetDevCount>::getDevCount(); } //! \return The device identified by its index. template ALPAKA_FN_HOST auto getDevByIdx(std::size_t const& devIdx) { - return traits::GetDevByIdx>::getDevByIdx(devIdx); + return trait::GetDevByIdx>::getDevByIdx(devIdx); } //! \return All the devices available on this accelerator. @@ -78,12 +78,12 @@ namespace alpaka return devs; } - namespace traits + namespace trait { template struct QueueType::value>> { - using type = typename QueueType::type, TProperty>::type; + using type = typename QueueType::type, TProperty>::type; }; - } // namespace traits + } // namespace trait } // namespace alpaka diff --git a/include/alpaka/queue/QueueGenericThreadsBlocking.hpp b/include/alpaka/queue/QueueGenericThreadsBlocking.hpp index 30e9a43122c2..9b7297c5dae3 100644 --- a/include/alpaka/queue/QueueGenericThreadsBlocking.hpp +++ b/include/alpaka/queue/QueueGenericThreadsBlocking.hpp @@ -97,7 +97,7 @@ namespace alpaka std::shared_ptr> m_spQueueImpl; }; - namespace traits + namespace trait { //! The CPU blocking device queue device type trait specialization. template @@ -160,7 +160,7 @@ namespace alpaka std::lock_guard lk(queue.m_spQueueImpl->m_mutex); } }; - } // namespace traits + } // namespace trait } // namespace alpaka #include diff --git a/include/alpaka/queue/QueueGenericThreadsNonBlocking.hpp b/include/alpaka/queue/QueueGenericThreadsNonBlocking.hpp index 529dfb480246..57f86d1bca1f 100644 --- a/include/alpaka/queue/QueueGenericThreadsNonBlocking.hpp +++ b/include/alpaka/queue/QueueGenericThreadsNonBlocking.hpp @@ -110,7 +110,7 @@ namespace alpaka std::shared_ptr> m_spQueueImpl; }; - namespace traits + namespace trait { //! The CPU non-blocking device queue device type trait specialization. template @@ -160,7 +160,7 @@ namespace alpaka return queue.m_spQueueImpl->m_workerThread.isIdle(); } }; - } // namespace traits + } // namespace trait } // namespace alpaka #include diff --git a/include/alpaka/queue/QueueUniformCudaHipRtBlocking.hpp b/include/alpaka/queue/QueueUniformCudaHipRtBlocking.hpp index 95697a3fde33..c661586c1074 100644 --- a/include/alpaka/queue/QueueUniformCudaHipRtBlocking.hpp +++ b/include/alpaka/queue/QueueUniformCudaHipRtBlocking.hpp @@ -61,7 +61,7 @@ namespace alpaka using QueueHipRtBlocking = QueueUniformCudaHipRtBlocking; # endif - namespace traits + namespace trait { //! The CUDA/HIP RT blocking queue device type trait specialization. template<> @@ -178,7 +178,7 @@ namespace alpaka return queue.getNativeHandle(); } }; - } // namespace traits + } // namespace trait } // namespace alpaka #endif diff --git a/include/alpaka/queue/QueueUniformCudaHipRtNonBlocking.hpp b/include/alpaka/queue/QueueUniformCudaHipRtNonBlocking.hpp index d44fe9904859..6549cca25334 100644 --- a/include/alpaka/queue/QueueUniformCudaHipRtNonBlocking.hpp +++ b/include/alpaka/queue/QueueUniformCudaHipRtNonBlocking.hpp @@ -62,7 +62,7 @@ namespace alpaka using QueueHipRtNonBlocking = QueueUniformCudaHipRtNonBlocking; # endif - namespace traits + namespace trait { //! The CUDA/HIP RT non-blocking queue device type trait specialization. template<> @@ -178,7 +178,7 @@ namespace alpaka return queue.getNativeHandle(); } }; - } // namespace traits + } // namespace trait } // namespace alpaka #endif diff --git a/include/alpaka/queue/Traits.hpp b/include/alpaka/queue/Traits.hpp index a601bb8bd7c4..8aa9977e3f6d 100644 --- a/include/alpaka/queue/Traits.hpp +++ b/include/alpaka/queue/Traits.hpp @@ -1,4 +1,4 @@ -/* Copyright 2020 Benjamin Worpitz, Bernhard Manfred Gruber +/* Copyright 2022 Benjamin Worpitz, Bernhard Manfred Gruber * * This file is part of alpaka. * @@ -21,7 +21,7 @@ namespace alpaka struct ConceptQueue; //! The queue traits. - namespace traits + namespace trait { //! The queue enqueue trait. template @@ -34,7 +34,7 @@ namespace alpaka //! Queue for an accelerator template struct QueueType; - } // namespace traits + } // namespace trait //! Queues the given task in the given queue. //! @@ -45,7 +45,7 @@ namespace alpaka template ALPAKA_FN_HOST auto enqueue(TQueue& queue, TTask&& task) -> void { - traits::Enqueue>::enqueue(queue, std::forward(task)); + trait::Enqueue>::enqueue(queue, std::forward(task)); } //! Tests if the queue is empty (all ops in the given queue have been completed). @@ -57,14 +57,14 @@ namespace alpaka ALPAKA_FN_HOST auto empty(TQueue const& queue) -> bool { using ImplementationBase = concepts::ImplementationBase; - return traits::Empty::empty(queue); + return trait::Empty::empty(queue); } //! Queue based on the environment and a property //! //! \tparam TEnv Environment type, e.g. accelerator, device or a platform. - //! traits::QueueType must be specialized for TEnv + //! trait::QueueType must be specialized for TEnv //! \tparam TProperty Property to define the behavior of TEnv. template - using Queue = typename traits::QueueType::type; + using Queue = typename trait::QueueType::type; } // namespace alpaka diff --git a/include/alpaka/queue/cuda_hip/QueueUniformCudaHipRtBase.hpp b/include/alpaka/queue/cuda_hip/QueueUniformCudaHipRtBase.hpp index 17030874500d..ecdc726527a3 100644 --- a/include/alpaka/queue/cuda_hip/QueueUniformCudaHipRtBase.hpp +++ b/include/alpaka/queue/cuda_hip/QueueUniformCudaHipRtBase.hpp @@ -112,7 +112,7 @@ namespace alpaka } // namespace detail } // namespace uniform_cuda_hip - namespace traits + namespace trait { //! The CUDA/HIP RT non-blocking queue device get trait specialization. template<> @@ -158,7 +158,7 @@ namespace alpaka ALPAKA_UNIFORM_CUDA_HIP_RT_CHECK(ALPAKA_API_PREFIX(StreamSynchronize)(queue.getNativeHandle())); } }; - } // namespace traits + } // namespace trait } // namespace alpaka #endif diff --git a/include/alpaka/queue/sycl/QueueGenericSyclBase.hpp b/include/alpaka/queue/sycl/QueueGenericSyclBase.hpp index 2b772b1067c7..e1af229c7053 100644 --- a/include/alpaka/queue/sycl/QueueGenericSyclBase.hpp +++ b/include/alpaka/queue/sycl/QueueGenericSyclBase.hpp @@ -204,7 +204,7 @@ namespace alpaka::experimental class EventGenericSycl; } -namespace alpaka::traits +namespace alpaka::trait { //! The SYCL blocking queue device type trait specialization. template @@ -279,6 +279,6 @@ namespace alpaka::traits return queue.getNativeHandle(); } }; -} // namespace alpaka::traits +} // namespace alpaka::trait #endif diff --git a/include/alpaka/rand/Philox/PhiloxBaseCudaArray.hpp b/include/alpaka/rand/Philox/PhiloxBaseCudaArray.hpp index 5c3a41c8881b..1fc39b9eed14 100644 --- a/include/alpaka/rand/Philox/PhiloxBaseCudaArray.hpp +++ b/include/alpaka/rand/Philox/PhiloxBaseCudaArray.hpp @@ -15,7 +15,7 @@ namespace alpaka::rand::engine { - namespace traits + namespace trait { template struct PhiloxResultContainerTraits; @@ -46,7 +46,7 @@ namespace alpaka::rand::engine template using PhiloxResultContainer = typename PhiloxResultContainerTraits::type; - } // namespace traits + } // namespace trait /** Philox backend using array-like interface to CUDA uintN types for the storage of Key and Counter * @@ -63,8 +63,8 @@ namespace alpaka::rand::engine = meta::CudaVectorArrayWrapper; ///< Counter type = array-like interface to CUDA uint4 using Key = meta::CudaVectorArrayWrapper; ///< Key type = array-like interface to CUDA uint2 template - using ResultContainer = traits::PhiloxResultContainer; ///< Vector template for - ///< distribution results + using ResultContainer = trait::PhiloxResultContainer; ///< Vector template for + ///< distribution results }; } // namespace alpaka::rand::engine diff --git a/include/alpaka/rand/Philox/PhiloxBaseTraits.hpp b/include/alpaka/rand/Philox/PhiloxBaseTraits.hpp index 11aaaa5f6d9c..2cc33595ace2 100644 --- a/include/alpaka/rand/Philox/PhiloxBaseTraits.hpp +++ b/include/alpaka/rand/Philox/PhiloxBaseTraits.hpp @@ -16,11 +16,11 @@ # include #endif -namespace alpaka::rand::engine::traits +namespace alpaka::rand::engine::trait { #if defined(ALPAKA_ACC_GPU_CUDA_ENABLED) || defined(ALPAKA_ACC_GPU_HIP_ENABLED) template - constexpr auto isGPU = std::is_same_v::type, alpaka::DevUniformCudaHipRt>; + constexpr auto isGPU = std::is_same_v::type, alpaka::DevUniformCudaHipRt>; #else template constexpr bool isGPU = false; @@ -54,4 +54,4 @@ namespace alpaka::rand::engine::traits using Base = PhiloxBaseCommon; ///< Base type to be inherited from }; -} // namespace alpaka::rand::engine::traits +} // namespace alpaka::rand::engine::trait diff --git a/include/alpaka/rand/Philox/PhiloxSingle.hpp b/include/alpaka/rand/Philox/PhiloxSingle.hpp index 675f45eeccfc..2bfa011a7386 100644 --- a/include/alpaka/rand/Philox/PhiloxSingle.hpp +++ b/include/alpaka/rand/Philox/PhiloxSingle.hpp @@ -45,11 +45,11 @@ namespace alpaka::rand::engine * @tparam TParams Basic parameters for the Philox algorithm */ template - class PhiloxSingle : public traits::PhiloxBaseTraits>::Base + class PhiloxSingle : public trait::PhiloxBaseTraits>::Base { public: /// Specialization for different TAcc backends - using Traits = typename traits::PhiloxBaseTraits>; + using Traits = typename trait::PhiloxBaseTraits>; using Counter = typename Traits::Counter; ///< Backend-dependent Counter type using Key = typename Traits::Key; ///< Backend-dependent Key type diff --git a/include/alpaka/rand/Philox/PhiloxVector.hpp b/include/alpaka/rand/Philox/PhiloxVector.hpp index b2005618de24..ef879cd0b6e1 100644 --- a/include/alpaka/rand/Philox/PhiloxVector.hpp +++ b/include/alpaka/rand/Philox/PhiloxVector.hpp @@ -42,11 +42,11 @@ namespace alpaka::rand::engine * @tparam TParams Basic parameters for the Philox algorithm */ template - class PhiloxVector : public traits::PhiloxBaseTraits>::Base + class PhiloxVector : public trait::PhiloxBaseTraits>::Base { public: /// Specialization for different TAcc backends - using Traits = traits::PhiloxBaseTraits>; + using Traits = trait::PhiloxBaseTraits>; using Counter = typename Traits::Counter; ///< Backend-dependent Counter type using Key = typename Traits::Key; ///< Backend-dependent Key type diff --git a/include/alpaka/rand/RandDefault.hpp b/include/alpaka/rand/RandDefault.hpp index 5650f2206d01..2b9e4ecc66aa 100644 --- a/include/alpaka/rand/RandDefault.hpp +++ b/include/alpaka/rand/RandDefault.hpp @@ -165,7 +165,7 @@ namespace alpaka::rand }; } // namespace distribution::gpu - namespace distribution::traits + namespace distribution::trait { //! The GPU device random number float normal distribution get trait specialization. template @@ -195,9 +195,9 @@ namespace alpaka::rand return {}; } }; - } // namespace distribution::traits + } // namespace distribution::trait - namespace engine::traits + namespace engine::trait { //! The GPU device random number default generator get trait specialization. template<> @@ -213,5 +213,5 @@ namespace alpaka::rand return {seed, subsequence, offset}; } }; - } // namespace engine::traits + } // namespace engine::trait } // namespace alpaka::rand diff --git a/include/alpaka/rand/RandStdLib.hpp b/include/alpaka/rand/RandStdLib.hpp index 5b265b9737f2..195e7bbcd48b 100644 --- a/include/alpaka/rand/RandStdLib.hpp +++ b/include/alpaka/rand/RandStdLib.hpp @@ -196,7 +196,7 @@ namespace alpaka::rand }; } // namespace distribution::cpu - namespace distribution::traits + namespace distribution::trait { //! The CPU device random number float normal distribution get trait specialization. template @@ -225,9 +225,9 @@ namespace alpaka::rand return {}; } }; - } // namespace distribution::traits + } // namespace distribution::trait - namespace engine::traits + namespace engine::trait { //! The CPU device random number default generator get trait specialization. template<> @@ -268,5 +268,5 @@ namespace alpaka::rand return {seed, subsequence, offset}; } }; - } // namespace engine::traits + } // namespace engine::trait } // namespace alpaka::rand diff --git a/include/alpaka/rand/RandUniformCudaHipRand.hpp b/include/alpaka/rand/RandUniformCudaHipRand.hpp index 3aee21ea830a..c244d70c4da6 100644 --- a/include/alpaka/rand/RandUniformCudaHipRand.hpp +++ b/include/alpaka/rand/RandUniformCudaHipRand.hpp @@ -229,7 +229,7 @@ namespace alpaka::rand }; } // namespace distribution::uniform_cuda_hip - namespace distribution::traits + namespace distribution::trait { //! The CUDA/HIP random number float normal distribution get trait specialization. template @@ -263,9 +263,9 @@ namespace alpaka::rand return {}; } }; - } // namespace distribution::traits + } // namespace distribution::trait - namespace engine::traits + namespace engine::trait { //! The CUDA/HIP random number default generator get trait specialization. template<> @@ -280,7 +280,7 @@ namespace alpaka::rand return {seed, subsequence, offset}; } }; - } // namespace engine::traits + } // namespace engine::trait # endif } // namespace alpaka::rand diff --git a/include/alpaka/rand/Traits.hpp b/include/alpaka/rand/Traits.hpp index adc3258e902a..4532e9436f47 100644 --- a/include/alpaka/rand/Traits.hpp +++ b/include/alpaka/rand/Traits.hpp @@ -23,8 +23,8 @@ namespace alpaka::rand //! The random number generator distribution specifics. namespace distribution { - //! The random number generator distribution traits. - namespace traits + //! The random number generator distribution trait. + namespace trait { //! The random number float normal distribution get trait. template @@ -37,7 +37,7 @@ namespace alpaka::rand //! The random number integer uniform distribution get trait. template struct CreateUniformUint; - } // namespace traits + } // namespace trait //! \return A normal float distribution with mean 0.0f and standard deviation 1.0f. ALPAKA_NO_HOST_ACC_WARNING @@ -47,7 +47,7 @@ namespace alpaka::rand static_assert(std::is_floating_point_v, "The value type T has to be a floating point type!"); using ImplementationBase = concepts::ImplementationBase; - return traits::CreateNormalReal::createNormalReal(rand); + return trait::CreateNormalReal::createNormalReal(rand); } //! \return A uniform floating point distribution [0.0, 1.0). ALPAKA_NO_HOST_ACC_WARNING @@ -57,7 +57,7 @@ namespace alpaka::rand static_assert(std::is_floating_point_v, "The value type T has to be a floating point type!"); using ImplementationBase = concepts::ImplementationBase; - return traits::CreateUniformReal::createUniformReal(rand); + return trait::CreateUniformReal::createUniformReal(rand); } //! \return A uniform integer distribution [0, UINT_MAX]. ALPAKA_NO_HOST_ACC_WARNING @@ -69,20 +69,20 @@ namespace alpaka::rand "The value type T has to be a unsigned integral type!"); using ImplementationBase = concepts::ImplementationBase; - return traits::CreateUniformUint::createUniformUint(rand); + return trait::CreateUniformUint::createUniformUint(rand); } } // namespace distribution //! The random number generator engine specifics. namespace engine { - //! The random number generator engine traits. - namespace traits + //! The random number generator engine trait. + namespace trait { //! The random number default generator engine get trait. template struct CreateDefault; - } // namespace traits + } // namespace trait //! \return A default random number generator engine. ALPAKA_NO_HOST_ACC_WARNING template @@ -93,7 +93,7 @@ namespace alpaka::rand std::uint32_t const& offset = 0) { using ImplementationBase = concepts::ImplementationBase; - return traits::CreateDefault::createDefault(rand, seed, subsequence, offset); + return trait::CreateDefault::createDefault(rand, seed, subsequence, offset); } } // namespace engine } // namespace alpaka::rand diff --git a/include/alpaka/test/event/EventHostManualTrigger.hpp b/include/alpaka/test/event/EventHostManualTrigger.hpp index 1564f400ef2b..c59463e888dd 100644 --- a/include/alpaka/test/event/EventHostManualTrigger.hpp +++ b/include/alpaka/test/event/EventHostManualTrigger.hpp @@ -1,5 +1,4 @@ -/* Copyright 2022 Benjamin Worpitz, Matthias Werner, Jan Stephan, Andrea Bocci, Bernhard Manfred Gruber, - * Antonio Di Pilato +/* Copyright 2022 Benjamin Worpitz, Matthias Werner, Jan Stephan, Andrea Bocci, Bernhard Manfred Gruber * * This file is part of alpaka. * @@ -18,23 +17,23 @@ namespace alpaka::test { - namespace traits + namespace trait { template struct EventHostManualTriggerType; template struct IsEventHostManualTriggerSupported; - } // namespace traits + } // namespace trait //! The event host manual trigger type trait alias template to remove the ::type. template - using EventHostManualTrigger = typename traits::EventHostManualTriggerType::type; + using EventHostManualTrigger = typename trait::EventHostManualTriggerType::type; template ALPAKA_FN_HOST auto isEventHostManualTriggerSupported(TDev const& dev) -> bool { - return traits::IsEventHostManualTriggerSupported::isSupported(dev); + return trait::IsEventHostManualTriggerSupported::isSupported(dev); } namespace cpu::detail @@ -107,7 +106,7 @@ namespace alpaka::test std::shared_ptr> m_spEventImpl; }; - namespace traits + namespace trait { template<> struct EventHostManualTriggerType @@ -157,10 +156,10 @@ namespace alpaka::test } }; #endif - } // namespace traits + } // namespace trait } // namespace alpaka::test -namespace alpaka::traits +namespace alpaka::trait { //! The CPU device event device get trait specialization. template @@ -269,7 +268,7 @@ namespace alpaka::traits { return (enqueueCount != spEventImpl->m_enqueueCount) || spEventImpl->m_bIsReady; }); } }; -} // namespace alpaka::traits +} // namespace alpaka::trait #ifdef ALPAKA_ACC_GPU_CUDA_ENABLED @@ -365,7 +364,7 @@ namespace alpaka::test std::shared_ptr m_spEventImpl; }; - namespace traits + namespace trait { template<> struct EventHostManualTriggerType @@ -383,10 +382,10 @@ namespace alpaka::test return result != 0; } }; - } // namespace traits + } // namespace trait } // namespace alpaka::test -namespace alpaka::traits +namespace alpaka::trait { //! The CPU device event device get trait specialization. template<> @@ -479,7 +478,7 @@ namespace alpaka::traits CU_STREAM_WAIT_VALUE_GEQ)); } }; -} // namespace alpaka::traits +} // namespace alpaka::trait #endif @@ -571,7 +570,7 @@ namespace alpaka::test std::shared_ptr m_spEventImpl; }; - namespace traits + namespace trait { template<> struct EventHostManualTriggerType @@ -591,10 +590,10 @@ namespace alpaka::test return false; } }; - } // namespace traits + } // namespace trait } // namespace alpaka::test -namespace alpaka::traits +namespace alpaka::trait { //! The CPU device event device get trait specialization. template<> @@ -707,7 +706,7 @@ namespace alpaka::traits # endif } }; -} // namespace alpaka::traits +} // namespace alpaka::trait #endif #ifdef ALPAKA_ACC_SYCL_ENABLED @@ -728,7 +727,7 @@ namespace alpaka } }; - namespace traits + namespace trait { template struct EventHostManualTriggerType> @@ -744,10 +743,10 @@ namespace alpaka return false; } }; - } // namespace traits + } // namespace trait } // namespace test - namespace traits + namespace trait { template struct Enqueue< @@ -781,6 +780,6 @@ namespace alpaka return true; } }; - } // namespace traits + } // namespace trait } // namespace alpaka #endif diff --git a/include/alpaka/test/mem/view/Iterator.hpp b/include/alpaka/test/mem/view/Iterator.hpp index 4f8199631581..73411129ef7c 100644 --- a/include/alpaka/test/mem/view/Iterator.hpp +++ b/include/alpaka/test/mem/view/Iterator.hpp @@ -15,7 +15,7 @@ namespace alpaka::test { - namespace traits + namespace trait { // \tparam T Type to conditionally make const. // \tparam TSource Type to mimic the constness of. @@ -149,20 +149,20 @@ namespace alpaka::test return IteratorView(view, extents.prod()); } }; - } // namespace traits + } // namespace trait template - using Iterator = traits::IteratorView; + using Iterator = trait::IteratorView; template ALPAKA_FN_HOST auto begin(TView& view) -> Iterator { - return traits::Begin::begin(view); + return trait::Begin::begin(view); } template ALPAKA_FN_HOST auto end(TView& view) -> Iterator { - return traits::End::end(view); + return trait::End::end(view); } } // namespace alpaka::test diff --git a/include/alpaka/test/mem/view/ViewTest.hpp b/include/alpaka/test/mem/view/ViewTest.hpp index b4d69ab1d53b..9bc119867d41 100644 --- a/include/alpaka/test/mem/view/ViewTest.hpp +++ b/include/alpaka/test/mem/view/ViewTest.hpp @@ -1,4 +1,5 @@ -/* Copyright 2022 Axel Huebl, Benjamin Worpitz, Matthias Werner, Jan Stephan, Bernhard Manfred Gruber +/* Copyright 2022 Axel Huebl, Benjamin Worpitz, Matthias Werner, Jan Stephan, Bernhard Manfred Gruber, Antonio Di + * Pilato * * This file is part of alpaka. * @@ -28,38 +29,38 @@ namespace alpaka::test Vec const& extent, Vec const& offset) -> void { - // traits::DevType + // trait::DevType { static_assert( std::is_same_v, TDev>, "The device type of the view has to be equal to the specified one."); } - // traits::GetDev + // trait::GetDev { REQUIRE(dev == getDev(view)); } - // traits::DimType + // trait::DimType { static_assert( Dim::value == TDim::value, "The dimensionality of the view has to be equal to the specified one."); } - // traits::ElemType + // trait::ElemType { static_assert( std::is_same_v, TElem>, "The element type of the view has to be equal to the specified one."); } - // traits::GetExtent + // trait::GetExtent { REQUIRE(extent == getExtentVec(view)); } - // traits::GetPitchBytes + // trait::GetPitchBytes { // The pitches have to be at least as large as the values we calculate here. auto pitchMinimum = Vec, TIdx>::ones(); @@ -79,7 +80,7 @@ namespace alpaka::test } } - // traits::GetPtrNative + // trait::GetPtrNative { // The view is a const& so the pointer has to point to a const value. using NativePtr = decltype(getPtrNative(view)); @@ -101,12 +102,12 @@ namespace alpaka::test } } - // traits::GetOffset + // trait::GetOffset { REQUIRE(offset == getOffsetVec(view)); } - // traits::IdxType + // trait::IdxType { static_assert( std::is_same_v, TIdx>, @@ -228,7 +229,7 @@ namespace alpaka::test template ALPAKA_FN_HOST auto testViewMutable(TQueue& queue, TView& view) -> void { - // traits::GetPtrNative + // trait::GetPtrNative { // The view is a non-const so the pointer has to point to a non-const value. using NativePtr = decltype(getPtrNative(view)); diff --git a/include/alpaka/test/queue/Queue.hpp b/include/alpaka/test/queue/Queue.hpp index 974e0798adde..0bf5becfd5e0 100644 --- a/include/alpaka/test/queue/Queue.hpp +++ b/include/alpaka/test/queue/Queue.hpp @@ -13,7 +13,7 @@ namespace alpaka::test { - namespace traits + namespace trait { //! The default queue type trait for devices. template @@ -43,12 +43,12 @@ namespace alpaka::test # endif }; #endif - } // namespace traits + } // namespace trait //! The queue type that should be used for the given accelerator. template - using DefaultQueue = typename traits::DefaultQueueType::type; + using DefaultQueue = typename trait::DefaultQueueType::type; - namespace traits + namespace trait { //! The blocking queue trait. template @@ -207,10 +207,10 @@ namespace alpaka::test }; # endif #endif - } // namespace traits + } // namespace trait //! The queue type that should be used for the given accelerator. template - using IsBlockingQueue = traits::IsBlockingQueue; + using IsBlockingQueue = trait::IsBlockingQueue; //! A std::tuple holding tuples of devices and corresponding queue types. using TestQueues = std::tuple< diff --git a/include/alpaka/test/queue/QueueCpuOmp2Collective.hpp b/include/alpaka/test/queue/QueueCpuOmp2Collective.hpp index fdf872939432..cbd38fe0a6c1 100644 --- a/include/alpaka/test/queue/QueueCpuOmp2Collective.hpp +++ b/include/alpaka/test/queue/QueueCpuOmp2Collective.hpp @@ -105,7 +105,7 @@ namespace alpaka std::shared_ptr m_spBlockingQueue; }; - namespace traits + namespace trait { //! The CPU blocking device queue device type trait specialization. template<> @@ -296,9 +296,9 @@ namespace alpaka wait(*queue.m_spBlockingQueue, event); } }; - } // namespace traits + } // namespace trait //! The test specifics. - namespace test::traits + namespace test::trait { //! The blocking queue trait specialization for a OpenMP2 collective CPU queue. template<> @@ -306,7 +306,7 @@ namespace alpaka { static constexpr bool value = true; }; - } // namespace test::traits + } // namespace test::trait } // namespace alpaka # include diff --git a/include/alpaka/time/TimeOmp.hpp b/include/alpaka/time/TimeOmp.hpp index fd37b2bfa8ec..f4744aeab77d 100644 --- a/include/alpaka/time/TimeOmp.hpp +++ b/include/alpaka/time/TimeOmp.hpp @@ -23,7 +23,7 @@ namespace alpaka { }; - namespace traits + namespace trait { //! The OpenMP accelerator clock operation. template<> @@ -38,7 +38,7 @@ namespace alpaka return static_cast(omp_get_wtime() / omp_get_wtick()); } }; - } // namespace traits + } // namespace trait } // namespace alpaka #endif diff --git a/include/alpaka/time/TimeStdLib.hpp b/include/alpaka/time/TimeStdLib.hpp index 87f084e82dce..4ffa126ab095 100644 --- a/include/alpaka/time/TimeStdLib.hpp +++ b/include/alpaka/time/TimeStdLib.hpp @@ -21,7 +21,7 @@ namespace alpaka { }; - namespace traits + namespace trait { //! The CPU fibers accelerator clock operation. template<> @@ -35,5 +35,5 @@ namespace alpaka std::chrono::high_resolution_clock::now().time_since_epoch().count()); } }; - } // namespace traits + } // namespace trait } // namespace alpaka diff --git a/include/alpaka/time/TimeUniformCudaHipBuiltIn.hpp b/include/alpaka/time/TimeUniformCudaHipBuiltIn.hpp index 3a2a8df61133..5554b74470cc 100644 --- a/include/alpaka/time/TimeUniformCudaHipBuiltIn.hpp +++ b/include/alpaka/time/TimeUniformCudaHipBuiltIn.hpp @@ -32,7 +32,7 @@ namespace alpaka # error If ALPAKA_ACC_GPU_HIP_ENABLED is set, the compiler has to support HIP! # endif - namespace traits + namespace trait { //! The CUDA built-in clock operation. template<> @@ -46,7 +46,7 @@ namespace alpaka return static_cast(clock64()); } }; - } // namespace traits + } // namespace trait # endif diff --git a/include/alpaka/time/Traits.hpp b/include/alpaka/time/Traits.hpp index 0f968fa1263e..405c59b7f746 100644 --- a/include/alpaka/time/Traits.hpp +++ b/include/alpaka/time/Traits.hpp @@ -20,13 +20,13 @@ namespace alpaka { }; - //! The time traits. - namespace traits + //! The time trait. + namespace trait { //! The clock trait. template struct Clock; - } // namespace traits + } // namespace trait //! \return A counter that is increasing every clock cycle. //! @@ -37,6 +37,6 @@ namespace alpaka TTime const& time) -> std::uint64_t { using ImplementationBase = concepts::ImplementationBase; - return traits::Clock::clock(time); + return trait::Clock::clock(time); } } // namespace alpaka diff --git a/include/alpaka/traits/Traits.hpp b/include/alpaka/traits/Traits.hpp index cfa9717b772e..227031803b0a 100644 --- a/include/alpaka/traits/Traits.hpp +++ b/include/alpaka/traits/Traits.hpp @@ -13,8 +13,8 @@ namespace alpaka { - //! The common traits. - namespace traits + //! The common trait. + namespace trait { //! The native handle trait. template @@ -26,14 +26,14 @@ namespace alpaka return 0; } }; - } // namespace traits + } // namespace trait //! Get the native handle of the alpaka object. //! It will return the alpaka object handle if there is any, otherwise it generates a compile time error. template ALPAKA_FN_HOST auto getNativeHandle(TImpl const& impl) { - return traits::NativeHandle::getNativeHandle(impl); + return trait::NativeHandle::getNativeHandle(impl); } //! Alias to the type of the native handle. diff --git a/include/alpaka/vec/Traits.hpp b/include/alpaka/vec/Traits.hpp index fc56afd3e796..ef54e1c5b14f 100644 --- a/include/alpaka/vec/Traits.hpp +++ b/include/alpaka/vec/Traits.hpp @@ -1,4 +1,4 @@ -/* Copyright 2020 Benjamin Worpitz, Bernhard Manfred Gruber +/* Copyright 2022 Benjamin Worpitz, Bernhard Manfred Gruber * * This file is part of alpaka. * @@ -21,7 +21,7 @@ namespace alpaka { //! The vec traits. - namespace traits + namespace trait { //! Trait for selecting a sub-vector. template @@ -38,7 +38,7 @@ namespace alpaka //! Trait for concatenating two vectors. template struct ConcatVec; - } // namespace traits + } // namespace trait //! Builds a new vector by selecting the elements of the source vector in the given order. //! Repeating and swizzling elements is allowed. @@ -47,7 +47,7 @@ namespace alpaka template ALPAKA_FN_HOST_ACC constexpr auto subVecFromIndices(TVec const& vec) { - return traits::SubVecFromIndices::subVecFromIndices(vec); + return trait::SubVecFromIndices::subVecFromIndices(vec); } //! \tparam TVec has to specialize SubVecFromIndices. //! \return The sub-vector consisting of the first N elements of the source vector. @@ -85,7 +85,7 @@ namespace alpaka template ALPAKA_FN_HOST_ACC constexpr auto castVec(TVec const& vec) { - return traits::CastVec::castVec(vec); + return trait::CastVec::castVec(vec); } //! \return The reverseVec vector. @@ -93,7 +93,7 @@ namespace alpaka template ALPAKA_FN_HOST_ACC constexpr auto reverseVec(TVec const& vec) { - return traits::ReverseVec::reverseVec(vec); + return trait::ReverseVec::reverseVec(vec); } //! \return The concatenated vector. @@ -101,6 +101,6 @@ namespace alpaka template ALPAKA_FN_HOST_ACC constexpr auto concatVec(TVecL const& vecL, TVecR const& vecR) { - return traits::ConcatVec::concatVec(vecL, vecR); + return trait::ConcatVec::concatVec(vecL, vecR); } } // namespace alpaka diff --git a/include/alpaka/vec/Vec.hpp b/include/alpaka/vec/Vec.hpp index ea60e1f59033..67c98731a66b 100644 --- a/include/alpaka/vec/Vec.hpp +++ b/include/alpaka/vec/Vec.hpp @@ -395,7 +395,7 @@ namespace alpaka TVal m_data[TDim::value == 0u ? 1u : TDim::value]; }; - namespace traits + namespace trait { //! The Vec dimension get trait specialization. template @@ -454,9 +454,9 @@ namespace alpaka ALPAKA_UNREACHABLE({}); } }; - } // namespace traits + } // namespace trait - namespace traits + namespace trait { //! ReverseVec specialization for Vec. template @@ -512,7 +512,7 @@ namespace alpaka return r; } }; - } // namespace traits + } // namespace trait namespace detail { @@ -591,7 +591,7 @@ namespace alpaka return createVecFromIndexedFnOffset(offsets); } - namespace traits + namespace trait { //! The Vec extent get trait specialization. template @@ -649,7 +649,7 @@ namespace alpaka offsets[TIdxIntegralConst::value] = offset; } }; - } // namespace traits + } // namespace trait } // namespace alpaka #if defined(__clang__) diff --git a/include/alpaka/wait/Traits.hpp b/include/alpaka/wait/Traits.hpp index aca0ddd12b8a..41117f8c1902 100644 --- a/include/alpaka/wait/Traits.hpp +++ b/include/alpaka/wait/Traits.hpp @@ -1,4 +1,4 @@ -/* Copyright 2020 Benjamin Worpitz, Bernhard Manfred Gruber +/* Copyright 2022 Benjamin Worpitz, Bernhard Manfred Gruber * * This file is part of alpaka. * @@ -19,7 +19,7 @@ namespace alpaka }; //! The wait traits. - namespace traits + namespace trait { //! The thread wait trait. template @@ -28,20 +28,20 @@ namespace alpaka //! The waiter wait trait. template struct WaiterWaitFor; - } // namespace traits + } // namespace trait //! Waits the thread for the completion of the given awaited action to complete. template ALPAKA_FN_HOST auto wait(TAwaited const& awaited) -> void { using ImplementationBase = concepts::ImplementationBase; - traits::CurrentThreadWaitFor::currentThreadWaitFor(awaited); + trait::CurrentThreadWaitFor::currentThreadWaitFor(awaited); } //! The waiter waits for the given awaited action to complete. template ALPAKA_FN_HOST auto wait(TWaiter& waiter, TAwaited const& awaited) -> void { - traits::WaiterWaitFor::waiterWaitFor(waiter, awaited); + trait::WaiterWaitFor::waiterWaitFor(waiter, awaited); } } // namespace alpaka diff --git a/include/alpaka/warp/Traits.hpp b/include/alpaka/warp/Traits.hpp index b5c69bb55b70..35758ace90de 100644 --- a/include/alpaka/warp/Traits.hpp +++ b/include/alpaka/warp/Traits.hpp @@ -22,7 +22,7 @@ namespace alpaka::warp }; //! The warp traits. - namespace traits + namespace trait { //! The warp size trait. template @@ -47,7 +47,7 @@ namespace alpaka::warp //! The active mask trait. template struct Activemask; - } // namespace traits + } // namespace trait //! Returns warp size. //! @@ -58,7 +58,7 @@ namespace alpaka::warp ALPAKA_FN_ACC auto getSize(TWarp const& warp) -> std::int32_t { using ImplementationBase = concepts::ImplementationBase; - return traits::GetSize::getSize(warp); + return trait::GetSize::getSize(warp); } //! Returns a 32- or 64-bit unsigned integer (depending on the @@ -81,10 +81,10 @@ namespace alpaka::warp ALPAKA_NO_HOST_ACC_WARNING template ALPAKA_FN_ACC auto activemask(TWarp const& warp) - -> decltype(traits::Activemask>::activemask(warp)) + -> decltype(trait::Activemask>::activemask(warp)) { using ImplementationBase = concepts::ImplementationBase; - return traits::Activemask::activemask(warp); + return trait::Activemask::activemask(warp); } //! Evaluates predicate for all active threads of the warp and returns @@ -107,7 +107,7 @@ namespace alpaka::warp ALPAKA_FN_ACC auto all(TWarp const& warp, std::int32_t predicate) -> std::int32_t { using ImplementationBase = concepts::ImplementationBase; - return traits::All::all(warp, predicate); + return trait::All::all(warp, predicate); } //! Evaluates predicate for all active threads of the warp and returns @@ -130,7 +130,7 @@ namespace alpaka::warp ALPAKA_FN_ACC auto any(TWarp const& warp, std::int32_t predicate) -> std::int32_t { using ImplementationBase = concepts::ImplementationBase; - return traits::Any::any(warp, predicate); + return trait::Any::any(warp, predicate); } //! Evaluates predicate for all non-exited threads in a warp and returns @@ -157,7 +157,7 @@ namespace alpaka::warp ALPAKA_FN_ACC auto ballot(TWarp const& warp, std::int32_t predicate) { using ImplementationBase = concepts::ImplementationBase; - return traits::Ballot::ballot(warp, predicate); + return trait::Ballot::ballot(warp, predicate); } //! Exchange data between threads within a warp. @@ -191,7 +191,7 @@ namespace alpaka::warp ALPAKA_FN_ACC auto shfl(TWarp const& warp, std::int32_t value, std::int32_t srcLane, std::int32_t width = 0) { using ImplementationBase = concepts::ImplementationBase; - return traits::Shfl::shfl(warp, value, srcLane, width ? width : getSize(warp)); + return trait::Shfl::shfl(warp, value, srcLane, width ? width : getSize(warp)); } //! shfl for float vals @@ -200,6 +200,6 @@ namespace alpaka::warp ALPAKA_FN_ACC auto shfl(TWarp const& warp, float value, std::int32_t srcLane, std::int32_t width = 0) { using ImplementationBase = concepts::ImplementationBase; - return traits::Shfl::shfl(warp, value, srcLane, width ? width : getSize(warp)); + return trait::Shfl::shfl(warp, value, srcLane, width ? width : getSize(warp)); } } // namespace alpaka::warp diff --git a/include/alpaka/warp/WarpGenericSycl.hpp b/include/alpaka/warp/WarpGenericSycl.hpp index 88bc01e0cf28..1c9dc5b65b65 100644 --- a/include/alpaka/warp/WarpGenericSycl.hpp +++ b/include/alpaka/warp/WarpGenericSycl.hpp @@ -32,7 +32,7 @@ namespace alpaka::experimental::warp }; } // namespace alpaka::experimental::warp -namespace alpaka::warp::traits +namespace alpaka::warp::trait { template struct GetSize> @@ -117,6 +117,6 @@ namespace alpaka::warp::traits return sycl::select_from_group(actual_group, value, src); } }; -} // namespace alpaka::warp::traits +} // namespace alpaka::warp::trait #endif diff --git a/include/alpaka/warp/WarpSingleThread.hpp b/include/alpaka/warp/WarpSingleThread.hpp index 8ea71542776e..ee391e09528d 100644 --- a/include/alpaka/warp/WarpSingleThread.hpp +++ b/include/alpaka/warp/WarpSingleThread.hpp @@ -20,7 +20,7 @@ namespace alpaka::warp { }; - namespace traits + namespace trait { template<> struct GetSize @@ -88,5 +88,5 @@ namespace alpaka::warp return val; } }; - } // namespace traits + } // namespace trait } // namespace alpaka::warp diff --git a/include/alpaka/warp/WarpUniformCudaHipBuiltIn.hpp b/include/alpaka/warp/WarpUniformCudaHipBuiltIn.hpp index 9cb3dc765169..78cf00fd1cf2 100644 --- a/include/alpaka/warp/WarpUniformCudaHipBuiltIn.hpp +++ b/include/alpaka/warp/WarpUniformCudaHipBuiltIn.hpp @@ -34,7 +34,7 @@ namespace alpaka::warp # error If ALPAKA_ACC_GPU_HIP_ENABLED is set, the compiler has to support HIP! # endif - namespace traits + namespace trait { template<> struct GetSize @@ -152,7 +152,7 @@ namespace alpaka::warp # endif } }; - } // namespace traits + } // namespace trait # endif } // namespace alpaka::warp diff --git a/include/alpaka/workdiv/Traits.hpp b/include/alpaka/workdiv/Traits.hpp index a4c0aab8d450..b6c3abb08462 100644 --- a/include/alpaka/workdiv/Traits.hpp +++ b/include/alpaka/workdiv/Traits.hpp @@ -1,4 +1,4 @@ -/* Copyright 2020 Benjamin Worpitz, Bernhard Manfred Gruber +/* Copyright 2022 Benjamin Worpitz, Bernhard Manfred Gruber * * This file is part of alpaka. * @@ -24,13 +24,13 @@ namespace alpaka { }; - //! The work division traits. - namespace traits + //! The work division trait. + namespace trait { //! The work div trait. template struct GetWorkDiv; - } // namespace traits + } // namespace trait //! Get the extent requested. ALPAKA_NO_HOST_ACC_WARNING @@ -38,10 +38,10 @@ namespace alpaka ALPAKA_FN_HOST_ACC auto getWorkDiv(TWorkDiv const& workDiv) -> Vec, Idx> { using ImplementationBase = concepts::ImplementationBase; - return traits::GetWorkDiv::getWorkDiv(workDiv); + return trait::GetWorkDiv::getWorkDiv(workDiv); } - namespace traits + namespace trait { //! The work div grid thread extent trait specialization. template @@ -76,5 +76,5 @@ namespace alpaka * alpaka::getWorkDiv(workDiv); } }; - } // namespace traits + } // namespace trait } // namespace alpaka diff --git a/include/alpaka/workdiv/WorkDivGenericSycl.hpp b/include/alpaka/workdiv/WorkDivGenericSycl.hpp index d94d457d7d3f..8a8d88409bfd 100644 --- a/include/alpaka/workdiv/WorkDivGenericSycl.hpp +++ b/include/alpaka/workdiv/WorkDivGenericSycl.hpp @@ -37,7 +37,7 @@ namespace alpaka::experimental }; } // namespace alpaka::experimental -namespace alpaka::traits +namespace alpaka::trait { //! The SYCL accelerator work division dimension get trait specialization. template @@ -113,6 +113,6 @@ namespace alpaka::traits return workDiv.m_threadElemExtent; } }; -} // namespace alpaka::traits +} // namespace alpaka::trait #endif diff --git a/include/alpaka/workdiv/WorkDivMembers.hpp b/include/alpaka/workdiv/WorkDivMembers.hpp index d306eb9f4550..cb59dd60c4ac 100644 --- a/include/alpaka/workdiv/WorkDivMembers.hpp +++ b/include/alpaka/workdiv/WorkDivMembers.hpp @@ -1,4 +1,4 @@ -/* Copyright 2021 Benjamin Worpitz, Matthias Werner, Bernhard Manfred Gruber +/* Copyright 2022 Benjamin Worpitz, Matthias Werner, Bernhard Manfred Gruber * * This file is part of alpaka. * @@ -78,7 +78,7 @@ namespace alpaka << workDiv.m_blockThreadExtent << ", threadElemExtent: " << workDiv.m_threadElemExtent << "}"); } - namespace traits + namespace trait { //! The WorkDivMembers dimension get trait specialization. template @@ -129,5 +129,5 @@ namespace alpaka return workDiv.m_threadElemExtent; } }; - } // namespace traits + } // namespace trait } // namespace alpaka diff --git a/include/alpaka/workdiv/WorkDivUniformCudaHipBuiltIn.hpp b/include/alpaka/workdiv/WorkDivUniformCudaHipBuiltIn.hpp index 1e59fa20bcca..65cdaf27b123 100644 --- a/include/alpaka/workdiv/WorkDivUniformCudaHipBuiltIn.hpp +++ b/include/alpaka/workdiv/WorkDivUniformCudaHipBuiltIn.hpp @@ -53,7 +53,7 @@ namespace alpaka # error If ALPAKA_ACC_GPU_HIP_ENABLED is set, the compiler has to support HIP! # endif - namespace traits + namespace trait { //! The GPU CUDA/HIP accelerator work division dimension get trait specialization. template @@ -118,7 +118,7 @@ namespace alpaka return workDiv.m_threadElemExtent; } }; - } // namespace traits + } // namespace trait # endif diff --git a/test/integ/matMul/src/matMul.cpp b/test/integ/matMul/src/matMul.cpp index 60560b79582a..277c64127b92 100644 --- a/test/integ/matMul/src/matMul.cpp +++ b/test/integ/matMul/src/matMul.cpp @@ -121,7 +121,7 @@ class MatMulKernel } }; -namespace alpaka::traits +namespace alpaka::trait { //! The trait for getting the size of the block shared dynamic memory for a kernel. template @@ -149,7 +149,7 @@ namespace alpaka::traits return static_cast(2u * blockThreadExtent.prod() * threadElemExtent.prod()) * sizeof(TElem); } }; -} // namespace alpaka::traits +} // namespace alpaka::trait using TestAccs = alpaka::test::EnabledAccs, std::uint32_t>; diff --git a/test/integ/sharedMem/src/sharedMem.cpp b/test/integ/sharedMem/src/sharedMem.cpp index e790b5900a34..1bd63b784db8 100644 --- a/test/integ/sharedMem/src/sharedMem.cpp +++ b/test/integ/sharedMem/src/sharedMem.cpp @@ -87,7 +87,7 @@ class SharedMemKernel } }; -namespace alpaka::traits +namespace alpaka::trait { //! The trait for getting the size of the block shared dynamic memory for a kernel. template @@ -104,7 +104,7 @@ namespace alpaka::traits return static_cast(blockThreadExtent.prod() * threadElemExtent.prod()) * sizeof(Val); } }; -} // namespace alpaka::traits +} // namespace alpaka::trait using TestAccs = alpaka::test::EnabledAccs, std::uint32_t>; diff --git a/test/unit/block/shared/src/BlockSharedMemDyn.cpp b/test/unit/block/shared/src/BlockSharedMemDyn.cpp index 310dc66c6933..b6f76a6f19b7 100644 --- a/test/unit/block/shared/src/BlockSharedMemDyn.cpp +++ b/test/unit/block/shared/src/BlockSharedMemDyn.cpp @@ -35,7 +35,7 @@ class BlockSharedMemDynTestKernel } }; -namespace alpaka::traits +namespace alpaka::trait { //! The trait for getting the size of the block shared dynamic memory for a kernel. template @@ -53,7 +53,7 @@ namespace alpaka::traits return static_cast(gridSize) * sizeof(std::uint32_t); } }; -} // namespace alpaka::traits +} // namespace alpaka::trait TEMPLATE_LIST_TEST_CASE("sameNonNullAdress", "[blockSharedMemDyn]", alpaka::test::TestAccs) { diff --git a/test/unit/block/sharedSharing/src/BlockSharedMemSharing.cpp b/test/unit/block/sharedSharing/src/BlockSharedMemSharing.cpp index 006f1058130a..2dae4d0fcad2 100644 --- a/test/unit/block/sharedSharing/src/BlockSharedMemSharing.cpp +++ b/test/unit/block/sharedSharing/src/BlockSharedMemSharing.cpp @@ -122,7 +122,7 @@ class BlockSharedMemDynSharingTestKernel } }; -namespace alpaka::traits +namespace alpaka::trait { //! The trait for getting the size of the block shared dynamic memory for a kernel. template @@ -139,7 +139,7 @@ namespace alpaka::traits return sizeof(std::uint32_t); } }; -} // namespace alpaka::traits +} // namespace alpaka::trait TEMPLATE_LIST_TEST_CASE("blockSharedMemDyn", "[blockSharedMemSharing]", TestAccs) { diff --git a/test/unit/block/sync/src/BlockSync.cpp b/test/unit/block/sync/src/BlockSync.cpp index 33dbaa56d1ea..eb48e68ab9c1 100644 --- a/test/unit/block/sync/src/BlockSync.cpp +++ b/test/unit/block/sync/src/BlockSync.cpp @@ -47,7 +47,7 @@ class BlockSyncTestKernel } }; -namespace alpaka::traits +namespace alpaka::trait { //! The trait for getting the size of the block shared dynamic memory for a kernel. template @@ -65,7 +65,7 @@ namespace alpaka::traits return static_cast(blockThreadExtent.prod()) * sizeof(Idx); } }; -} // namespace alpaka::traits +} // namespace alpaka::trait TEMPLATE_LIST_TEST_CASE("synchronize", "[blockSync]", alpaka::test::TestAccs) { diff --git a/test/unit/kernel/src/KernelWithOmpSchedule.cpp b/test/unit/kernel/src/KernelWithOmpSchedule.cpp index b313dc5b7dd2..07c003663c4b 100644 --- a/test/unit/kernel/src/KernelWithOmpSchedule.cpp +++ b/test/unit/kernel/src/KernelWithOmpSchedule.cpp @@ -76,7 +76,7 @@ struct KernelWithTrait : TBase { }; -namespace alpaka::traits +namespace alpaka::trait { // Specialize the trait for kernels of type KernelWithTrait<> template @@ -92,7 +92,7 @@ namespace alpaka::traits return alpaka::omp::Schedule{alpaka::omp::Schedule::Static, 4}; } }; -} // namespace alpaka::traits +} // namespace alpaka::trait // Generic testing routine for the given kernel type template diff --git a/test/unit/math/src/Buffer.hpp b/test/unit/math/src/Buffer.hpp index c90b69671db6..76b3c82b3458 100644 --- a/test/unit/math/src/Buffer.hpp +++ b/test/unit/math/src/Buffer.hpp @@ -37,8 +37,8 @@ namespace alpaka { using value_type = TData; static constexpr size_t capacity = Tcapacity; - using Dim = typename alpaka::traits::DimType::type; - using Idx = typename alpaka::traits::IdxType::type; + using Dim = typename alpaka::trait::DimType::type; + using Idx = typename alpaka::trait::IdxType::type; // Defines using's for alpaka-buffer. using DevAcc = alpaka::Dev; diff --git a/test/unit/mem/copy/src/BufSlicing.cpp b/test/unit/mem/copy/src/BufSlicing.cpp index 6939197464f3..0cc09f7124ca 100644 --- a/test/unit/mem/copy/src/BufSlicing.cpp +++ b/test/unit/mem/copy/src/BufSlicing.cpp @@ -1,4 +1,4 @@ -/* Copyright 2020 Axel Huebl, Benjamin Worpitz, Jakob Krude, Bernhard Manfred Gruber +/* Copyright 2022 Axel Huebl, Benjamin Worpitz, Jakob Krude, Bernhard Manfred Gruber * * This file is part of Alpaka. * @@ -101,7 +101,7 @@ struct TestContainer { INFO("Dim: " << TDim::value) INFO("Idx: " << typeid(TIdx).name()) - INFO("Acc: " << alpaka::traits::GetAccName::getAccName()) + INFO("Acc: " << alpaka::trait::GetAccName::getAccName()) INFO("i: " << i) REQUIRE(ptrA[i] == Approx(ptrB[i])); } diff --git a/test/unit/mem/fence/src/FenceTest.cpp b/test/unit/mem/fence/src/FenceTest.cpp index 4a7957e7db8c..23f55c081f27 100644 --- a/test/unit/mem/fence/src/FenceTest.cpp +++ b/test/unit/mem/fence/src/FenceTest.cpp @@ -1,4 +1,4 @@ -/* Copyright 2021 Jan Stephan +/* Copyright 2022 Jan Stephan * * This file is part of alpaka. * @@ -152,7 +152,7 @@ class BlockFenceTestKernel } }; -namespace alpaka::traits +namespace alpaka::trait { //! The trait for getting the size of the block shared dynamic memory for a kernel. template @@ -169,7 +169,7 @@ namespace alpaka::traits return 2 * sizeof(int); } }; -} // namespace alpaka::traits +} // namespace alpaka::trait using TestAccs = alpaka::test::EnabledAccs, std::size_t>; diff --git a/test/unit/mem/view/src/Accessor.cpp b/test/unit/mem/view/src/Accessor.cpp index 35015b8decf7..5d6663f6eed2 100644 --- a/test/unit/mem/view/src/Accessor.cpp +++ b/test/unit/mem/view/src/Accessor.cpp @@ -1,4 +1,4 @@ -/* Copyright 2021 Bernhard Manfred Gruber +/* Copyright 2022 Bernhard Manfred Gruber * * This file is part of alpaka. * @@ -20,7 +20,7 @@ namespace alpakaex = alpaka::experimental; TEST_CASE("IsView", "[accessor]") { - using alpakaex::traits::internal::IsView; + using alpakaex::trait::internal::IsView; using Dim = alpaka::DimInt<1>; using Size = std::size_t; diff --git a/test/unit/mem/view/src/ViewSubViewTest.cpp b/test/unit/mem/view/src/ViewSubViewTest.cpp index 800e00ec4943..08d23087975c 100644 --- a/test/unit/mem/view/src/ViewSubViewTest.cpp +++ b/test/unit/mem/view/src/ViewSubViewTest.cpp @@ -1,4 +1,4 @@ -/* Copyright 2020 Axel Huebl, Benjamin Worpitz, Erik Zenker, Bernhard Manfred Gruber +/* Copyright 2022 Axel Huebl, Benjamin Worpitz, Erik Zenker, Bernhard Manfred Gruber * * This file is part of alpaka. * @@ -37,7 +37,7 @@ namespace alpaka::test { alpaka::test::testViewImmutable(view, dev, extentView, offsetView); - // alpaka::traits::GetPitchBytes + // alpaka::trait::GetPitchBytes // The pitch of the view has to be identical to the pitch of the underlying buffer in all dimensions. { auto const pitchBuf = alpaka::getPitchBytesVec(buf); @@ -49,7 +49,7 @@ namespace alpaka::test } } - // alpaka::traits::GetPtrNative + // alpaka::trait::GetPtrNative // The native pointer has to be exactly the value we calculate here. { auto viewPtrNative = reinterpret_cast(alpaka::getPtrNative(buf));