Skip to content

Commit

Permalink
[SYCL][ESIMD] Change default cache hints for prefetch (#12931)
Browse files Browse the repository at this point in the history
This patch makes it a requirement for user to specify both L1 and L2 cache hints when call prefetch() function,
which is similar to the old lsc_prefetch() API.
  • Loading branch information
fineg74 committed Mar 6, 2024
1 parent 8027266 commit 984c88c
Show file tree
Hide file tree
Showing 3 changed files with 167 additions and 378 deletions.
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 @@ -8595,10 +8595,10 @@ prefetch(const T *p, simd<OffsetT, N / VS> byte_offsets, simd_mask<N / VS> mask,

constexpr auto L1Hint =
detail::getPropertyValue<PropertyListT, cache_hint_L1_key>(
cache_hint::uncached);
cache_hint::none);
constexpr auto L2Hint =
detail::getPropertyValue<PropertyListT, cache_hint_L2_key>(
cache_hint::cached);
cache_hint::none);
detail::prefetch_impl<T, VS, detail::lsc_data_size::default_size, L1Hint,
L2Hint>(p, byte_offsets, mask);
}
Expand Down Expand Up @@ -8769,10 +8769,10 @@ prefetch(const T *p, OffsetT byte_offset, simd_mask<1> mask,
PropertyListT props = {}) {
constexpr auto L1Hint =
detail::getPropertyValue<PropertyListT, cache_hint_L1_key>(
cache_hint::uncached);
cache_hint::none);
constexpr auto L2Hint =
detail::getPropertyValue<PropertyListT, cache_hint_L2_key>(
cache_hint::cached);
cache_hint::none);
detail::prefetch_impl<T, VS, detail::lsc_data_size::default_size, L1Hint,
L2Hint>(p, byte_offset, mask);
}
Expand Down Expand Up @@ -8931,10 +8931,10 @@ prefetch(AccessorT acc, simd<OffsetT, N / VS> byte_offsets,

constexpr auto L1Hint =
detail::getPropertyValue<PropertyListT, cache_hint_L1_key>(
cache_hint::uncached);
cache_hint::none);
constexpr auto L2Hint =
detail::getPropertyValue<PropertyListT, cache_hint_L2_key>(
cache_hint::cached);
cache_hint::none);
detail::prefetch_impl<T, VS, detail::lsc_data_size::default_size, L1Hint,
L2Hint>(acc, byte_offsets, mask);
#endif // __ESIMD_FORCE_STATELESS_MEM
Expand Down Expand Up @@ -9130,10 +9130,10 @@ prefetch(AccessorT acc, OffsetT byte_offset, simd_mask<1> mask,
#else
constexpr auto L1Hint =
detail::getPropertyValue<PropertyListT, cache_hint_L1_key>(
cache_hint::uncached);
cache_hint::none);
constexpr auto L2Hint =
detail::getPropertyValue<PropertyListT, cache_hint_L2_key>(
cache_hint::cached);
cache_hint::none);
detail::prefetch_impl<T, VS, detail::lsc_data_size::default_size, L1Hint,
L2Hint>(acc, byte_offset, mask);
#endif // __ESIMD_FORCE_STATELESS_MEM
Expand Down
Loading

0 comments on commit 984c88c

Please sign in to comment.