29 template<
typename TDim,
typename TViewDst,
typename TViewSrc,
typename TExtent>
32 static_assert(TDim::value > 0);
39 template<
typename TViewFwd>
40 TaskCopyCpuBase(TViewFwd&& viewDst, TViewSrc
const& viewSrc, TExtent
const& extent)
52 if constexpr(TDim::value > 0)
56 if constexpr(TDim::value > 1)
64 #if ALPAKA_DEBUG >= ALPAKA_DEBUG_FULL
77 #if(!defined(NDEBUG)) || (ALPAKA_DEBUG >= ALPAKA_DEBUG_FULL)
89 template<
typename TDim,
typename TViewDst,
typename TViewSrc,
typename TExtent>
103 #if ALPAKA_DEBUG >= ALPAKA_DEBUG_FULL
114 if(
static_cast<std::size_t
>(this->
m_extent.prod()) != 0u)
117 extentWithoutInnermost,
121 this->
m_dstMemNative + (castVec<DstSize>(idx) * dstPitchBytesWithoutInnermost).sum(),
122 this->
m_srcMemNative + (castVec<SrcSize>(idx) * srcPitchBytesWithoutInnermost).sum(),
130 template<
typename TViewDst,
typename TViewSrc,
typename TExtent>
140 #if ALPAKA_DEBUG >= ALPAKA_DEBUG_FULL
143 if(
static_cast<std::size_t
>(this->
m_extent.prod()) != 0u)
156 template<
typename TViewDst,
typename TViewSrc,
typename TExtent>
161 template<
typename TViewDstFwd>
162 TaskCopyCpu(TViewDstFwd&& viewDst, TViewSrc
const& viewSrc, [[maybe_unused]] TExtent
const& extent)
172 #if ALPAKA_DEBUG >= ALPAKA_DEBUG_FULL
176 std::cout << __func__ <<
" e: " << Scalar() <<
" ewb: " <<
sizeof(
Elem) <<
" de: " << Scalar()
177 <<
" dptr: " <<
reinterpret_cast<void*
>(
m_dstMemNative) <<
" dpitchb: " << Scalar()
178 <<
" se: " << Scalar() <<
" sptr: " <<
reinterpret_cast<void const*
>(
m_srcMemNative)
179 <<
" spitchb: " << Scalar() << std::endl;
187 #if ALPAKA_DEBUG >= ALPAKA_DEBUG_FULL
206 template<
typename TDim>
209 template<
typename TExtent,
typename TViewSrc,
typename TViewDstFwd>
211 TViewDstFwd&& viewDst,
212 TViewSrc
const& viewSrc,
213 TExtent
const& extent)
216 return {std::forward<TViewDstFwd>(viewDst), viewSrc, extent};
#define ALPAKA_ASSERT(...)
The assert can be explicit disabled by defining NDEBUG.
#define ALPAKA_DEBUG
Set the minimum log level if it is not defined.
#define ALPAKA_DEBUG_MINIMAL_LOG_SCOPE
#define ALPAKA_DEBUG_FULL
The full debug level.
ALPAKA_NO_HOST_ACC_WARNING ALPAKA_FN_ACC auto all(TWarp const &warp, std::int32_t predicate) -> std::int32_t
Evaluates predicate for all active threads of the warp and returns non-zero if and only if predicate ...
The alpaka accelerator library.
typename trait::IdxType< T >::type Idx
ALPAKA_FN_HOST auto memcpy(TQueue &queue, alpaka::detail::DevGlobalImplGeneric< TTag, TTypeDst > &viewDst, TViewSrc const &viewSrc) -> void
ALPAKA_NO_HOST_ACC_WARNING ALPAKA_FN_HOST_ACC auto getExtents(T const &object) -> Vec< Dim< T >, Idx< T >>
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.
std::integral_constant< std::size_t, N > DimInt
The CPU device memory copy task base.
std::uint8_t const *const m_srcMemNative
Vec< TDim, DstSize > const m_dstPitchBytes
Vec< TDim, SrcSize > const m_srcPitchBytes
Vec< TDim, ExtentSize > const m_extent
Idx< TExtent > ExtentSize
TaskCopyCpuBase(TViewFwd &&viewDst, TViewSrc const &viewSrc, TExtent const &extent)
ALPAKA_FN_HOST auto printDebug() const -> void
Vec< TDim, SrcSize > const m_srcExtent
alpaka::Elem< TViewSrc > Elem
std::uint8_t *const m_dstMemNative
Vec< TDim, DstSize > const m_dstExtent
ExtentSize const m_extentWidthBytes
alpaka::Elem< TViewSrc > Elem
std::uint8_t *const m_dstMemNative
std::uint8_t const *const m_srcMemNative
TaskCopyCpu(TViewDstFwd &&viewDst, TViewSrc const &viewSrc, [[maybe_unused]] TExtent const &extent)
ALPAKA_FN_HOST auto operator()() const noexcept(ALPAKA_DEBUG< ALPAKA_DEBUG_FULL) -> void
ALPAKA_FN_HOST auto printDebug() const -> void
ALPAKA_FN_HOST auto operator()() const -> void
The CPU device ND memory copy task.
DimInt< TDim::value - 1u > DimMin1
ALPAKA_FN_HOST auto operator()() const -> void
static ALPAKA_FN_HOST auto createTaskMemcpy(TViewDstFwd &&viewDst, TViewSrc const &viewSrc, TExtent const &extent) -> alpaka::detail::TaskCopyCpu< TDim, std::remove_reference_t< TViewDstFwd >, TViewSrc, TExtent >
The memory copy task trait.