@@ -330,13 +330,11 @@ class [[__sycl_detail__::__uses_aspects__(
330
330
// / argument.
331
331
// / @param acc The accessor to read from.
332
332
// / @param offset offset in bytes of the first element.
333
- template <typename AccessorT, typename Flags = element_aligned_tag,
334
- typename = std::enable_if_t <
335
- (sycl::detail::acc_properties::is_local_accessor_v<AccessorT> ||
336
- detail::is_sycl_accessor_with<
337
- AccessorT, accessor_mode_cap::can_read,
338
- sycl::access::target::device>::value) &&
339
- is_simd_flag_type_v<Flags>>>
333
+ template <
334
+ typename AccessorT, typename Flags = element_aligned_tag,
335
+ typename = std::enable_if_t <
336
+ detail::is_accessor_with_v<AccessorT, accessor_mode_cap::can_read> &&
337
+ is_simd_flag_type_v<Flags>>>
340
338
simd_obj_impl (AccessorT acc,
341
339
#ifdef __ESIMD_FORCE_STATELESS_MEM
342
340
uint64_t offset,
@@ -744,8 +742,7 @@ class [[__sycl_detail__::__uses_aspects__(
744
742
template <typename AccessorT, typename Flags = element_aligned_tag,
745
743
int ChunkSize = 32 ,
746
744
typename = std::enable_if_t <is_simd_flag_type_v<Flags>>>
747
- ESIMD_INLINE EnableIfAccessor<AccessorT, accessor_mode_cap::can_read,
748
- sycl::access::target::device, void >
745
+ ESIMD_INLINE EnableIfAccessor<AccessorT, accessor_mode_cap::can_read, void >
749
746
copy_from (AccessorT acc,
750
747
#ifdef __ESIMD_FORCE_STATELESS_MEM
751
748
uint64_t offset,
@@ -754,6 +751,25 @@ class [[__sycl_detail__::__uses_aspects__(
754
751
#endif
755
752
Flags = {}) SYCL_ESIMD_FUNCTION;
756
753
754
+ // / Copy a contiguous block of data from memory into this simd_obj_impl
755
+ // / object. The amount of memory copied equals the total size of vector
756
+ // / elements in this object. Source memory location is represented via a
757
+ // / local accessor and offset.
758
+ // / None of the template parameters except documented ones can/should be
759
+ // / specified by callers.
760
+ // / @tparam AccessorT Type of the accessor (auto-deduced).
761
+ // / @tparam Flags Alignment control for the copy operation.
762
+ // / See @ref sycl_esimd_core_align for more info.
763
+ // / @param acc accessor to copy from.
764
+ // / @param offset offset to copy from (in bytes).
765
+ template <typename AccessorT, typename Flags = element_aligned_tag,
766
+ int ChunkSize = 32 ,
767
+ typename = std::enable_if_t <is_simd_flag_type_v<Flags>>>
768
+ ESIMD_INLINE std::enable_if_t <
769
+ detail::is_local_accessor_with_v<AccessorT, accessor_mode_cap::can_read>,
770
+ void >
771
+ copy_from (AccessorT acc, uint32_t offset, Flags = {}) SYCL_ESIMD_FUNCTION;
772
+
757
773
// / Copy all vector elements of this object into a contiguous block in memory.
758
774
// / None of the template parameters should be be specified by callers.
759
775
// / @tparam Flags Alignment control for the copy operation.
@@ -776,8 +792,7 @@ class [[__sycl_detail__::__uses_aspects__(
776
792
template <typename AccessorT, typename Flags = element_aligned_tag,
777
793
int ChunkSize = 32 ,
778
794
typename = std::enable_if_t <is_simd_flag_type_v<Flags>>>
779
- ESIMD_INLINE EnableIfAccessor<AccessorT, accessor_mode_cap::can_write,
780
- sycl::access::target::device, void >
795
+ ESIMD_INLINE EnableIfAccessor<AccessorT, accessor_mode_cap::can_write, void >
781
796
copy_to (AccessorT acc,
782
797
#ifdef __ESIMD_FORCE_STATELESS_MEM
783
798
uint64_t offset,
@@ -786,6 +801,23 @@ class [[__sycl_detail__::__uses_aspects__(
786
801
#endif
787
802
Flags = {}) const SYCL_ESIMD_FUNCTION;
788
803
804
+ // / Copy all vector elements of this object into a contiguous block in memory.
805
+ // / Destination memory location is represented via a local accessor and
806
+ // / offset.
807
+ // / None of the template parameters should be be specified by callers.
808
+ // / @tparam AccessorT Type of the accessor (auto-deduced).
809
+ // / @tparam Flags Alignment control for the copy operation.
810
+ // / See @ref sycl_esimd_core_align for more info.
811
+ // / @param acc accessor to copy from.
812
+ // / @param offset offset to copy from.
813
+ template <typename AccessorT, typename Flags = element_aligned_tag,
814
+ int ChunkSize = 32 ,
815
+ typename = std::enable_if_t <is_simd_flag_type_v<Flags>>>
816
+ ESIMD_INLINE std::enable_if_t <
817
+ detail::is_local_accessor_with_v<AccessorT, accessor_mode_cap::can_write>,
818
+ void >
819
+ copy_to (AccessorT acc, uint32_t offset, Flags = {}) const SYCL_ESIMD_FUNCTION;
820
+
789
821
// Unary operations.
790
822
791
823
// / Per-element bitwise inversion, available in all subclasses, but only for
@@ -916,6 +948,13 @@ class [[__sycl_detail__::__uses_aspects__(
916
948
// The underlying data for this vector.
917
949
raw_vector_type M_data;
918
950
951
+ template <int ChunkSize, typename Flags, typename AccessorT, typename TOffset>
952
+ ESIMD_INLINE void copy_to_impl (AccessorT acc,
953
+ TOffset offset) const SYCL_ESIMD_FUNCTION;
954
+ template <int ChunkSize, typename Flags, typename AccessorT, typename TOffset>
955
+ ESIMD_INLINE void copy_from_impl (AccessorT acc,
956
+ TOffset offset) SYCL_ESIMD_FUNCTION;
957
+
919
958
protected:
920
959
// The test proxy if enabled
921
960
__ESIMD_DECLARE_TEST_PROXY
0 commit comments