Skip to content
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

[SYCL][ESIMD]Implement gather(lacc) accepting compile time properties #12533

Merged
merged 5 commits into from
Feb 5, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
16 changes: 8 additions & 8 deletions sycl/include/sycl/ext/intel/esimd/memory.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -3061,7 +3061,7 @@ gather(AccessorT acc, simd<OffsetT, N / VS> byte_offsets,
/// simd<T, N> gather(AccessorT acc, simd<OffsetT, N / VS> byte_offsets,
/// simd_mask<N / VS> mask,
/// PropertyListT props = {}); // (acc-ga-2)
/// Supported platforms: DG2, PVC in most cases. The DG2/PVC is not required if
/// Supported platforms: DG2, PVC in most cases. DG2/PVC is not required if
/// VS == 1 and no L1/L2 cache hints used and sizeof(T) <= 4 and N = {1,8,16,32}
///
/// Loads ("gathers") elements of the type 'T' from memory locations addressed
Expand Down Expand Up @@ -3129,7 +3129,7 @@ gather(AccessorT acc, simd<OffsetT, N / VS> byte_offsets,
/// typename PropertyListT = empty_properties_t>
/// simd<T, N> gather(AccessorT acc, simd<OffsetT, N / VS> byte_offsets,
/// PropertyListT props = {}); // (acc-ga-3)
/// Supported platforms: DG2, PVC in most cases. The DG2/PVC is not required if
/// Supported platforms: DG2, PVC in most cases. DG2/PVC is not required if
/// VS == 1 and no L1/L2 cache hints used and sizeof(T) <= 4 and N = {1,8,16,32}
///
/// Loads ("gathers") elements of the type 'T' from memory locations addressed
Expand Down Expand Up @@ -7421,7 +7421,7 @@ __ESIMD_API
///
/// The next 3 functions are similar to (lacc-ga-1,2,3), but they don't have
/// the template parameter 'VS'. These functions are added for convenience and
/// to make it possible for user to omit the template parameters T and N,
/// to make it possible for the user to omit the template parameters T and N,
/// e.g. 'auto res = gather(acc, byte_offsets);
/// template <typename T, int N, typename AccessorT,
/// typename PropertyListT = empty_properties_t>
Expand Down Expand Up @@ -7498,7 +7498,7 @@ gather(AccessorT acc, simd<uint32_t, N / VS> byte_offsets,
/// simd<T, N> gather(AccessorT acc, simd<uint32_t, N / VS> byte_offsets,
/// simd_mask<N / VS> mask,
/// PropertyListT props = {}); // (lacc-ga-2)
/// Supported platforms: DG2, PVC in most cases. The DG2/PVC is not required if
/// Supported platforms: DG2, PVC in most cases. DG2/PVC is not required if
/// VS == 1 and the __ESIMD_GATHER_SCATTER_LLVM_IR macro is used or sizeof(T) <=
/// 4 and N = {1,2,4,8,16,32}
///
Expand Down Expand Up @@ -7541,7 +7541,7 @@ gather(AccessorT acc, simd<uint32_t, N / VS> byte_offsets,
/// typename PropertyListT = empty_properties_t>
/// simd<T, N> gather(AccessorT acc, simd<uint32_t, N / VS> byte_offsets,
/// PropertyListT props = {}); // (lacc-ga-3)
/// Supported platforms: DG2, PVC in most cases. The DG2/PVC is not required if
/// Supported platforms: DG2, PVC in most cases. DG2/PVC is not required if
/// VS == 1 and the __ESIMD_GATHER_SCATTER_LLVM_IR macro is used or sizeof(T) <=
/// 4 and N = {1,2,4,8,16,32}
///
Expand Down Expand Up @@ -7581,9 +7581,9 @@ gather(AccessorT acc, simd<uint32_t, N / VS> byte_offsets,
/// simd_mask<N> mask, simd<T, N> pass_thru,
/// PropertyListT props = {}); // (lacc-ga-4)
/// This function is identical to (lacc-ga-1) except that vector size is fixed
/// to 1. This variant is added for convenience and let user omit the template
/// arguments and call the function as
/// 'gather(acc, byte_offsets, mask, pass_thru);'.
/// to 1. This variant is added for convenience and lets the user omit the
/// template arguments and call the function as 'gather(acc, byte_offsets, mask,
/// pass_thru);'.
// Dev note: the mask type was turned into template parameter `MaskT` to
// avoid the conflicts of this prototype with the old gather() function
// accepting a 'global_offset' parameter and avoid 'ambiguous call' errors
Expand Down
4 changes: 2 additions & 2 deletions sycl/test-e2e/ESIMD/unified_memory_api/Inputs/gather.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -812,8 +812,8 @@ bool testLACC(queue Q, uint32_t MaskStride, PropertiesT) {
if (LocalID == 0) {
for (int I = 0; I < Threads * N; I += 8) {
simd<T, 8> InVec(In + GlobalElemOffset + I);
simd<uint32_t, 8> offsets(I * sizeof(T), sizeof(T));
scatter<T>(InAcc, offsets, InVec);
simd<uint32_t, 8> Offsets(I * sizeof(T), sizeof(T));
scatter<T>(InAcc, Offsets, InVec);
}
}
barrier();
Expand Down
6 changes: 6 additions & 0 deletions sycl/test/esimd/memory_properties.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1218,6 +1218,12 @@ test_gather_scatter(AccType &acc, LocalAccType &local_acc, float *ptrf,
pass_thru_view, props_align4);
acc_res = gather<float, 32, 2>(local_acc, ioffset_n16_view, mask_n16,
pass_thru_view, props_align4);

// Validate that a new API doesn't conflict with the new API.
fineg74 marked this conversation as resolved.
Show resolved Hide resolved
// CHECK-COUNT-2: call <32 x float> @llvm.masked.gather.v32f32.v32p3(<32 x ptr addrspace(3)> {{[^)]+}}, i32 4, <32 x i1> {{[^)]+}}, <32 x float> {{[^)]+}})
acc_res = gather<float, 32>(local_acc, ioffset_n32, 0);
acc_res = gather<float, 32>(local_acc, ioffset_n32, 0, mask_n32);

// CHECK-COUNT-4: call void @llvm.genx.svm.scatter.v32i1.v32i64.v32f32(<32 x i1> {{[^)]+}}, i32 0, <32 x i64> {{[^)]+}}, <32 x float> {{[^)]+}})
scatter(ptrf, ioffset_n32, usm, mask_n32);

Expand Down
Loading