Skip to content

[ESIMD][NFC] Use non experimental implementation for lsc_atomic_update API #12452

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Mar 6, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@ -2786,34 +2786,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