Skip to content

Commit 6f4fde6

Browse files
authored
[SYCL][ESIMD] Make lsc_block_load/store try to use 64 bit blocks by default (#8316)
1 parent 9170a5d commit 6f4fde6

File tree

3 files changed

+483
-119
lines changed

3 files changed

+483
-119
lines changed

sycl/include/sycl/ext/intel/esimd/detail/simd_obj_impl.hpp

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,15 @@ static inline constexpr bool is_simd_flag_type_v = is_simd_flag_type<T>::value;
9999
namespace detail {
100100

101101
/// @cond ESIMD_DETAIL
102+
/// \c dqword_element_aligned_tag type. Flag of this type should be used in load
103+
/// and store operations when memory address is aligned by simd object's element
104+
/// type or dword whatever is greater.
105+
struct dqword_element_aligned_tag {
106+
template <typename VT, typename ET = detail::element_type_t<VT>>
107+
static constexpr unsigned alignment = alignof(ET) > 4 ? alignof(ET) : 4;
108+
};
109+
110+
inline constexpr dqword_element_aligned_tag dqword_element_aligned = {};
102111

103112
// Functions to support efficient simd constructors - avoiding internal loop
104113
// over elements.
@@ -881,6 +890,9 @@ class simd_obj_impl {
881890

882891
} // namespace detail
883892

893+
template <>
894+
struct is_simd_flag_type<detail::dqword_element_aligned_tag> : std::true_type {
895+
};
884896
} // namespace ext::intel::esimd
885897
} // __SYCL_INLINE_VER_NAMESPACE(_V1)
886898
} // namespace sycl

sycl/include/sycl/ext/intel/experimental/esimd/common.hpp

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,18 @@ template <typename T, lsc_data_size DS> constexpr void check_lsc_data_size() {
109109
static_assert(DS != lsc_data_size::default_size || sizeof(T) == 1 ||
110110
sizeof(T) == 2 || sizeof(T) == 4 || sizeof(T) == 8,
111111
"Unsupported data type");
112+
static_assert(
113+
DS == lsc_data_size::default_size ||
114+
(sizeof(T) == 1 &&
115+
(DS == lsc_data_size::u8 || DS == lsc_data_size::u8u32)) ||
116+
(sizeof(T) == 2 &&
117+
(DS == lsc_data_size::u16 || DS == lsc_data_size::u16u32 ||
118+
DS == lsc_data_size::u16u32h)) ||
119+
(sizeof(T) == 4 &&
120+
(DS == lsc_data_size::u32 || DS == lsc_data_size::u8u32 ||
121+
DS == lsc_data_size::u16u32 || DS == lsc_data_size::u16u32h)) ||
122+
(sizeof(T) == 8 && DS == lsc_data_size::u64),
123+
"Data type does not match data size");
112124
}
113125

114126
template <lsc_vector_size VS> constexpr uint8_t to_int() {

0 commit comments

Comments
 (0)