llvm icon indicating copy to clipboard operation
llvm copied to clipboard

[SYCL][ESIMD] Implement compile-time properties version of scatter(acc, ...)

Open sarnex opened this issue 1 year ago • 4 comments

This implements the new compile-time properties API for scatter with accessors. I believe this is the last missing piece.

sarnex avatar Feb 08 '24 21:02 sarnex

:warning: C/C++ code formatter, clang-format found issues in your code. :warning:

You can test this locally with the following command:
git-clang-format --diff 34051496442355315f6f096c6022dbff9b2e510c 84500593f9ad7e3341587519b29584ecf9293f5f -- sycl/test-e2e/ESIMD/unified_memory_api/scatter_acc.cpp sycl/test-e2e/ESIMD/unified_memory_api/scatter_acc_dg2_pvc.cpp sycl/include/sycl/ext/intel/esimd/memory.hpp sycl/include/sycl/ext/intel/experimental/esimd/memory.hpp sycl/test-e2e/ESIMD/unified_memory_api/Inputs/scatter.hpp sycl/test/esimd/memory_properties.cpp
View the diff from clang-format here.
diff --git a/sycl/include/sycl/ext/intel/esimd/memory.hpp b/sycl/include/sycl/ext/intel/esimd/memory.hpp
index 377c267e06..d05b18f73c 100644
--- a/sycl/include/sycl/ext/intel/esimd/memory.hpp
+++ b/sycl/include/sycl/ext/intel/esimd/memory.hpp
@@ -2768,13 +2768,13 @@ scatter_impl(AccessorTy acc, simd<OffsetT, N> offsets, simd<T, N * NElts> vals,
   constexpr lsc_data_size EDS = expand_data_size(finalize_data_size<T, DS>());
   constexpr lsc_vector_size LSCNElts = to_lsc_vector_size<NElts>();
   constexpr lsc_data_order Transposed = lsc_data_order::nontranspose;
-  using MsgT = typename lsc_expand_type<T>::type; 
+  using MsgT = typename lsc_expand_type<T>::type;
   simd<MsgT, N * NElts> Tmp = lsc_format_input<MsgT, T>(vals);
   simd<uint32_t, N> ByteOffsets32 = convert<uint32_t>(offsets);
   auto si = get_surface_index(acc);
   __esimd_lsc_store_bti<MsgT, L1H, L2H, AddressScale, ImmOffset, EDS, LSCNElts,
                         Transposed, N>(pred.data(), ByteOffsets32.data(),
-                                            Tmp.data(), si);
+                                       Tmp.data(), si);
 }
 #endif // __ESIMD_FORCE_STATELESS_MEM
 
diff --git a/sycl/include/sycl/ext/intel/experimental/esimd/memory.hpp b/sycl/include/sycl/ext/intel/experimental/esimd/memory.hpp
index 83a42bbd73..0759f0b37b 100644
--- a/sycl/include/sycl/ext/intel/experimental/esimd/memory.hpp
+++ b/sycl/include/sycl/ext/intel/experimental/esimd/memory.hpp
@@ -1531,8 +1531,7 @@ lsc_scatter(AccessorTy acc,
   lsc_scatter<T, NElts, DS, L1H, L3H>(__ESIMD_DNS::accessorToPointer<T>(acc),
                                       offsets, vals, pred);
 #else
-  __ESIMD_DNS::scatter_impl<T, NElts, DS, L1H, L3H>(acc, offsets, vals,
-                                                       pred);
+  __ESIMD_DNS::scatter_impl<T, NElts, DS, L1H, L3H>(acc, offsets, vals, pred);
 #endif
 }
 

github-actions[bot] avatar Feb 08 '24 22:02 github-actions[bot]

Failures are not related.

sarnex avatar Feb 20 '24 20:02 sarnex

Failures are not related.

I believe they are related as it complains on compilation failures related to scatter API

fineg74 avatar Feb 20 '24 20:02 fineg74

@fineg74 Oh wow, that's embarrassing, great catch. Moving to a draft until I fix it.

sarnex avatar Feb 20 '24 20:02 sarnex

Win fails not related

Failed Tests (8):
  SYCL :: Assert/assert_in_kernels_win.cpp
  SYCL :: Assert/assert_in_multiple_tus_one_ndebug_win.cpp
  SYCL :: Assert/assert_in_multiple_tus_win.cpp
  SYCL :: Assert/assert_in_one_kernel_win.cpp
  SYCL :: Assert/assert_in_simultaneous_kernels_win.cpp
  SYCL :: Assert/assert_in_simultaneously_multiple_tus.cpp
  SYCL :: Assert/assert_in_simultaneously_multiple_tus_one_ndebug.cpp
  SYCL :: Plugin/sycl-ls-unified-runtime.cpp

sarnex avatar Feb 22 '24 19:02 sarnex