diff --git a/include/alpaka/core/Common.hpp b/include/alpaka/core/Common.hpp index 5706bb83ff82..6f29f9a19d7e 100644 --- a/include/alpaka/core/Common.hpp +++ b/include/alpaka/core/Common.hpp @@ -1,4 +1,4 @@ -/* Copyright 2023 Axel Hübl, Benjamin Worpitz, Matthias Werner, Jan Stephan, René Widera, Andrea Bocci, Aurora Perego +/* Copyright 2024 Axel Hübl, Benjamin Worpitz, Matthias Werner, Jan Stephan, René Widera, Andrea Bocci, Aurora Perego * SPDX-License-Identifier: MPL-2.0 */ @@ -102,7 +102,8 @@ //! //! Those variables behave like ordinary variables when used in file-scope, //! but inside kernels the get() method must be used to access the variable. -//! They are declared inline to be accessible from other compilation units. +//! They are declared inline to resolve to a single instance across multiple +//! translation units. //! Like ordinary variables, only one definition is allowed (ODR) //! Failure to do so might lead to linker errors. //! @@ -175,7 +176,8 @@ namespace alpaka //! //! Those variables behave like ordinary variables when used in file-scope, //! but inside kernels the get() method must be used to access the variable. -//! They are declared inline to be accessible from other compilation units. +//! They are declared inline to resolve to a single instance across multiple +//! translation units. //! Like ordinary variables, only one definition is allowed (ODR) //! Failure to do so might lead to linker errors. //! diff --git a/include/alpaka/mem/global/DeviceGlobalCpu.hpp b/include/alpaka/mem/global/DeviceGlobalCpu.hpp index 66335dc093a1..18a3ee287e92 100644 --- a/include/alpaka/mem/global/DeviceGlobalCpu.hpp +++ b/include/alpaka/mem/global/DeviceGlobalCpu.hpp @@ -15,10 +15,10 @@ namespace alpaka template ALPAKA_FN_HOST auto memcpy(TQueue& queue, alpaka::DevGlobal& viewDst, TViewSrc const& viewSrc) -> void { - typedef std::remove_all_extents_t T; + using Type = std::remove_all_extents_t; auto extent = getExtents(viewSrc); - auto view = alpaka::ViewPlainPtr, alpaka::Idx>( - reinterpret_cast(&viewDst), + auto view = alpaka::ViewPlainPtr, alpaka::Idx>( + reinterpret_cast(&viewDst), alpaka::getDev(queue), extent); enqueue(queue, createTaskMemcpy(std::forward(view), viewSrc, extent)); @@ -27,10 +27,10 @@ namespace alpaka template ALPAKA_FN_HOST auto memcpy(TQueue& queue, TViewDstFwd&& viewDst, alpaka::DevGlobal& viewSrc) -> void { - typedef std::remove_all_extents_t T; + using Type = std::remove_all_extents_t; auto extent = getExtents(viewDst); - auto view = alpaka::ViewPlainPtr, alpaka::Idx>( - reinterpret_cast(&viewSrc), + auto view = alpaka::ViewPlainPtr, alpaka::Idx>( + reinterpret_cast(&viewSrc), alpaka::getDev(queue), extent); enqueue(queue, createTaskMemcpy(std::forward(viewDst), view, extent)); @@ -43,9 +43,9 @@ namespace alpaka TViewSrc const& viewSrc, TExtent const& extent) -> void { - typedef std::remove_all_extents_t T; - auto view = alpaka::ViewPlainPtr, alpaka::Idx>( - reinterpret_cast(&viewDst), + using Type = std::remove_all_extents_t; + auto view = alpaka::ViewPlainPtr, alpaka::Idx>( + reinterpret_cast(&viewDst), alpaka::getDev(queue), extent); enqueue(queue, createTaskMemcpy(std::forward(view), viewSrc, extent)); @@ -58,9 +58,9 @@ namespace alpaka alpaka::DevGlobal& viewSrc, TExtent const& extent) -> void { - typedef std::remove_all_extents_t T; - auto view = alpaka::ViewPlainPtr, alpaka::Idx>( - reinterpret_cast(&viewSrc), + using Type = std::remove_all_extents_t; + auto view = alpaka::ViewPlainPtr, alpaka::Idx>( + reinterpret_cast(&viewSrc), alpaka::getDev(queue), extent); enqueue(queue, createTaskMemcpy(std::forward(viewDst), view, extent)); diff --git a/include/alpaka/mem/global/DeviceGlobalUniformCudaHipBuiltIn.hpp b/include/alpaka/mem/global/DeviceGlobalUniformCudaHipBuiltIn.hpp index 10f5b284f3e6..5be5674b9d9d 100644 --- a/include/alpaka/mem/global/DeviceGlobalUniformCudaHipBuiltIn.hpp +++ b/include/alpaka/mem/global/DeviceGlobalUniformCudaHipBuiltIn.hpp @@ -18,17 +18,17 @@ namespace alpaka TViewDst& viewDst, alpaka::DevGlobal& viewSrc) { - typedef std::remove_all_extents_t T; + using Type = std::remove_all_extents_t; auto extent = getExtents(viewDst); - T* pMemAcc(nullptr); + Type* pMemAcc(nullptr); ALPAKA_UNIFORM_CUDA_HIP_RT_CHECK( TApi::getSymbolAddress(reinterpret_cast(&pMemAcc), *(&viewSrc.value))); - auto view = alpaka:: - ViewPlainPtr, T, alpaka::Dim, alpaka::Idx>( - pMemAcc, - alpaka::getDev(queue), - extent); + auto view = alpaka::ViewPlainPtr< + DevUniformCudaHipRt, + Type, + alpaka::Dim, + alpaka::Idx>(pMemAcc, alpaka::getDev(queue), extent); enqueue(queue, createTaskMemcpy(std::forward(viewDst), view, extent)); } @@ -39,17 +39,17 @@ namespace alpaka alpaka::DevGlobal& viewDst, TViewSrc const& viewSrc) { - typedef std::remove_all_extents_t T; + using Type = std::remove_all_extents_t; auto extent = getExtents(viewSrc); - T* pMemAcc(nullptr); + Type* pMemAcc(nullptr); ALPAKA_UNIFORM_CUDA_HIP_RT_CHECK( TApi::getSymbolAddress(reinterpret_cast(&pMemAcc), *(&viewDst.value))); - auto view = alpaka:: - ViewPlainPtr, T, alpaka::Dim, alpaka::Idx>( - pMemAcc, - alpaka::getDev(queue), - extent); + auto view = alpaka::ViewPlainPtr< + DevUniformCudaHipRt, + Type, + alpaka::Dim, + alpaka::Idx>(pMemAcc, alpaka::getDev(queue), extent); enqueue(queue, createTaskMemcpy(std::forward(view), viewSrc, extent)); } @@ -61,12 +61,12 @@ namespace alpaka alpaka::DevGlobal& viewSrc, TExtent extent) { - typedef std::remove_all_extents_t T; - T* pMemAcc(nullptr); + using Type = std::remove_all_extents_t; + Type* pMemAcc(nullptr); ALPAKA_UNIFORM_CUDA_HIP_RT_CHECK( TApi::getSymbolAddress(reinterpret_cast(&pMemAcc), *(&viewSrc.value))); - auto view = alpaka::ViewPlainPtr, T, alpaka::Dim, alpaka::Idx>( + auto view = alpaka::ViewPlainPtr, Type, alpaka::Dim, alpaka::Idx>( pMemAcc, alpaka::getDev(queue), extent); @@ -81,12 +81,12 @@ namespace alpaka TViewSrc const& viewSrc, TExtent extent) { - typedef std::remove_all_extents_t T; - T* pMemAcc(nullptr); + using Type = std::remove_all_extents_t; + Type* pMemAcc(nullptr); ALPAKA_UNIFORM_CUDA_HIP_RT_CHECK( TApi::getSymbolAddress(reinterpret_cast(&pMemAcc), *(&viewDst.value))); - auto view = alpaka::ViewPlainPtr, T, alpaka::Dim, alpaka::Idx>( + auto view = alpaka::ViewPlainPtr, Type, alpaka::Dim, alpaka::Idx>( pMemAcc, alpaka::getDev(queue), extent); diff --git a/include/alpaka/test/KernelExecutionFixture.hpp b/include/alpaka/test/KernelExecutionFixture.hpp index ee444fcd71b4..6181757c8fa0 100644 --- a/include/alpaka/test/KernelExecutionFixture.hpp +++ b/include/alpaka/test/KernelExecutionFixture.hpp @@ -1,4 +1,4 @@ -/* Copyright 2023 Benjamin Worpitz, Andrea Bocci, Bernhard Manfred Gruber, Jan Stephan, Aurora Perego +/* Copyright 2024 Benjamin Worpitz, Andrea Bocci, Bernhard Manfred Gruber, Jan Stephan, Aurora Perego * SPDX-License-Identifier: MPL-2.0 */ @@ -50,13 +50,13 @@ namespace alpaka::test { } - KernelExecutionFixture(Queue& queue, WorkDiv workDiv) : m_queue{queue}, m_workDiv{std::move(workDiv)} + KernelExecutionFixture(Queue queue, WorkDiv workDiv) : m_queue{std::move(queue)}, m_workDiv{std::move(workDiv)} { } template - KernelExecutionFixture(Queue& queue, TExtent const& extent) - : m_queue{queue} + KernelExecutionFixture(Queue queue, TExtent const& extent) + : m_queue{std::move(queue)} , m_workDiv{getValidWorkDiv( m_device, extent, diff --git a/test/unit/mem/view/src/ViewStaticAccMem.cpp b/test/unit/mem/view/src/ViewStaticAccMem.cpp index 6795ed3b3551..d88cfc41c0f0 100644 --- a/test/unit/mem/view/src/ViewStaticAccMem.cpp +++ b/test/unit/mem/view/src/ViewStaticAccMem.cpp @@ -1,4 +1,4 @@ -/* Copyright 2023 Axel Huebl, Benjamin Worpitz, Matthias Werner, Bernhard Manfred Gruber, Jan Stephan, Andrea Bocci, +/* Copyright 2024 Axel Huebl, Benjamin Worpitz, Matthias Werner, Bernhard Manfred Gruber, Jan Stephan, Andrea Bocci, * Aurora Perego SPDX-License-Identifier: MPL-2.0 */