@@ -2313,6 +2313,170 @@ scatter_rgba(AccessorT acc, simd<uint32_t, N> offsets,
2313
2313
__ESIMD_DNS::localAccessorToOffset (acc),
2314
2314
vals, mask);
2315
2315
}
2316
+
2317
+ // / @addtogroup sycl_esimd_raw_send
2318
+ // / @{
2319
+
2320
+ // / Raw sends. "s" suffix designates "split" variant - i.e. two sources.
2321
+ // / This is a low-level API not recommended for general usage.
2322
+ // /
2323
+ // / @tparam exec_size is the execution size.
2324
+ // / @tparam sfid is the shared function ID.
2325
+ // / @tparam num_src0 is the number of GRFs for source-0.
2326
+ // / @tparam num_src1 is the number of GRFs for source-1.
2327
+ // / @tparam num_dst is the number of GRFs for destination.
2328
+ // / @tparam eot is the flag that indicates whether this is an EOT message
2329
+ // / (optional - default to off).
2330
+ // / @tparam sendc is the flag that indicates whether sendc should be used
2331
+ // / (optional - default to off).
2332
+ // / @param msg_dst is the old value of the destination operand.
2333
+ // / @param msg_src0 is the first source operand of send message.
2334
+ // / @param msg_src1 is the second source operand of send message.
2335
+ // / @param ex_desc is the extended message descriptor.
2336
+ // / @param msg_desc is the message descriptor.
2337
+ // / @param mask is the predicate to specify enabled channels (optional - default
2338
+ // / to on).
2339
+ // / @return the vector value read from memory.
2340
+ template <uint8_t exec_size, uint8_t sfid, uint8_t num_src0, uint8_t num_src1,
2341
+ uint8_t num_dst, raw_send_eot eot = raw_send_eot::not_eot,
2342
+ raw_send_sendc sendc = raw_send_sendc::not_sendc, typename T1, int n1,
2343
+ typename T2, int n2, typename T3, int n3>
2344
+ __ESIMD_API __ESIMD_NS::simd<T1, n1>
2345
+ raw_sends (__ESIMD_NS::simd<T1, n1> msg_dst, __ESIMD_NS::simd<T2, n2> msg_src0,
2346
+ __ESIMD_NS::simd<T3, n3> msg_src1, uint32_t ex_desc,
2347
+ uint32_t msg_desc, __ESIMD_NS::simd_mask<exec_size> mask = 1 ) {
2348
+ constexpr unsigned _Width1 = n1 * sizeof (T1);
2349
+ static_assert (_Width1 % 32 == 0 , " Invalid size for raw send rspVar" );
2350
+ constexpr unsigned _Width2 = n2 * sizeof (T2);
2351
+ static_assert (_Width2 % 32 == 0 , " Invalid size for raw send msg_src0" );
2352
+ constexpr unsigned _Width3 = n3 * sizeof (T3);
2353
+ static_assert (_Width3 % 32 == 0 , " Invalid size for raw send msg_src1" );
2354
+
2355
+ using ElemT1 = __ESIMD_DNS::__raw_t <T1>;
2356
+ using ElemT2 = __ESIMD_DNS::__raw_t <T2>;
2357
+ using ElemT3 = __ESIMD_DNS::__raw_t <T3>;
2358
+
2359
+ constexpr uint8_t modifier =
2360
+ ((eot == raw_send_eot::eot) << 1 ) | (sendc == raw_send_sendc::sendc);
2361
+
2362
+ return __esimd_raw_sends2<ElemT1, n1, ElemT2, n2, ElemT3, n3, exec_size>(
2363
+ modifier, exec_size, mask.data (), num_src0, num_src1, num_dst, sfid,
2364
+ ex_desc, msg_desc, msg_src0.data (), msg_src1.data (), msg_dst.data ());
2365
+ }
2366
+
2367
+ // / Raw send. This is a low-level API not recommended for general usage.
2368
+ // /
2369
+ // / @tparam exec_size is the execution size.
2370
+ // / @tparam sfid is the shared function ID.
2371
+ // / @tparam num_src0 is the number of GRFs for source-0.
2372
+ // / @tparam num_dst is the number of GRFs for destination.
2373
+ // / @tparam eot is the flag that indicates whether this is an EOT message
2374
+ // / (optional - default to off).
2375
+ // / @tparam sendc is the flag that indicates whether sendc should be used
2376
+ // / (optional - default to off).
2377
+ // / @param msg_dst is the old value of the destination operand.
2378
+ // / @param msg_src0 is the first source operand of send message.
2379
+ // / @param ex_desc is the extended message descriptor.
2380
+ // / @param msg_desc is the message descriptor.
2381
+ // / @param mask is the predicate to specify enabled channels (optional - default
2382
+ // / to on).
2383
+ // / @return the vector value read from memory
2384
+ template <uint8_t exec_size, uint8_t sfid, uint8_t num_src0, uint8_t num_dst,
2385
+ raw_send_eot eot = raw_send_eot::not_eot,
2386
+ raw_send_sendc sendc = raw_send_sendc::not_sendc, typename T1, int n1,
2387
+ typename T2, int n2>
2388
+ __ESIMD_API __ESIMD_NS::simd<T1, n1>
2389
+ raw_send (__ESIMD_NS::simd<T1, n1> msg_dst, __ESIMD_NS::simd<T2, n2> msg_src0,
2390
+ uint32_t ex_desc, uint32_t msg_desc,
2391
+ __ESIMD_NS::simd_mask<exec_size> mask = 1 ) {
2392
+ constexpr unsigned _Width1 = n1 * sizeof (T1);
2393
+ static_assert (_Width1 % 32 == 0 , " Invalid size for raw send rspVar" );
2394
+ constexpr unsigned _Width2 = n2 * sizeof (T2);
2395
+ static_assert (_Width2 % 32 == 0 , " Invalid size for raw send msg_src0" );
2396
+
2397
+ using ElemT1 = __ESIMD_DNS::__raw_t <T1>;
2398
+ using ElemT2 = __ESIMD_DNS::__raw_t <T2>;
2399
+
2400
+ constexpr uint8_t modifier =
2401
+ ((eot == raw_send_eot::eot) << 1 ) | (sendc == raw_send_sendc::sendc);
2402
+ return __esimd_raw_send2<ElemT1, n1, ElemT2, n2, exec_size>(
2403
+ modifier, exec_size, mask.data (), num_src0, num_dst, sfid, ex_desc,
2404
+ msg_desc, msg_src0.data (), msg_dst.data ());
2405
+ }
2406
+
2407
+ // / Raw sends. "s" suffix designates "split" variant - i.e. two sources.
2408
+ // / This is a low-level API not recommended for general usage.
2409
+ // /
2410
+ // / @tparam exec_size is the execution size.
2411
+ // / @tparam sfid is the shared function ID.
2412
+ // / @tparam num_src0 is the number of GRFs for source-0.
2413
+ // / @tparam num_src1 is the number of GRFs for source-1.
2414
+ // / @tparam eot is the flag that indicates whether this is an EOT message
2415
+ // / (optional - default to off).
2416
+ // / @tparam sendc is the flag that indicates whether sendc should be used
2417
+ // / (optional - default to off).
2418
+ // / @param msg_src0 is the first source operand of send message.
2419
+ // / @param msg_src1 is the second source operand of send message.
2420
+ // / @param ex_desc is the extended message descriptor.
2421
+ // / @param msg_desc is the message descriptor.
2422
+ // / @param mask is the predicate to specify enabled channels (optional - default
2423
+ // / to on).
2424
+ template <uint8_t exec_size, uint8_t sfid, uint8_t num_src0, uint8_t num_src1,
2425
+ raw_send_eot eot = raw_send_eot::not_eot,
2426
+ raw_send_sendc sendc = raw_send_sendc::not_sendc, typename T1, int n1,
2427
+ typename T2, int n2>
2428
+ __ESIMD_API void raw_sends (__ESIMD_NS::simd<T1, n1> msg_src0,
2429
+ __ESIMD_NS::simd<T2, n2> msg_src1, uint32_t ex_desc,
2430
+ uint32_t msg_desc,
2431
+ __ESIMD_NS::simd_mask<exec_size> mask = 1 ) {
2432
+ constexpr unsigned _Width1 = n1 * sizeof (T1);
2433
+ static_assert (_Width1 % 32 == 0 , " Invalid size for raw send msg_src0" );
2434
+ constexpr unsigned _Width2 = n2 * sizeof (T2);
2435
+ static_assert (_Width2 % 32 == 0 , " Invalid size for raw send msg_src1" );
2436
+
2437
+ using ElemT1 = __ESIMD_DNS::__raw_t <T1>;
2438
+ using ElemT2 = __ESIMD_DNS::__raw_t <T2>;
2439
+
2440
+ constexpr uint8_t modifier =
2441
+ ((eot == raw_send_eot::eot) << 1 ) | (sendc == raw_send_sendc::sendc);
2442
+ __esimd_raw_sends2_noresult<ElemT1, n1, ElemT2, n2, exec_size>(
2443
+ modifier, exec_size, mask.data (), num_src0, num_src1, sfid, ex_desc,
2444
+ msg_desc, msg_src0.data (), msg_src1.data ());
2445
+ }
2446
+
2447
+ // / Raw send. Generates a \c send or \c sendc instruction for the message
2448
+ // / gateway. This is a low-level API not recommended for general usage.
2449
+ // /
2450
+ // / @tparam exec_size is the execution size.
2451
+ // / @tparam sfid is the shared function ID.
2452
+ // / @tparam num_src0 is the number of GRFs for source-0.
2453
+ // / @tparam eot is the flag that indicates whether this is an EOT message
2454
+ // / (optional - default to off).
2455
+ // / @tparam sendc is the flag that indicates whether sendc should be used
2456
+ // / (optional - default to off).
2457
+ // / @param msg_src0 is the first source operand of send message.
2458
+ // / @param ex_desc is the extended message descriptor.
2459
+ // / @param msg_desc is the message descriptor.
2460
+ // / @param mask is the predicate to specify enabled channels (optional - default
2461
+ // / to on).
2462
+ template <uint8_t exec_size, uint8_t sfid, uint8_t num_src0,
2463
+ raw_send_eot eot = raw_send_eot::not_eot,
2464
+ raw_send_sendc sendc = raw_send_sendc::not_sendc, typename T1, int n1>
2465
+ __ESIMD_API void raw_send (__ESIMD_NS::simd<T1, n1> msg_src0, uint32_t ex_desc,
2466
+ uint32_t msg_desc,
2467
+ __ESIMD_NS::simd_mask<exec_size> mask = 1 ) {
2468
+ constexpr unsigned _Width1 = n1 * sizeof (T1);
2469
+ static_assert (_Width1 % 32 == 0 , " Invalid size for raw send msg_src0" );
2470
+ using ElemT1 = __ESIMD_DNS::__raw_t <T1>;
2471
+ constexpr uint8_t modifier =
2472
+ ((eot == raw_send_eot::eot) << 1 ) | (sendc == raw_send_sendc::sendc);
2473
+ __esimd_raw_send2_noresult<ElemT1, n1, exec_size>(
2474
+ modifier, exec_size, mask.data (), num_src0, sfid, ex_desc, msg_desc,
2475
+ msg_src0.data ());
2476
+ }
2477
+
2478
+ // / @} sycl_esimd_raw_send
2479
+
2316
2480
// / @} sycl_esimd_memory
2317
2481
2318
2482
// / @cond EXCLUDE
0 commit comments