alpaka
Abstraction Library for Parallel Kernel Acceleration
Loading...
Searching...
No Matches
BufUniformCudaHipRt.hpp
Go to the documentation of this file.
1/* Copyright 2025 Anton Reinhard
2 * SPDX-License-Identifier: MPL-2.0
3 */
4
5#pragma once
6
7#if defined(ALPAKA_ACC_GPU_CUDA_ENABLED) || defined(ALPAKA_ACC_GPU_HIP_ENABLED)
8
9# include "alpaka/dev/Traits.hpp"
15# include "alpaka/vec/Vec.hpp"
16
17# include <functional>
18# include <memory>
19# include <type_traits>
20# include <utility>
21
22namespace alpaka
23{
24
25 //! The generic memory buffer template implementing muting accessors.
26 template<typename TApi, typename TElem, typename TDim, typename TIdx>
28 : public internal::ViewAccessorType<DevUniformCudaHipRt<TApi>, BufUniformCudaHipRt<TApi, TElem, TDim, TIdx>>
29 {
31
32 public:
33 template<typename TExtent, typename Deleter>
36 TElem* const pMem,
37 Deleter deleter,
38 TExtent const& extent,
39 std::size_t pitchBytes)
40 : m_spBufImpl{std::make_shared<TBufImpl>(dev, pMem, std::move(deleter), extent, pitchBytes)}
41 {
42 }
43
44 public:
45 std::shared_ptr<TBufImpl> m_spBufImpl;
46 };
47
48} // namespace alpaka
49
55
56#endif
The generic memory buffer template implementing muting accessors.
std::shared_ptr< TBufImpl > m_spBufImpl
ALPAKA_FN_HOST BufUniformCudaHipRt(DevUniformCudaHipRt< TApi > const &dev, TElem *const pMem, Deleter deleter, TExtent const &extent, std::size_t pitchBytes)
The CUDA/HIP RT device handle.
The Uniform Cuda/HIP memory buffer implementation.
#define ALPAKA_FN_HOST
Definition Common.hpp:40
typename ViewAccessor< TDev >::template AccessorType< TView > ViewAccessorType
The alpaka accelerator library.
STL namespace.