@@ -317,7 +317,7 @@ template <typename Ty, int N, class Derived, class SFINAE> class simd_obj_impl {
317
317
318
318
// / \tparam Rep is number of times region has to be replicated.
319
319
// / \return replicated simd_obj_impl instance.
320
- template <int Rep> resize_a_simd_type_t <Derived, Rep * N> replicate () {
320
+ template <int Rep> resize_a_simd_type_t <Derived, Rep * N> replicate () const {
321
321
return replicate<Rep, N>(0 );
322
322
}
323
323
@@ -327,7 +327,7 @@ template <typename Ty, int N, class Derived, class SFINAE> class simd_obj_impl {
327
327
// / \return replicated simd_obj_impl instance.
328
328
template <int Rep, int W>
329
329
__SYCL_DEPRECATED (" use simd_obj_impl::replicate_w" )
330
- resize_a_simd_type_t <Derived, Rep * W> replicate (uint16_t Offset) {
330
+ resize_a_simd_type_t <Derived, Rep * W> replicate (uint16_t Offset) const {
331
331
return replicate_w<Rep, W>(Offset);
332
332
}
333
333
@@ -336,7 +336,7 @@ template <typename Ty, int N, class Derived, class SFINAE> class simd_obj_impl {
336
336
// / \param Offset is offset in number of elements in src region.
337
337
// / \return replicated simd_obj_impl instance.
338
338
template <int Rep, int W>
339
- resize_a_simd_type_t <Derived, Rep * W> replicate_w (uint16_t Offset) {
339
+ resize_a_simd_type_t <Derived, Rep * W> replicate_w (uint16_t Offset) const {
340
340
return replicate_vs_w_hs<Rep, 0 , W, 1 >(Offset);
341
341
}
342
342
@@ -347,7 +347,7 @@ template <typename Ty, int N, class Derived, class SFINAE> class simd_obj_impl {
347
347
// / \return replicated simd_obj_impl instance.
348
348
template <int Rep, int VS, int W>
349
349
__SYCL_DEPRECATED (" use simd_obj_impl::replicate_vs_w" )
350
- resize_a_simd_type_t <Derived, Rep * W> replicate (uint16_t Offset) {
350
+ resize_a_simd_type_t <Derived, Rep * W> replicate (uint16_t Offset) const {
351
351
return replicate_vs_w<Rep, VS, W>(Offset);
352
352
}
353
353
@@ -357,7 +357,7 @@ template <typename Ty, int N, class Derived, class SFINAE> class simd_obj_impl {
357
357
// / \param Offset offset in number of elements in src region.
358
358
// / \return replicated simd_obj_impl instance.
359
359
template <int Rep, int VS, int W>
360
- resize_a_simd_type_t <Derived, Rep * W> replicate_vs_w (uint16_t Offset) {
360
+ resize_a_simd_type_t <Derived, Rep * W> replicate_vs_w (uint16_t Offset) const {
361
361
return replicate_vs_w_hs<Rep, VS, W, 1 >(Offset);
362
362
}
363
363
@@ -369,7 +369,7 @@ template <typename Ty, int N, class Derived, class SFINAE> class simd_obj_impl {
369
369
// / \return replicated simd_obj_impl instance.
370
370
template <int Rep, int VS, int W, int HS>
371
371
__SYCL_DEPRECATED (" use simd_obj_impl::replicate_vs_w_hs" )
372
- resize_a_simd_type_t <Derived, Rep * W> replicate (uint16_t Offset) {
372
+ resize_a_simd_type_t <Derived, Rep * W> replicate (uint16_t Offset) const {
373
373
return replicate_vs_w_hs<Rep, VS, W, HS>(Offset);
374
374
}
375
375
@@ -380,7 +380,8 @@ template <typename Ty, int N, class Derived, class SFINAE> class simd_obj_impl {
380
380
// / \param Offset is offset in number of elements in src region.
381
381
// / \return replicated simd_obj_impl instance.
382
382
template <int Rep, int VS, int W, int HS>
383
- resize_a_simd_type_t <Derived, Rep * W> replicate_vs_w_hs (uint16_t Offset) {
383
+ resize_a_simd_type_t <Derived, Rep * W>
384
+ replicate_vs_w_hs (uint16_t Offset) const {
384
385
return __esimd_rdregion<Ty, N, Rep * W, VS, W, HS, N>(data (),
385
386
Offset * sizeof (Ty));
386
387
}
@@ -390,17 +391,17 @@ template <typename Ty, int N, class Derived, class SFINAE> class simd_obj_impl {
390
391
// /
391
392
// / \return 1 if any element is set, 0 otherwise.
392
393
template <typename T1 = Ty,
393
- typename = sycl::detail ::enable_if_t <std::is_integral<T1>::value>>
394
- uint16_t any () {
394
+ typename = std ::enable_if_t <std::is_integral<T1>::value>>
395
+ uint16_t any () const {
395
396
return __esimd_any<Ty, N>(data ());
396
397
}
397
398
398
399
// / All operation.
399
400
// /
400
401
// / \return 1 if all elements are set, 0 otherwise.
401
402
template <typename T1 = Ty,
402
- typename = sycl::detail ::enable_if_t <std::is_integral<T1>::value>>
403
- uint16_t all () {
403
+ typename = std ::enable_if_t <std::is_integral<T1>::value>>
404
+ uint16_t all () const {
404
405
return __esimd_all<Ty, N>(data ());
405
406
}
406
407
@@ -499,7 +500,7 @@ template <typename Ty, int N, class Derived, class SFINAE> class simd_obj_impl {
499
500
// / elements in this object.
500
501
// / @param addr the memory address to copy from. Must be a pointer to the
501
502
// / global address space, otherwise behavior is undefined.
502
- ESIMD_INLINE void copy_from (const Ty *const addr) SYCL_ESIMD_FUNCTION;
503
+ ESIMD_INLINE void copy_from (const Ty *addr) SYCL_ESIMD_FUNCTION;
503
504
504
505
// / Copy a contiguous block of data from memory into this simd_obj_impl
505
506
// / object. The amount of memory copied equals the total size of vector
@@ -515,7 +516,7 @@ template <typename Ty, int N, class Derived, class SFINAE> class simd_obj_impl {
515
516
// / Copy all vector elements of this object into a contiguous block in memory.
516
517
// / @param addr the memory address to copy to. Must be a pointer to the
517
518
// / global address space, otherwise behavior is undefined.
518
- ESIMD_INLINE void copy_to (Ty *addr) SYCL_ESIMD_FUNCTION;
519
+ ESIMD_INLINE void copy_to (Ty *addr) const SYCL_ESIMD_FUNCTION;
519
520
520
521
// / Copy all vector elements of this object into a contiguous block in memory.
521
522
// / Destination memory location is represented via a global accessor and
@@ -525,7 +526,7 @@ template <typename Ty, int N, class Derived, class SFINAE> class simd_obj_impl {
525
526
template <typename AccessorT>
526
527
ESIMD_INLINE EnableIfAccessor<AccessorT, accessor_mode_cap::can_write,
527
528
sycl::access::target::global_buffer, void >
528
- copy_to (AccessorT acc, uint32_t offset) SYCL_ESIMD_FUNCTION;
529
+ copy_to (AccessorT acc, uint32_t offset) const SYCL_ESIMD_FUNCTION;
529
530
530
531
// / @} // Memory operations
531
532
@@ -634,7 +635,8 @@ template <typename Ty, int N, class Derived, class SFINAE> class simd_obj_impl {
634
635
// ----------- Outlined implementations of simd_obj_impl class APIs.
635
636
636
637
template <typename T, int N, class T1 , class SFINAE >
637
- void simd_obj_impl<T, N, T1, SFINAE>::copy_from(const T *const Addr) {
638
+ void simd_obj_impl<T, N, T1, SFINAE>::copy_from(const T *Addr)
639
+ SYCL_ESIMD_FUNCTION {
638
640
constexpr unsigned Sz = sizeof (T) * N;
639
641
static_assert (Sz >= OperandSize::OWORD,
640
642
" block size must be at least 1 oword" );
@@ -655,7 +657,8 @@ template <typename T, int N, class T1, class SFINAE>
655
657
template <typename AccessorT>
656
658
ESIMD_INLINE EnableIfAccessor<AccessorT, accessor_mode_cap::can_read,
657
659
sycl::access::target::global_buffer, void >
658
- simd_obj_impl<T, N, T1, SFINAE>::copy_from(AccessorT acc, uint32_t offset) {
660
+ simd_obj_impl<T, N, T1, SFINAE>::copy_from(AccessorT acc, uint32_t offset)
661
+ SYCL_ESIMD_FUNCTION {
659
662
constexpr unsigned Sz = sizeof (T) * N;
660
663
static_assert (Sz >= OperandSize::OWORD,
661
664
" block size must be at least 1 oword" );
@@ -675,7 +678,8 @@ simd_obj_impl<T, N, T1, SFINAE>::copy_from(AccessorT acc, uint32_t offset) {
675
678
}
676
679
677
680
template <typename T, int N, class T1 , class SFINAE >
678
- void simd_obj_impl<T, N, T1, SFINAE>::copy_to(T *addr) {
681
+ void simd_obj_impl<T, N, T1, SFINAE>::copy_to(T *addr) const
682
+ SYCL_ESIMD_FUNCTION {
679
683
constexpr unsigned Sz = sizeof (T) * N;
680
684
static_assert (Sz >= OperandSize::OWORD,
681
685
" block size must be at least 1 oword" );
@@ -694,7 +698,8 @@ template <typename T, int N, class T1, class SFINAE>
694
698
template <typename AccessorT>
695
699
ESIMD_INLINE EnableIfAccessor<AccessorT, accessor_mode_cap::can_write,
696
700
sycl::access::target::global_buffer, void >
697
- simd_obj_impl<T, N, T1, SFINAE>::copy_to(AccessorT acc, uint32_t offset) {
701
+ simd_obj_impl<T, N, T1, SFINAE>::copy_to(AccessorT acc, uint32_t offset) const
702
+ SYCL_ESIMD_FUNCTION {
698
703
constexpr unsigned Sz = sizeof (T) * N;
699
704
static_assert (Sz >= OperandSize::OWORD,
700
705
" block size must be at least 1 oword" );
0 commit comments