Skip to content

Commit 5ead0cb

Browse files
Removed 1- and 2-byte support for now
1 parent 1f89573 commit 5ead0cb

File tree

2 files changed

+8
-60
lines changed

2 files changed

+8
-60
lines changed

sycl/include/sycl/ext/intel/experimental/esimd/memory.hpp

Lines changed: 4 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -649,8 +649,8 @@ inline ESIMD_NODEBUG void esimd_sbarrier(split_barrier_action flag) {
649649
/// Declare per-work-group slm size.
650650
SYCL_EXTERNAL SYCL_ESIMD_FUNCTION void slm_init(uint32_t size);
651651

652-
/// SLM gather (version for 4-byte block size).
653-
/// \tparam T element type of the input vector.
652+
/// SLM gather.
653+
/// \tparam T element type of the input vector, must be 4-byte type.
654654
/// \tparam N size of the \p offsets , \p pred and returned vectors. Must be 16
655655
/// or 32.
656656
/// @param offsets byte-offsets within the SLM.
@@ -665,26 +665,8 @@ ESIMD_INLINE ESIMD_NODEBUG
665665
return __esimd_slm_read<T, N>(offsets.data(), pred.data());
666666
}
667667

668-
/// SLM gather (version for 1- and 2-byte block size).
669-
/// \tparam T element type of the input vector.
670-
/// \tparam N size of the \p offsets , \p pred and returned vectors. Must be 16
671-
/// or 32.
672-
/// @param offsets byte-offsets within the SLM.
673-
/// @param pred predication control used for masking lanes.
674-
/// @return vector of read values of type \p T.
675-
/// \ingroup sycl_esimd
676-
template <typename T, int N>
677-
ESIMD_INLINE ESIMD_NODEBUG typename sycl::detail::enable_if_t<
678-
(N == 16 || N == 32) && (sizeof(T) == 1 || sizeof(T) == 2), simd<T, N>>
679-
slm_load(simd<uint32_t, N> offsets, simd<uint16_t, N> pred = 1) {
680-
typedef typename detail::dword_type<T>::type T1;
681-
simd<T1, N> temp = __esimd_slm_read<T1, N>(offsets.data(), pred.data());
682-
simd<T, N> res = temp;
683-
return res;
684-
}
685-
686-
/// SLM scatter (version for 4-byte block size).
687-
/// \tparam T element type of the input vector.
668+
/// SLM scatter.
669+
/// \tparam T element type of the input vector, must be 4-byte type.
688670
/// \tparam N size of the \p offsets , \p pred and \p vals vectors. Must be 16
689671
/// or 32.
690672
/// @param vals values to be written.
@@ -700,24 +682,6 @@ ESIMD_INLINE ESIMD_NODEBUG
700682
__esimd_slm_write<T, N>(offsets.data(), vals.data(), pred.data());
701683
}
702684

703-
/// SLM scatter (version for 1- and 2-byte block size).
704-
/// \tparam T element type of the input vector.
705-
/// \tparam N size of the \p offsets , \p pred and \p vals vectors. Must be 16
706-
/// or 32.
707-
/// @param vals values to be written.
708-
/// @param offsets byte-offsets within the SLM.
709-
/// @param pred predication control used for masking lanes.
710-
/// \ingroup sycl_esimd
711-
template <typename T, int N>
712-
ESIMD_INLINE ESIMD_NODEBUG typename sycl::detail::enable_if_t<
713-
(N == 16 || N == 32) && (sizeof(T) == 1 || sizeof(T) == 2), void>
714-
slm_store(simd<T, N> vals, simd<uint32_t, N> offsets,
715-
simd<uint16_t, N> pred = 1) {
716-
typedef typename detail::dword_type<T>::type T1;
717-
simd<T1, N> temp = vals;
718-
__esimd_slm_write<T1, N>(offsets.data(), temp.data(), pred.data());
719-
}
720-
721685
/// SLM gather4.
722686
///
723687
/// Only allow simd-8, simd-16 and simd-32.

sycl/test/esimd/slm_load.cpp

Lines changed: 4 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@ void kernel() __attribute__((sycl_device)) {
1313
simd<int, 32> v1(0, 1);
1414

1515
auto v0 = slm_load<int, 32>(offsets);
16+
auto v2 = slm_load<float, 32>(offsets);
17+
// expected-error@+2 {{no matching function for call to 'slm_load'}}
18+
// expected-note@sycl/ext/intel/experimental/esimd/memory.hpp:* {{candidate template ignored}}
19+
auto v3 = slm_load<double, 32>(offsets);
1620

1721
esimd_fence(3);
1822
esimd_barrier();
@@ -21,23 +25,3 @@ void kernel() __attribute__((sycl_device)) {
2125

2226
slm_store<int, 32>(v0, offsets);
2327
}
24-
25-
void slm_supported_types() __attribute__((sycl_device)) {
26-
simd<uint32_t, 32> offsets(0, 1);
27-
auto v1 = slm_load<char, 32>(offsets);
28-
auto v2 = slm_load<short, 32>(offsets);
29-
auto v3 = slm_load<int, 32>(offsets);
30-
auto v4 = slm_load<float, 32>(offsets);
31-
// expected-error@+2 {{no matching function for call to 'slm_load'}}
32-
// expected-note@sycl/ext/intel/experimental/esimd/memory.hpp:* 2 {{candidate template ignored}}
33-
auto v5 = slm_load<double, 32>(offsets);
34-
35-
slm_store<char, 32>(v1, offsets);
36-
slm_store<short, 32>(v2, offsets);
37-
slm_store<int, 32>(v3, offsets);
38-
slm_store<float, 32>(v4, offsets);
39-
simd<double, 32> v6(0, 1);
40-
// expected-error@+2 {{no matching function for call to 'slm_store'}}
41-
// expected-note@sycl/ext/intel/experimental/esimd/memory.hpp:* 2 {{candidate template ignored}}
42-
slm_store<double, 32>(v6, offsets);
43-
}

0 commit comments

Comments
 (0)