Skip to content

Commit a220848

Browse files
authored
[SYCL][ESIMD] Unified memory API: atomic_update(usm_ptr, ...) (#11862)
For one and two source API variants.
1 parent 728b132 commit a220848

File tree

12 files changed

+1767
-326
lines changed

12 files changed

+1767
-326
lines changed

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

Lines changed: 70 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -421,7 +421,7 @@ __esimd_svm_atomic2(__ESIMD_DNS::vector_type_t<uint64_t, N> addrs,
421421
template <typename Ty, int InternalOp, __ESIMD_NS::cache_hint L1H,
422422
__ESIMD_NS::cache_hint L2H, uint16_t AddressScale, int ImmOffset,
423423
__ESIMD_DNS::lsc_data_size DS, __ESIMD_DNS::lsc_vector_size VS,
424-
__ESIMD_DNS::lsc_data_order _Transposed, int N>
424+
__ESIMD_DNS::lsc_data_order Transposed, int N>
425425
__ESIMD_INTRIN __ESIMD_DNS::vector_type_t<Ty, N * __ESIMD_DNS::to_int<VS>()>
426426
__esimd_lsc_xatomic_stateless_0(__ESIMD_DNS::simd_mask_storage_t<N> pred,
427427
__ESIMD_DNS::vector_type_t<uintptr_t, N> addrs)
@@ -433,6 +433,75 @@ __esimd_lsc_xatomic_stateless_0(__ESIMD_DNS::simd_mask_storage_t<N> pred,
433433
}
434434
#endif // __SYCL_DEVICE_ONLY__
435435

436+
/// USM pointer atomic.
437+
/// Supported platforms: DG2, PVC
438+
///
439+
/// @tparam Ty is element type.
440+
/// @tparam InternalOp is operation type.
441+
/// @tparam L1H is L1 cache hint.
442+
/// @tparam L2H is L2 cache hint.
443+
/// @tparam AddressScale is the address scale.
444+
/// @tparam ImmOffset is the immediate offset added to each address.
445+
/// @tparam DS is the data size.
446+
/// @tparam VS is the number of elements per address.
447+
/// @tparam Transposed indicates if the data is transposed during the transfer.
448+
/// @tparam N is the SIMD size of operation (the number of addresses to access)
449+
450+
/// @param pred is predicates.
451+
/// @param addrs is the prefetch addresses.
452+
/// @param src0 is the first atomic operand.
453+
template <typename Ty, int InternalOp, __ESIMD_NS::cache_hint L1H,
454+
__ESIMD_NS::cache_hint L2H, uint16_t AddressScale, int ImmOffset,
455+
__ESIMD_DNS::lsc_data_size DS, __ESIMD_DNS::lsc_vector_size VS,
456+
__ESIMD_DNS::lsc_data_order Transposed, int N>
457+
__ESIMD_INTRIN __ESIMD_DNS::vector_type_t<Ty, N * __ESIMD_DNS::to_int<VS>()>
458+
__esimd_lsc_xatomic_stateless_1(
459+
__ESIMD_DNS::simd_mask_storage_t<N> pred,
460+
__ESIMD_DNS::vector_type_t<uintptr_t, N> addrs,
461+
__ESIMD_DNS::vector_type_t<Ty, N * __ESIMD_DNS::to_int<VS>()> src0)
462+
#ifdef __SYCL_DEVICE_ONLY__
463+
;
464+
#else // __SYCL_DEVICE_ONLY__
465+
{
466+
__ESIMD_UNSUPPORTED_ON_HOST;
467+
}
468+
#endif // __SYCL_DEVICE_ONLY__
469+
470+
/// USM pointer atomic.
471+
/// Supported platforms: DG2, PVC
472+
///
473+
/// @tparam Ty is element type.
474+
/// @tparam InternalOp is operation type.
475+
/// @tparam L1H is L1 cache hint.
476+
/// @tparam L2H is L2 cache hint.
477+
/// @tparam AddressScale is the address scale.
478+
/// @tparam ImmOffset is the immediate offset added to each address.
479+
/// @tparam DS is the data size.
480+
/// @tparam VS is the number of elements per address.
481+
/// @tparam Transposed indicates if the data is transposed during the transfer.
482+
/// @tparam N is the SIMD size of operation (the number of addresses to access)
483+
/// @param pred is predicates.
484+
/// @param addrs is the prefetch addresses.
485+
/// @param src0 is the first atomic operand.
486+
/// @param src1 is the second atomic operand.
487+
template <typename Ty, int InternalOp, __ESIMD_NS::cache_hint L1H,
488+
__ESIMD_NS::cache_hint L2H, uint16_t AddressScale, int ImmOffset,
489+
__ESIMD_DNS::lsc_data_size DS, __ESIMD_DNS::lsc_vector_size VS,
490+
__ESIMD_DNS::lsc_data_order Transposed, int N>
491+
__ESIMD_INTRIN __ESIMD_DNS::vector_type_t<Ty, N * __ESIMD_DNS::to_int<VS>()>
492+
__esimd_lsc_xatomic_stateless_2(
493+
__ESIMD_DNS::simd_mask_storage_t<N> Pred,
494+
__ESIMD_DNS::vector_type_t<uintptr_t, N> Addrs,
495+
__ESIMD_DNS::vector_type_t<Ty, N * __ESIMD_DNS::to_int<VS>()> src0,
496+
__ESIMD_DNS::vector_type_t<Ty, N * __ESIMD_DNS::to_int<VS>()> src1)
497+
#ifdef __SYCL_DEVICE_ONLY__
498+
;
499+
#else // __SYCL_DEVICE_ONLY__
500+
{
501+
__ESIMD_UNSUPPORTED_ON_HOST;
502+
}
503+
#endif // __SYCL_DEVICE_ONLY__
504+
436505
__ESIMD_INTRIN void __esimd_slm_init(uint32_t size)
437506
#ifdef __SYCL_DEVICE_ONLY__
438507
;

0 commit comments

Comments
 (0)