@@ -2276,6 +2276,8 @@ class __SYCL_EXPORT handler {
2276
2276
" Invalid accessor target for the copy method." );
2277
2277
static_assert (isValidModeForDestinationAccessor (AccessMode),
2278
2278
" Invalid accessor mode for the copy method." );
2279
+ static_assert (is_device_copyable<T_Src>::value,
2280
+ " Pattern must be device copyable" );
2279
2281
// Make sure data shared_ptr points to is not released until we finish
2280
2282
// work with it.
2281
2283
CGData.MSharedPtrStorage .push_back (Src);
@@ -2345,6 +2347,8 @@ class __SYCL_EXPORT handler {
2345
2347
" Invalid accessor target for the copy method." );
2346
2348
static_assert (isValidModeForDestinationAccessor (AccessMode),
2347
2349
" Invalid accessor mode for the copy method." );
2350
+ static_assert (is_device_copyable<T_Src>::value,
2351
+ " Pattern must be device copyable" );
2348
2352
#ifndef __SYCL_DEVICE_ONLY__
2349
2353
if (MIsHost) {
2350
2354
// TODO: Temporary implementation for host. Should be handled by memory
@@ -2505,12 +2509,12 @@ class __SYCL_EXPORT handler {
2505
2509
// /
2506
2510
// / \param Ptr is the pointer to the memory to fill
2507
2511
// / \param Pattern is the pattern to fill into the memory. T should be
2508
- // / trivially copyable.
2512
+ // / device copyable.
2509
2513
// / \param Count is the number of times to fill Pattern into Ptr.
2510
2514
template <typename T> void fill (void *Ptr, const T &Pattern, size_t Count) {
2511
2515
throwIfActionIsCreated ();
2512
- static_assert (std::is_trivially_copyable <T>::value,
2513
- " Pattern must be trivially copyable" );
2516
+ static_assert (is_device_copyable <T>::value,
2517
+ " Pattern must be device copyable" );
2514
2518
parallel_for<class __usmfill <T>>(range<1 >(Count), [=](id<1 > Index) {
2515
2519
T *CastedPtr = static_cast <T *>(Ptr);
2516
2520
CastedPtr[Index] = Pattern;
@@ -2757,15 +2761,15 @@ class __SYCL_EXPORT handler {
2757
2761
// / \param Dest is a USM pointer to the destination memory.
2758
2762
// / \param DestPitch is the pitch of the rows in \param Dest.
2759
2763
// / \param Pattern is the pattern to fill into the memory. T should be
2760
- // / trivially copyable.
2764
+ // / device copyable.
2761
2765
// / \param Width is the width in number of elements of the 2D region to fill.
2762
2766
// / \param Height is the height in number of rows of the 2D region to fill.
2763
2767
template <typename T>
2764
2768
void ext_oneapi_fill2d (void *Dest, size_t DestPitch, const T &Pattern,
2765
2769
size_t Width, size_t Height) {
2766
2770
throwIfActionIsCreated ();
2767
- static_assert (std::is_trivially_copyable <T>::value,
2768
- " Pattern must be trivially copyable" );
2771
+ static_assert (is_device_copyable <T>::value,
2772
+ " Pattern must be device copyable" );
2769
2773
if (Width > DestPitch)
2770
2774
throw sycl::exception (sycl::make_error_code (errc::invalid),
2771
2775
" Destination pitch must be greater than or equal "
0 commit comments