11 #ifdef ALPAKA_ACC_SYCL_ENABLED
13 # include <sycl/sycl.hpp>
20 struct DevGlobalTrait<TagCpuSycl, T>
23 using Type = sycl::ext::oneapi::experimental::device_global<T>;
27 struct DevGlobalTrait<TagGpuSyclIntel, T>
30 using Type = sycl::ext::oneapi::experimental::device_global<T>;
34 struct DevGlobalTrait<TagFpgaSyclIntel, T>
37 using Type = sycl::ext::oneapi::experimental::device_global<T>;
41 struct DevGlobalTrait<TagGenericSycl, T>
44 using Type = sycl::ext::oneapi::experimental::device_global<T>;
49 template<
typename TDev,
bool TBlocking,
typename TViewDst,
typename TTypeSrc>
51 detail::QueueGenericSyclBase<TDev, TBlocking>& queue,
53 sycl::ext::oneapi::experimental::device_global<TTypeSrc>
const& viewSrc)
55 queue.getNativeHandle().memcpy(
reinterpret_cast<void*
>(
getPtrNative(viewDst)), viewSrc);
59 template<
typename TDev,
bool TBlocking,
typename TTypeDst,
typename TViewSrc>
61 detail::QueueGenericSyclBase<TDev, TBlocking>& queue,
62 sycl::ext::oneapi::experimental::device_global<TTypeDst>& viewDst,
63 TViewSrc
const& viewSrc)
65 queue.getNativeHandle().memcpy(viewDst,
reinterpret_cast<void const*
>(
getPtrNative(viewSrc)));
69 template<
typename TDev,
bool TBlocking,
typename TViewDst,
typename TTypeSrc,
typename TExtent>
71 detail::QueueGenericSyclBase<TDev, TBlocking>& queue,
73 sycl::ext::oneapi::experimental::device_global<TTypeSrc>
const& viewSrc,
77 auto size =
static_cast<std::size_t
>(
getHeight(extent)) *
static_cast<std::size_t
>(
getDepth(extent))
78 *
static_cast<std::size_t
>(
getWidth(extent)) *
sizeof(
Elem);
79 queue.getNativeHandle().memcpy(
reinterpret_cast<void*
>(
getPtrNative(viewDst)), viewSrc, size);
83 template<
typename TDev,
bool TBlocking,
typename TTypeDst,
typename TViewSrc,
typename TExtent>
85 detail::QueueGenericSyclBase<TDev, TBlocking>& queue,
86 sycl::ext::oneapi::experimental::device_global<TTypeDst>& viewDst,
87 TViewSrc
const& viewSrc,
91 auto size =
static_cast<std::size_t
>(
getHeight(extent)) *
static_cast<std::size_t
>(
getDepth(extent))
92 *
static_cast<std::size_t
>(
getWidth(extent)) *
sizeof(
Elem);
93 queue.getNativeHandle().memcpy(viewDst,
reinterpret_cast<void const*
>(
getPtrNative(viewSrc)), size);
The alpaka accelerator library.
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 getHeight(TExtent const &extent=TExtent()) -> Idx< TExtent >
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_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 >