Skip to content

Commit

Permalink
[ESIMD][NFC] Use non experimental implementation for lsc_atomic_updat…
Browse files Browse the repository at this point in the history
…e API (#12452)
  • Loading branch information
fineg74 committed Mar 6, 2024
1 parent 2d2e418 commit e4d2873
Showing 1 changed file with 2 additions and 28 deletions.
30 changes: 2 additions & 28 deletions sycl/include/sycl/ext/intel/experimental/esimd/memory.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -2800,34 +2800,8 @@ __ESIMD_API std::enable_if_t<__ESIMD_DNS::is_rw_device_accessor_v<AccessorTy>,
lsc_atomic_update(AccessorTy acc, __ESIMD_NS::simd<Toffset, N> offsets,
__ESIMD_NS::simd<T, N> src0, __ESIMD_NS::simd<T, N> src1,
__ESIMD_NS::simd_mask<N> pred) {
#ifdef __ESIMD_FORCE_STATELESS_MEM
return lsc_atomic_update<Op, T, N, DS, L1H, L2H>(
__ESIMD_DNS::accessorToPointer<T>(acc), offsets, src0, src1, pred);
#else
static_assert(std::is_integral_v<Toffset> && sizeof(Toffset) == 4,
"Unsupported offset type");
detail::check_lsc_vector_size<1>();
detail::check_lsc_data_size<T, DS>();
__ESIMD_DNS::check_atomic<Op, T, N, 2>();
detail::check_lsc_cache_hint<detail::lsc_action::atomic, L1H, L2H>();
constexpr uint16_t _AddressScale = 1;
constexpr int _ImmOffset = 0;
constexpr lsc_data_size _DS =
detail::expand_data_size(detail::finalize_data_size<T, DS>());
constexpr detail::lsc_vector_size _VS = detail::to_lsc_vector_size<1>();
constexpr detail::lsc_data_order _Transposed =
detail::lsc_data_order::nontranspose;
using MsgT = typename detail::lsc_expand_type<T>::type;
constexpr int IOp = detail::lsc_to_internal_atomic_op<T, Op>();
__ESIMD_NS::simd<MsgT, N> Msg_data0 = detail::lsc_format_input<MsgT>(src0);
__ESIMD_NS::simd<MsgT, N> Msg_data1 = detail::lsc_format_input<MsgT>(src1);
auto si = __ESIMD_NS::get_surface_index(acc);
__ESIMD_NS::simd<MsgT, N> Tmp =
__esimd_lsc_xatomic_bti_2<MsgT, IOp, L1H, L2H, _AddressScale, _ImmOffset,
_DS, _VS, _Transposed, N>(
pred.data(), offsets.data(), Msg_data0.data(), Msg_data1.data(), si);
return detail::lsc_format_ret<T>(Tmp);
#endif
return __ESIMD_DNS::atomic_update_impl<Op, T, N, DS, L1H, L2H>(
acc, offsets, src0, src1, pred);
}

/// Variant of \c lsc_atomic_update that uses \c local_accessor as a parameter.
Expand Down

0 comments on commit e4d2873

Please sign in to comment.