22 #if defined(ALPAKA_ACC_GPU_CUDA_ENABLED) || defined(ALPAKA_ACC_GPU_HIP_ENABLED)
26 template<
typename TApi>
27 class DevUniformCudaHipRt;
32 template<
typename TApi,
typename TDim,
typename TView,
typename TExtent>
51 template<
typename TApi,
typename TDim,
typename TView,
typename TExtent>
55 template<
typename TApi,
typename TView,
typename TExtent>
59 template<
typename TViewFwd>
62 std::forward<TViewFwd>(view),
68 template<
typename TQueue>
74 static_cast<int>(this->m_byte),
76 queue.getNativeHandle()));
81 template<
typename TApi,
typename TView,
typename TExtent>
85 template<
typename TViewFwd>
88 std::forward<TViewFwd>(view),
94 template<
typename TQueue>
97 auto& view = this->m_view;
98 auto const& extent = this->m_extent;
100 auto const extentWidth =
getWidth(extent);
109 auto const extentWidthBytes =
static_cast<std::size_t
>(extentWidth) *
sizeof(
Elem<TView>);
112 static_cast<int>(this->m_byte),
114 queue.getNativeHandle()));
119 template<
typename TApi,
typename TView,
typename TExtent>
123 template<
typename TViewFwd>
126 std::forward<TViewFwd>(view),
132 template<
typename TQueue>
135 auto& view = this->m_view;
136 auto const& extent = this->m_extent;
138 auto const extentWidth =
getWidth(extent);
139 auto const extentHeight =
getHeight(extent);
141 if(extentWidth == 0 || extentHeight == 0)
146 auto const extentWidthBytes =
static_cast<std::size_t
>(extentWidth) *
sizeof(
Elem<TView>);
148 # if !defined(NDEBUG)
149 auto const dstWidth =
getWidth(view);
152 auto const dstRowPitchBytes =
static_cast<std::size_t
>(
getPitchesInBytes(view)[0]);
153 auto const dstNativePtr =
reinterpret_cast<void*
>(
getPtrNative(view));
161 static_cast<int>(this->m_byte),
163 static_cast<std::size_t
>(extentHeight),
164 queue.getNativeHandle()));
169 template<
typename TApi,
typename TView,
typename TExtent>
173 template<
typename TViewFwd>
176 std::forward<TViewFwd>(view),
182 template<
typename TQueue>
187 auto& view = this->m_view;
188 auto const& extent = this->m_extent;
190 auto const extentWidth =
getWidth(extent);
191 auto const extentHeight =
getHeight(extent);
192 auto const extentDepth =
getDepth(extent);
195 if(extentWidth == 0 || extentHeight == 0 || extentDepth == 0)
200 auto const dstWidth =
getWidth(view);
201 # if !defined(NDEBUG)
203 auto const dstDepth =
getDepth(view);
206 auto const dstNativePtr =
reinterpret_cast<void*
>(
getPtrNative(view));
212 typename TApi::PitchedPtr_t
const pitchedPtrVal = TApi::makePitchedPtr(
214 static_cast<std::size_t
>(dstRowPitchBytes),
215 static_cast<std::size_t
>(dstWidth) *
sizeof(
Elem),
216 static_cast<std::size_t
>(dstSlicePitchBytes / dstRowPitchBytes));
218 typename TApi::Extent_t
const extentVal = TApi::makeExtent(
219 static_cast<std::size_t
>(extentWidth) *
sizeof(
Elem),
220 static_cast<std::size_t
>(extentHeight),
221 static_cast<std::size_t
>(extentDepth));
226 static_cast<int>(this->m_byte),
228 queue.getNativeHandle()));
236 template<
typename TApi,
typename TDim>
239 template<
typename TExtent,
typename TView>
248 template<
typename TApi,
typename TView,
typename TExtent>
264 template<
typename TApi,
typename TView,
typename TExtent>
282 template<
typename TApi,
typename TView,
typename TExtent>
298 template<
typename TApi,
typename TView,
typename TExtent>
316 template<
typename TApi,
typename TView,
typename TExtent>
332 template<
typename TApi,
typename TView,
typename TExtent>
350 template<
typename TApi,
typename TView,
typename TExtent>
366 template<
typename TApi,
typename TView,
typename TExtent>
#define ALPAKA_ASSERT(...)
The assert can be explicit disabled by defining NDEBUG.
#define ALPAKA_DEBUG_MINIMAL_LOG_SCOPE
The alpaka accelerator library.
ALPAKA_NO_HOST_ACC_WARNING ALPAKA_FN_HOST_ACC auto getHeight(TExtent const &extent=TExtent()) -> Idx< TExtent >
ALPAKA_FN_HOST auto getPitchesInBytes(TView const &view) -> Vec< Dim< TView >, Idx< TView >>
ALPAKA_FN_HOST auto getPtrNative(TView const &view) -> Elem< TView > const *
Gets the native pointer of the memory view.
std::remove_volatile_t< typename trait::ElemType< TView >::type > Elem
The element type trait alias template to remove the ::type.
ALPAKA_FN_HOST auto getDev(T const &t)
ALPAKA_FN_HOST auto getNativeHandle(TImpl const &impl)
Get the native handle of the alpaka object. It will return the alpaka object handle if there is any,...
std::integral_constant< std::size_t, N > DimInt
ALPAKA_FN_HOST auto wait(TAwaited const &awaited) -> void
Waits the thread for the completion of the given awaited action to complete.
ALPAKA_NO_HOST_ACC_WARNING ALPAKA_FN_HOST_ACC auto getDepth(TExtent const &extent=TExtent()) -> Idx< TExtent >
ALPAKA_NO_HOST_ACC_WARNING ALPAKA_FN_HOST_ACC auto getWidth(TExtent const &extent=TExtent()) -> Idx< TExtent >
auto enqueue(TQueue &queue) const -> void
TaskSetUniformCudaHip(TViewFwd &&view, std::uint8_t const &byte, TExtent const &extent)
auto enqueue(TQueue &queue) const -> void
TaskSetUniformCudaHip(TViewFwd &&view, std::uint8_t const &byte, TExtent const &extent)
TaskSetUniformCudaHip(TViewFwd &&view, std::uint8_t const &byte, TExtent const &extent)
auto enqueue(TQueue &queue) const -> void
TaskSetUniformCudaHip(TViewFwd &&view, std::uint8_t const &byte, TExtent const &extent)
auto enqueue(TQueue &queue) const -> void
The memory set task trait.