Skip to content

Commit c96efe1

Browse files
Removing interleaved '__SYCL_DEVICE_ONLY__' in memory_intrin.hpp
- __esimd_surf_read/write
1 parent 7533a83 commit c96efe1

File tree

1 file changed

+34
-24
lines changed

1 file changed

+34
-24
lines changed

sycl/include/sycl/ext/intel/experimental/esimd/detail/memory_intrin.hpp

Lines changed: 34 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -34,15 +34,15 @@ class AccessorPrivateProxy {
3434
static auto getNativeImageObj(const AccessorTy &Acc) {
3535
return Acc.getNativeImageObj();
3636
}
37-
#else
37+
#else // __SYCL_DEVICE_ONLY__
3838
template <typename AccessorTy>
3939
static auto getImageRange(const AccessorTy &Acc) {
4040
return Acc.getAccessRange();
4141
}
4242
static auto getElemSize(const sycl::detail::AccessorBaseHost &Acc) {
4343
return Acc.getElemSize();
4444
}
45-
#endif
45+
#endif // __SYCL_DEVICE_ONLY__
4646
};
4747

4848
template <int ElemsPerAddr,
@@ -165,17 +165,7 @@ template <typename Ty, int N, typename SurfIndAliasTy, int TySizeLog2,
165165
SYCL_EXTERNAL SYCL_ESIMD_FUNCTION __SEIEED::vector_type_t<Ty, N>
166166
__esimd_surf_read(int16_t scale, SurfIndAliasTy surf_ind,
167167
uint32_t global_offset,
168-
__SEIEED::vector_type_t<uint32_t, N> elem_offsets)
169-
#ifdef __SYCL_DEVICE_ONLY__
170-
;
171-
#else
172-
{
173-
static_assert(N == 1 || N == 8 || N == 16);
174-
static_assert(TySizeLog2 <= 2);
175-
static_assert(std::is_integral<Ty>::value || TySizeLog2 == 2);
176-
throw cl::sycl::feature_not_supported();
177-
}
178-
#endif // __SYCL_DEVICE_ONLY__
168+
__SEIEED::vector_type_t<uint32_t, N> elem_offsets);
179169

180170
// Low-level surface-based scatter. Writes elements of a \ref simd object into a
181171
// surface at given offsets. Element can be a 1, 2 or 4-byte value, but it is
@@ -208,17 +198,7 @@ SYCL_EXTERNAL SYCL_ESIMD_FUNCTION void
208198
__esimd_surf_write(__SEIEED::vector_type_t<uint16_t, N> pred, int16_t scale,
209199
SurfIndAliasTy surf_ind, uint32_t global_offset,
210200
__SEIEED::vector_type_t<uint32_t, N> elem_offsets,
211-
__SEIEED::vector_type_t<Ty, N> vals)
212-
#ifdef __SYCL_DEVICE_ONLY__
213-
;
214-
#else
215-
{
216-
static_assert(N == 1 || N == 8 || N == 16);
217-
static_assert(TySizeLog2 <= 2);
218-
static_assert(std::is_integral<Ty>::value || TySizeLog2 == 2);
219-
throw cl::sycl::feature_not_supported();
220-
}
221-
#endif // __SYCL_DEVICE_ONLY__
201+
__SEIEED::vector_type_t<Ty, N> vals);
222202

223203
// TODO bring the parameter order of __esimd* intrinsics in accordance with the
224204
// correponsing BE intrinsicics parameter order.
@@ -519,8 +499,11 @@ __esimd_raw_send_store(uint8_t modifier, uint8_t execSize,
519499
uint8_t numSrc0, uint8_t sfid, uint32_t exDesc,
520500
uint32_t msgDesc,
521501
__SEIEED::vector_type_t<Ty1, N1> msgSrc0);
502+
522503
#ifndef __SYCL_DEVICE_ONLY__
523504

505+
/// ESIMD_CPU Emulation support using esimd_cpu plugin
506+
524507
#define __SYCL_EXPLICIT_SIMD_PLUGIN__
525508

526509
// Header files required for accessing CM-managed memory - Surface,
@@ -816,6 +799,33 @@ inline void __esimd_flat_write4(
816799
}
817800
}
818801

802+
template <typename Ty, int N, typename SurfIndAliasTy, int TySizeLog2,
803+
__SEIEE::CacheHint L1H = __SEIEE::CacheHint::None,
804+
__SEIEE::CacheHint L3H = __SEIEE::CacheHint::None>
805+
SYCL_EXTERNAL SYCL_ESIMD_FUNCTION __SEIEED::vector_type_t<Ty, N>
806+
__esimd_surf_read(int16_t scale, SurfIndAliasTy surf_ind,
807+
uint32_t global_offset,
808+
__SEIEED::vector_type_t<uint32_t, N> elem_offsets) {
809+
static_assert(N == 1 || N == 8 || N == 16);
810+
static_assert(TySizeLog2 <= 2);
811+
static_assert(std::is_integral<Ty>::value || TySizeLog2 == 2);
812+
throw cl::sycl::feature_not_supported();
813+
}
814+
815+
template <typename Ty, int N, typename SurfIndAliasTy, int TySizeLog2,
816+
__SEIEE::CacheHint L1H = __SEIEE::CacheHint::None,
817+
__SEIEE::CacheHint L3H = __SEIEE::CacheHint::None>
818+
SYCL_EXTERNAL SYCL_ESIMD_FUNCTION void
819+
__esimd_surf_write(__SEIEED::vector_type_t<uint16_t, N> pred, int16_t scale,
820+
SurfIndAliasTy surf_ind, uint32_t global_offset,
821+
__SEIEED::vector_type_t<uint32_t, N> elem_offsets,
822+
__SEIEED::vector_type_t<Ty, N> vals) {
823+
static_assert(N == 1 || N == 8 || N == 16);
824+
static_assert(TySizeLog2 <= 2);
825+
static_assert(std::is_integral<Ty>::value || TySizeLog2 == 2);
826+
throw cl::sycl::feature_not_supported();
827+
}
828+
819829
template <typename Ty, int N, __SEIEE::CacheHint L1H, __SEIEE::CacheHint L3H>
820830
inline __SEIEED::vector_type_t<Ty, N>
821831
__esimd_flat_block_read_unaligned(uint64_t addr) {

0 commit comments

Comments
 (0)