Skip to content

Commit ca15170

Browse files
[ESIMD] rename slm_load4/slm_store4 to slm_load_rgba/slm_store_rgba
1 parent 15e0ab1 commit ca15170

File tree

2 files changed

+56
-17
lines changed

2 files changed

+56
-17
lines changed

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

Lines changed: 46 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -668,24 +668,63 @@ ESIMD_INLINE ESIMD_NODEBUG
668668
__esimd_slm_write<T, n>(offsets.data(), vals.data(), pred.data());
669669
}
670670

671+
/// Gathering read from the SLM given specified \p offsets.
672+
/// Up to 4 data elements may be accessed at each address depending on the
673+
/// enabled channel \p Mask.
674+
/// \tparam T element type of the returned vector. Must be 4-byte.
675+
/// \tparam N size of the \p offsets vector. Must be 8, 16 or 32.
676+
/// \tparam Mask represents a pixel's channel mask.
677+
/// @param offsets byte-offsets within the SLM.
678+
/// @param pred predication control used for masking lanes.
679+
/// \ingroup sycl_esimd
680+
template <typename T, int N, rgba_channel_mask Mask>
681+
ESIMD_INLINE ESIMD_NODEBUG typename sycl::detail::enable_if_t<
682+
(N == 8 || N == 16 || N == 32) && (sizeof(T) == 4),
683+
simd<T, N * get_num_channels_enabled(Mask)>>
684+
slm_load_rgba(simd<uint32_t, N> offsets, simd<uint16_t, N> pred = 1) {
685+
return __esimd_slm_read4<T, N, Mask>(offsets.data(), pred.data());
686+
}
687+
671688
/// SLM gather4.
672689
///
673690
/// Only allow simd-8, simd-16 and simd-32.
674691
template <typename T, int n, rgba_channel_mask Mask>
692+
__SYCL_DEPRECATED("use slm_load_rgba.")
675693
ESIMD_INLINE ESIMD_NODEBUG typename sycl::detail::enable_if_t<
676694
(n == 8 || n == 16 || n == 32) && (sizeof(T) == 4),
677-
simd<T, n * get_num_channels_enabled(Mask)>>
678-
slm_load4(simd<uint32_t, n> offsets, simd<uint16_t, n> pred = 1) {
679-
return __esimd_slm_read4<T, n, Mask>(offsets.data(), pred.data());
695+
simd<T, n * get_num_channels_enabled(Mask)>> slm_load4(simd<uint32_t, n>
696+
offsets,
697+
simd<uint16_t, n>
698+
pred = 1) {
699+
return slm_load_rgba<T, n, Mask>(offsets, pred);
700+
}
701+
702+
/// Scatter write to the SLM given specified \p offsets.
703+
/// Up to 4 data elements may be written at each address depending on the
704+
/// enabled channel \p Mask.
705+
/// \tparam T element type of the input vector. Must be 4-byte.
706+
/// \tparam N size of the \p offsets vector. Must be 8, 16 or 32.
707+
/// \tparam Mask represents a pixel's channel mask.
708+
/// @param vals values to be written.
709+
/// @param offsets byte-offsets within the SLM.
710+
/// @param pred predication control used for masking lanes.
711+
/// \ingroup sycl_esimd
712+
template <typename T, int N, rgba_channel_mask Mask>
713+
ESIMD_INLINE ESIMD_NODEBUG typename sycl::detail::enable_if_t<
714+
(N == 8 || N == 16 || N == 32) && (sizeof(T) == 4), void>
715+
slm_store_rgba(simd<T, N * get_num_channels_enabled(Mask)> vals,
716+
simd<uint32_t, N> offsets, simd<uint16_t, N> pred = 1) {
717+
__esimd_slm_write4<T, N, Mask>(offsets.data(), vals.data(), pred.data());
680718
}
681719

682720
/// SLM scatter4.
683721
template <typename T, int n, rgba_channel_mask Mask>
722+
__SYCL_DEPRECATED("use slm_store_rgba.")
684723
ESIMD_INLINE ESIMD_NODEBUG typename sycl::detail::enable_if_t<
685-
(n == 8 || n == 16 || n == 32) && (sizeof(T) == 4), void>
686-
slm_store4(simd<T, n * get_num_channels_enabled(Mask)> vals,
687-
simd<uint32_t, n> offsets, simd<uint16_t, n> pred = 1) {
688-
__esimd_slm_write4<T, n, Mask>(offsets.data(), vals.data(), pred.data());
724+
(n == 8 || n == 16 || n == 32) && (sizeof(T) == 4),
725+
void> slm_store4(simd<T, n * get_num_channels_enabled(Mask)> vals,
726+
simd<uint32_t, n> offsets, simd<uint16_t, n> pred = 1) {
727+
slm_store_rgba<T, n, Mask>(vals, offsets, pred);
689728
}
690729

691730
/// SLM block-load.
Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// RUN: %clangxx -fsycl -fsyntax-only -Wno-unused-command-line-argument %s 2>&1 | FileCheck %s --implicit-check-not="warning:" --implicit-check-not="error:"
22

3-
// This test checks compilation of ESIMD slm load4/store4 APIs. Those which are
4-
// deprecated must produce deprecation messages.
3+
// This test checks compilation of ESIMD slm_load_rgba/slm_store_rgba APIs.
4+
// Those which are deprecated must produce deprecation messages.
55

66
#include <sycl/ext/intel/experimental/esimd.hpp>
77

@@ -14,22 +14,22 @@ void caller() SYCL_ESIMD_FUNCTION {
1414

1515
slm_init(1024);
1616

17-
// CHECK: slm_load4.cpp:19{{.*}}warning: 'ESIMD_ABGR_ENABLE' is deprecated
17+
// CHECK: slm_load_store_rgba.cpp:19{{.*}}warning: 'ESIMD_ABGR_ENABLE' is deprecated
1818
// CHECK: sycl/ext/intel/experimental/esimd/common.hpp:{{.*}}note:
19-
auto v0 = slm_load4<int, 32, ESIMD_ABGR_ENABLE>(offsets);
20-
v0 = slm_load4<int, 32, rgba_channel_mask::ABGR>(offsets);
19+
auto v0 = slm_load_rgba<int, 32, ESIMD_ABGR_ENABLE>(offsets);
20+
v0 = slm_load_rgba<int, 32, rgba_channel_mask::ABGR>(offsets);
2121

2222
v0 = v0 + v1;
2323

24-
// CHECK: slm_load4.cpp:26{{.*}}warning: 'ESIMD_ABGR_ENABLE' is deprecated
24+
// CHECK: slm_load_store_rgba.cpp:26{{.*}}warning: 'ESIMD_ABGR_ENABLE' is deprecated
2525
// CHECK: sycl/ext/intel/experimental/esimd/common.hpp:{{.*}}note:
26-
slm_store4<int, 32, ESIMD_ABGR_ENABLE>(v0, offsets);
27-
slm_store4<int, 32, rgba_channel_mask::ABGR>(v0, offsets);
26+
slm_store_rgba<int, 32, ESIMD_ABGR_ENABLE>(v0, offsets);
27+
slm_store_rgba<int, 32, rgba_channel_mask::ABGR>(v0, offsets);
2828
}
2929

3030
// A "border" between host and device compilations
3131
// CHECK-LABEL: 2 warnings generated
32-
// CHECK: slm_load4.cpp:19{{.*}}warning: 'ESIMD_ABGR_ENABLE' is deprecated
32+
// CHECK: slm_load_store_rgba.cpp:19{{.*}}warning: 'ESIMD_ABGR_ENABLE' is deprecated
3333
// CHECK: sycl/ext/intel/experimental/esimd/common.hpp:{{.*}}note:
34-
// CHECK: slm_load4.cpp:26{{.*}}warning: 'ESIMD_ABGR_ENABLE' is deprecated
34+
// CHECK: slm_load_store_rgba.cpp:26{{.*}}warning: 'ESIMD_ABGR_ENABLE' is deprecated
3535
// CHECK: sycl/ext/intel/experimental/esimd/common.hpp:{{.*}}note:

0 commit comments

Comments
 (0)