Skip to content

Commit

Permalink
Enable support for asynchronous memory in ROCm 5.2 and later
Browse files Browse the repository at this point in the history
  • Loading branch information
fwyzard committed Nov 28, 2023
1 parent 4c981f0 commit 16c471b
Showing 1 changed file with 13 additions and 8 deletions.
21 changes: 13 additions & 8 deletions include/alpaka/mem/buf/BufUniformCudaHipRt.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -280,8 +280,8 @@ namespace alpaka
# endif
# if defined(ALPAKA_ACC_GPU_HIP_ENABLED)
static_assert(
!std::is_same_v<TApi, ApiHipRt>,
"HIP devices do not support stream-ordered memory buffers.");
std::is_same_v<TApi, ApiHipRt> && 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,
Expand Down Expand Up @@ -317,13 +317,18 @@ namespace alpaka
}
};

# if defined(ALPAKA_ACC_GPU_CUDA_ENABLED)
//! The CUDA/HIP stream-ordered memory allocation capability trait specialization.
template<typename TApi, typename TDim>
struct HasAsyncBufSupport<TDim, DevUniformCudaHipRt<TApi>>
: std::bool_constant<
std::is_same_v<TApi, ApiCudaRt> && TApi::version >= BOOST_VERSION_NUMBER(11, 2, 0)
&& TDim::value <= 1>
# if defined(ALPAKA_ACC_GPU_CUDA_ENABLED)
template<typename TDim>
struct HasAsyncBufSupport<TDim, DevUniformCudaHipRt<ApiCudaRt>>
: std::bool_constant<ApiCudaRt::version >= BOOST_VERSION_NUMBER(11, 2, 0) && TDim::value <= 1>
{
};
# endif
# if defined(ALPAKA_ACC_GPU_HIP_ENABLED)
template<typename TDim>
struct HasAsyncBufSupport<TDim, DevUniformCudaHipRt<ApiHipRt>>
: std::bool_constant<ApiHipRt::version >= BOOST_VERSION_NUMBER(5, 2, 0) && TDim::value <= 1>
{
};
# endif
Expand Down

0 comments on commit 16c471b

Please sign in to comment.