From 76a20bd12004c5df58e3ebe226455c5d02d84d6d Mon Sep 17 00:00:00 2001 From: Andrea Bocci Date: Tue, 28 Nov 2023 10:00:26 +0100 Subject: [PATCH] Enable support for asynchronous memory in ROCm 5.2 and later --- include/alpaka/mem/buf/BufUniformCudaHipRt.hpp | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/include/alpaka/mem/buf/BufUniformCudaHipRt.hpp b/include/alpaka/mem/buf/BufUniformCudaHipRt.hpp index 79340323ff01..02e2dfb403d0 100644 --- a/include/alpaka/mem/buf/BufUniformCudaHipRt.hpp +++ b/include/alpaka/mem/buf/BufUniformCudaHipRt.hpp @@ -280,8 +280,8 @@ namespace alpaka # endif # if defined(ALPAKA_ACC_GPU_HIP_ENABLED) static_assert( - !std::is_same_v, - "HIP devices do not support stream-ordered memory buffers."); + std::is_same_v && TApi::version >= BOOST_VERSION_NUMBER(5, 2, 0), + "Support for stream-ordered memory buffers requires HIP/ROCm 5.2 or higher."); # endif static_assert( TDim::value <= 1, @@ -317,16 +317,22 @@ namespace alpaka } }; -# if defined(ALPAKA_ACC_GPU_CUDA_ENABLED) //! The CUDA/HIP stream-ordered memory allocation capability trait specialization. template struct HasAsyncBufSupport> : std::bool_constant< - std::is_same_v && TApi::version >= BOOST_VERSION_NUMBER(11, 2, 0) - && TDim::value <= 1> + TDim::value <= 1 + && ( +# if defined(ALPAKA_ACC_GPU_CUDA_ENABLED) + std::is_same_v && TApi::version >= BOOST_VERSION_NUMBER(11, 2, 0) +# elif defined(ALPAKA_ACC_GPU_HIP_ENABLED) + std::is_same_v && TApi::version >= BOOST_VERSION_NUMBER(5, 2, 0) +# else + false +# endif + )> { }; -# endif //! The pinned/mapped memory allocation trait specialization for the CUDA/HIP devices. template