Skip to content

Commit

Permalink
refactor template order allocMappedBuf
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
SimeonEhrig committed May 16, 2024
1 parent 8dbe7c4 commit bc82094
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions docs/source/dev/backends.rst
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,7 @@ The following tables list the functions available in the `CUDA Runtime API <http
+----------------------------+--------------------------------------------------------------------------------------------+
| cudaFreeAsync | n/a (automatic memory management with reference counted memory handles) |
+----------------------------+--------------------------------------------------------------------------------------------+
| cudaFreeHost | n/a (automatic memory management with reference counted memory handles) |
| cudaFreeHost | n/a (automatic memory management with reference counted memory handles) |
+----------------------------+--------------------------------------------------------------------------------------------+
| cudaFreeMipmappedArray | -- |
+----------------------------+--------------------------------------------------------------------------------------------+
Expand All @@ -363,7 +363,7 @@ The following tables list the functions available in the `CUDA Runtime API <http
+----------------------------+--------------------------------------------------------------------------------------------+
| cudaGetSymbolSize | -- |
+----------------------------+--------------------------------------------------------------------------------------------+
| cudaHostAlloc | alpaka::allocMappedBuf<TPlatform, TElement>(host, extents) 1D, 2D, 3D supported! |
| cudaHostAlloc | alpaka::allocMappedBufIfSupported<TElement, TIdx>(host, extents) 1D, 2D, 3D supported! |
+----------------------------+--------------------------------------------------------------------------------------------+
| cudaHostGetDevicePointer | -- |
+----------------------------+--------------------------------------------------------------------------------------------+
Expand All @@ -383,7 +383,7 @@ The following tables list the functions available in the `CUDA Runtime API <http
+----------------------------+--------------------------------------------------------------------------------------------+
| cudaMallocAsync | alpaka::allocAsyncBuf<TElement>(queue, extents1D) |
+----------------------------+--------------------------------------------------------------------------------------------+
| cudaMallocHost | alpaka::allocMappedBuf<TPlatform, TElement>(host, extents) 1D, 2D, 3D supported! |
| cudaMallocHost | alpaka::allocMappedBuf<TElement, TIdx>(host, extents) 1D, 2D, 3D supported! |
+----------------------------+--------------------------------------------------------------------------------------------+
| cudaMallocManaged | -- |
+----------------------------+--------------------------------------------------------------------------------------------+
Expand Down
6 changes: 3 additions & 3 deletions include/alpaka/mem/buf/Traits.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<typename TPlatform, typename TElem, typename TIdx, typename TExtent>
template<typename TElem, typename TIdx, typename TExtent, typename TPlatform>
ALPAKA_FN_HOST auto allocMappedBuf(
DevCpu const& host,
TPlatform const& platform,
Expand Down Expand Up @@ -180,7 +180,7 @@ namespace alpaka
using Platform = alpaka::Platform<TPlatform>;
if constexpr(hasMappedBufSupport<Platform>)
{
return allocMappedBuf<Platform, TElem, TIdx>(host, platform, extent);
return allocMappedBuf<TElem, TIdx>(host, platform, extent);
}
else
{
Expand Down

0 comments on commit bc82094

Please sign in to comment.