Skip to content

Commit cb280ea

Browse files
authored
[SYCL][ESIMD] Rename raw_send{s}_{load/store} APIs (#8666)
These APIs map to raw_send/raw_sends and do not have to do loads or stores. We discussed this with ESIMD customers and decided to rename to raw_send/raw_sends and rely on overloading for return vs no return. The old APIs still work but throw a warning. Tests: intel/llvm-test-suite#1664 Signed-off-by: Sarnie, Nick <[email protected]>
1 parent 1d0ac05 commit cb280ea

File tree

1 file changed

+75
-29
lines changed
  • sycl/include/sycl/ext/intel/experimental/esimd

1 file changed

+75
-29
lines changed

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

Lines changed: 75 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ __ESIMD_API void split_barrier(split_barrier_action flag) {
4343
/// @addtogroup sycl_esimd_raw_send
4444
/// @{
4545

46-
/// Raw sends load. "s" suffix designates "split" variant - i.e. two sources.
46+
/// Raw sends. "s" suffix designates "split" variant - i.e. two sources.
4747
///
4848
/// @param msgDst is the old value of the destination operand.
4949
/// @param msgSrc0 is the first source operand of send message.
@@ -69,12 +69,12 @@ __ESIMD_API void split_barrier(split_barrier_action flag) {
6969
/// @return the vector value read from memory.
7070
template <typename T1, int n1, typename T2, int n2, typename T3, int n3,
7171
int N = 16>
72-
__ESIMD_API __ESIMD_NS::simd<T1, n1> raw_sends_load(
73-
__ESIMD_NS::simd<T1, n1> msgDst, __ESIMD_NS::simd<T2, n2> msgSrc0,
74-
__ESIMD_NS::simd<T3, n3> msgSrc1, uint32_t exDesc, uint32_t msgDesc,
75-
uint8_t execSize, uint8_t sfid, uint8_t numSrc0, uint8_t numSrc1,
76-
uint8_t numDst, uint8_t isEOT = 0, uint8_t isSendc = 0,
77-
__ESIMD_NS::simd_mask<N> mask = 1) {
72+
__ESIMD_API __ESIMD_NS::simd<T1, n1>
73+
raw_sends(__ESIMD_NS::simd<T1, n1> msgDst, __ESIMD_NS::simd<T2, n2> msgSrc0,
74+
__ESIMD_NS::simd<T3, n3> msgSrc1, uint32_t exDesc, uint32_t msgDesc,
75+
uint8_t execSize, uint8_t sfid, uint8_t numSrc0, uint8_t numSrc1,
76+
uint8_t numDst, uint8_t isEOT = 0, uint8_t isSendc = 0,
77+
__ESIMD_NS::simd_mask<N> mask = 1) {
7878
constexpr unsigned _Width1 = n1 * sizeof(T1);
7979
static_assert(_Width1 % 32 == 0, "Invalid size for raw send rspVar");
8080
constexpr unsigned _Width2 = n2 * sizeof(T2);
@@ -88,7 +88,20 @@ __ESIMD_API __ESIMD_NS::simd<T1, n1> raw_sends_load(
8888
msgDesc, msgSrc0.data(), msgSrc1.data(), msgDst.data());
8989
}
9090

91-
/// Raw send load.
91+
template <typename T1, int n1, typename T2, int n2, typename T3, int n3,
92+
int N = 16>
93+
__SYCL_DEPRECATED("raw_sends_load is deprecated. Use raw_sends")
94+
__ESIMD_API __ESIMD_NS::simd<T1, n1> raw_sends_load(
95+
__ESIMD_NS::simd<T1, n1> msgDst, __ESIMD_NS::simd<T2, n2> msgSrc0,
96+
__ESIMD_NS::simd<T3, n3> msgSrc1, uint32_t exDesc, uint32_t msgDesc,
97+
uint8_t execSize, uint8_t sfid, uint8_t numSrc0, uint8_t numSrc1,
98+
uint8_t numDst, uint8_t isEOT = 0, uint8_t isSendc = 0,
99+
__ESIMD_NS::simd_mask<N> mask = 1) {
100+
return raw_sends(msgDst, msgSrc0, msgSrc1, exDesc, msgDesc, execSize, sfid,
101+
numSrc0, numSrc1, numDst, isEOT, isSendc);
102+
}
103+
104+
/// Raw send.
92105
///
93106
/// @param msgDst is the old value of the destination operand.
94107
/// @param msgSrc0 is the first source operand of send message.
@@ -111,10 +124,10 @@ __ESIMD_API __ESIMD_NS::simd<T1, n1> raw_sends_load(
111124
/// @return the vector value read from memory.
112125
template <typename T1, int n1, typename T2, int n2, int N = 16>
113126
__ESIMD_API __ESIMD_NS::simd<T1, n1>
114-
raw_send_load(__ESIMD_NS::simd<T1, n1> msgDst, __ESIMD_NS::simd<T2, n2> msgSrc0,
115-
uint32_t exDesc, uint32_t msgDesc, uint8_t execSize, uint8_t sfid,
116-
uint8_t numSrc0, uint8_t numDst, uint8_t isEOT = 0,
117-
uint8_t isSendc = 0, __ESIMD_NS::simd_mask<N> mask = 1) {
127+
raw_send(__ESIMD_NS::simd<T1, n1> msgDst, __ESIMD_NS::simd<T2, n2> msgSrc0,
128+
uint32_t exDesc, uint32_t msgDesc, uint8_t execSize, uint8_t sfid,
129+
uint8_t numSrc0, uint8_t numDst, uint8_t isEOT = 0,
130+
uint8_t isSendc = 0, __ESIMD_NS::simd_mask<N> mask = 1) {
118131
constexpr unsigned _Width1 = n1 * sizeof(T1);
119132
static_assert(_Width1 % 32 == 0, "Invalid size for raw send rspVar");
120133
constexpr unsigned _Width2 = n2 * sizeof(T2);
@@ -126,7 +139,18 @@ raw_send_load(__ESIMD_NS::simd<T1, n1> msgDst, __ESIMD_NS::simd<T2, n2> msgSrc0,
126139
msgSrc0.data(), msgDst.data());
127140
}
128141

129-
/// Raw sends store. "s" suffix designates "split" variant - i.e. two sources.
142+
template <typename T1, int n1, typename T2, int n2, int N = 16>
143+
__SYCL_DEPRECATED("raw_send_load is deprecated. Use raw_send")
144+
__ESIMD_API __ESIMD_NS::simd<T1, n1> raw_send_load(
145+
__ESIMD_NS::simd<T1, n1> msgDst, __ESIMD_NS::simd<T2, n2> msgSrc0,
146+
uint32_t exDesc, uint32_t msgDesc, uint8_t execSize, uint8_t sfid,
147+
uint8_t numSrc0, uint8_t numDst, uint8_t isEOT = 0, uint8_t isSendc = 0,
148+
__ESIMD_NS::simd_mask<N> mask = 1) {
149+
return raw_send(msgDst, msgSrc0, exDesc, msgDesc, execSize, sfid, numSrc0,
150+
numDst, isEOT, isSendc, mask);
151+
}
152+
153+
/// Raw sends. "s" suffix designates "split" variant - i.e. two sources.
130154
///
131155
/// @param msgSrc0 is the first source operand of send message.
132156
/// @param msgSrc1 is the second source operand of send message.
@@ -148,11 +172,10 @@ raw_send_load(__ESIMD_NS::simd<T1, n1> msgDst, __ESIMD_NS::simd<T2, n2> msgSrc0,
148172
/// to on).
149173
template <typename T1, int n1, typename T2, int n2, int N = 16>
150174
__ESIMD_API void
151-
raw_sends_store(__ESIMD_NS::simd<T1, n1> msgSrc0,
152-
__ESIMD_NS::simd<T2, n2> msgSrc1, uint32_t exDesc,
153-
uint32_t msgDesc, uint8_t execSize, uint8_t sfid,
154-
uint8_t numSrc0, uint8_t numSrc1, uint8_t isEOT = 0,
155-
uint8_t isSendc = 0, __ESIMD_NS::simd_mask<N> mask = 1) {
175+
raw_sends(__ESIMD_NS::simd<T1, n1> msgSrc0, __ESIMD_NS::simd<T2, n2> msgSrc1,
176+
uint32_t exDesc, uint32_t msgDesc, uint8_t execSize, uint8_t sfid,
177+
uint8_t numSrc0, uint8_t numSrc1, uint8_t isEOT = 0,
178+
uint8_t isSendc = 0, __ESIMD_NS::simd_mask<N> mask = 1) {
156179
constexpr unsigned _Width1 = n1 * sizeof(T1);
157180
static_assert(_Width1 % 32 == 0, "Invalid size for raw send msgSrc0");
158181
constexpr unsigned _Width2 = n2 * sizeof(T2);
@@ -164,7 +187,20 @@ raw_sends_store(__ESIMD_NS::simd<T1, n1> msgSrc0,
164187
msgSrc0.data(), msgSrc1.data());
165188
}
166189

167-
/// Raw send store. Generates a \c send or \c sendc instruction for the message
190+
template <typename T1, int n1, typename T2, int n2, int N = 16>
191+
__SYCL_DEPRECATED("raw_sends_store is deprecated. Use raw_sends")
192+
__ESIMD_API
193+
void raw_sends_store(__ESIMD_NS::simd<T1, n1> msgSrc0,
194+
__ESIMD_NS::simd<T2, n2> msgSrc1, uint32_t exDesc,
195+
uint32_t msgDesc, uint8_t execSize, uint8_t sfid,
196+
uint8_t numSrc0, uint8_t numSrc1, uint8_t isEOT = 0,
197+
uint8_t isSendc = 0,
198+
__ESIMD_NS::simd_mask<N> mask = 1) {
199+
raw_sends(msgSrc0, msgSrc1, exDesc, msgDesc, execSize, sfid, numSrc0, numSrc1,
200+
isEOT, isSendc, mask);
201+
}
202+
203+
/// Raw send. Generates a \c send or \c sendc instruction for the message
168204
/// gateway.
169205
///
170206
/// @param msgSrc0 is the first source operand of send message.
@@ -183,11 +219,10 @@ raw_sends_store(__ESIMD_NS::simd<T1, n1> msgSrc0,
183219
/// @param mask is the predicate to specify enabled channels (optional - default
184220
/// to on).
185221
template <typename T1, int n1, int N = 16>
186-
__ESIMD_API void raw_send_store(__ESIMD_NS::simd<T1, n1> msgSrc0,
187-
uint32_t exDesc, uint32_t msgDesc,
188-
uint8_t execSize, uint8_t sfid, uint8_t numSrc0,
189-
uint8_t isEOT = 0, uint8_t isSendc = 0,
190-
__ESIMD_NS::simd_mask<N> mask = 1) {
222+
__ESIMD_API void
223+
raw_send(__ESIMD_NS::simd<T1, n1> msgSrc0, uint32_t exDesc, uint32_t msgDesc,
224+
uint8_t execSize, uint8_t sfid, uint8_t numSrc0, uint8_t isEOT = 0,
225+
uint8_t isSendc = 0, __ESIMD_NS::simd_mask<N> mask = 1) {
191226
constexpr unsigned _Width1 = n1 * sizeof(T1);
192227
static_assert(_Width1 % 32 == 0, "Invalid size for raw send msgSrc0");
193228

@@ -197,6 +232,17 @@ __ESIMD_API void raw_send_store(__ESIMD_NS::simd<T1, n1> msgSrc0,
197232
msgSrc0.data());
198233
}
199234

235+
template <typename T1, int n1, int N = 16>
236+
__SYCL_DEPRECATED("raw_send_store is deprecated. Use raw_send")
237+
__ESIMD_API
238+
void raw_send_store(__ESIMD_NS::simd<T1, n1> msgSrc0, uint32_t exDesc,
239+
uint32_t msgDesc, uint8_t execSize, uint8_t sfid,
240+
uint8_t numSrc0, uint8_t isEOT = 0, uint8_t isSendc = 0,
241+
__ESIMD_NS::simd_mask<N> mask = 1) {
242+
raw_send(msgSrc0, exDesc, msgDesc, execSize, sfid, numSrc0, isEOT, isSendc,
243+
mask);
244+
}
245+
200246
/// @} sycl_esimd_raw_send
201247

202248
#endif // !__ESIMD_FORCE_STATELESS_MEM
@@ -2394,8 +2440,8 @@ ESIMD_INLINE SYCL_ESIMD_FUNCTION __ESIMD_NS::simd<T, N> lsc_load_2d(
23942440
constexpr uint8_t sfid = 0xF;
23952441
constexpr uint8_t numSrc0 = 0x1;
23962442
constexpr uint8_t numDst = (N * sizeof(T)) / 64;
2397-
return raw_send_load(oldDst, payload.get_raw_data(), exDesc, desc, execSize,
2398-
sfid, numSrc0, numDst);
2443+
return raw_send(oldDst, payload.get_raw_data(), exDesc, desc, execSize, sfid,
2444+
numSrc0, numDst);
23992445
}
24002446

24012447
/// A variation of \c 2D stateless block prefetch \c with parameters passed as
@@ -2437,7 +2483,7 @@ ESIMD_INLINE SYCL_ESIMD_FUNCTION void lsc_prefetch_2d(
24372483
constexpr uint8_t execSize = 0x0;
24382484
constexpr uint8_t sfid = 0xF;
24392485
constexpr uint8_t numDst = (N * sizeof(T)) / 64;
2440-
raw_send_store(payload.get_raw_data(), exDesc, desc, execSize, sfid, numDst);
2486+
raw_send(payload.get_raw_data(), exDesc, desc, execSize, sfid, numDst);
24412487
}
24422488

24432489
/// A variation of \c 2D stateless block store \c with parameters passed as
@@ -2476,8 +2522,8 @@ lsc_store_2d(config_2d_mem_access<T, BlockWidth, BlockHeight, NBlocks> &payload,
24762522
constexpr uint8_t sfid = 0xF;
24772523
constexpr uint8_t numSrc0 = 0x1;
24782524
constexpr uint8_t numSrc1 = (N * sizeof(T)) / 64;
2479-
raw_sends_store(payload.get_raw_data(), Data, exDesc, desc, execSize, sfid,
2480-
numSrc0, numSrc1);
2525+
raw_sends(payload.get_raw_data(), Data, exDesc, desc, execSize, sfid, numSrc0,
2526+
numSrc1);
24812527
}
24822528

24832529
/// SLM atomic.

0 commit comments

Comments
 (0)