From 71733957be911bfc146a61759d3b0089a42ff288 Mon Sep 17 00:00:00 2001 From: Simeon Ehrig Date: Mon, 27 May 2024 17:13:31 +0200 Subject: [PATCH] refactor template order `allocMappedBuf` Move template TPlatform as the last template. There is no need to provide the platform template signature if we pass the platform as an instance. --- docs/source/dev/backends.rst | 9 +++++---- include/alpaka/mem/buf/Traits.hpp | 6 +++--- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/docs/source/dev/backends.rst b/docs/source/dev/backends.rst index c9a6bccc6247..c4c4d03a83de 100644 --- a/docs/source/dev/backends.rst +++ b/docs/source/dev/backends.rst @@ -195,7 +195,7 @@ Depending on the cmake argument ``ALPAKA_ACC_GPU_CUDA_ONLY_MODE`` the function a +----------+-------------------------------------+ | CUDA | alpaka | +==========+=====================================+ - | ``dim3`` | ``alpaka::Vec< TDim, TVal >`` | + | ``dim3`` | ``alpaka::Vec< TDim, TVal >`` | +----------+-------------------------------------+ @@ -353,7 +353,7 @@ The following tables list the functions available in the `CUDA Runtime API (host, extents) 1D, 2D, 3D supported! | + | cudaHostAlloc | alpaka::allocMappedBuf(host, extents) 1D, 2D, 3D supported! [1] | +----------------------------+--------------------------------------------------------------------------------------------+ | cudaHostGetDevicePointer | -- | +----------------------------+--------------------------------------------------------------------------------------------+ @@ -383,7 +383,7 @@ The following tables list the functions available in the `CUDA Runtime API (queue, extents1D) | +----------------------------+--------------------------------------------------------------------------------------------+ - | cudaMallocHost | alpaka::allocMappedBuf(host, extents) 1D, 2D, 3D supported! | + | cudaMallocHost | alpaka::allocMappedBuf(host, platform, extents) 1D, 2D, 3D supported! | +----------------------------+--------------------------------------------------------------------------------------------+ | cudaMallocManaged | -- | +----------------------------+--------------------------------------------------------------------------------------------+ @@ -473,6 +473,7 @@ The following tables list the functions available in the `CUDA Runtime API (host, platform, extents)` should be used instead to support these platforms as well. *Execution Control* diff --git a/include/alpaka/mem/buf/Traits.hpp b/include/alpaka/mem/buf/Traits.hpp index 33e7c9bda7f1..e29cf5bf39b1 100644 --- a/include/alpaka/mem/buf/Traits.hpp +++ b/include/alpaka/mem/buf/Traits.hpp @@ -127,14 +127,14 @@ namespace alpaka //! Allocates pinned/mapped host memory, accessible by all devices in the given platform. //! - //! \tparam TPlatform The platform from which the buffer is accessible. //! \tparam TElem The element type of the returned buffer. //! \tparam TIdx The linear index type of the buffer. //! \tparam TExtent The extent type of the buffer. + //! \tparam TPlatform The platform from which the buffer is accessible. //! \param host The host device to allocate the buffer on. //! \param extent The extent of the buffer. //! \return The newly allocated buffer. - template + template ALPAKA_FN_HOST auto allocMappedBuf( DevCpu const& host, TPlatform const& platform, @@ -180,7 +180,7 @@ namespace alpaka using Platform = alpaka::Platform; if constexpr(hasMappedBufSupport) { - return allocMappedBuf(host, platform, extent); + return allocMappedBuf(host, platform, extent); } else {