Skip to content

Commit 24e2b8a

Browse files
[SYCL] Switch to preview implementation of sycl::vec
1 parent 8761d40 commit 24e2b8a

File tree

9 files changed

+15
-2489
lines changed

9 files changed

+15
-2489
lines changed

libdevice/nativecpu_utils.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -77,9 +77,9 @@ __spirv_ControlBarrier(uint32_t Execution, uint32_t Memory,
7777

7878
namespace ncpu_types {
7979
template <class T> struct vtypes {
80-
using v2 = typename sycl::detail::VecStorage<T, 2>::DataType;
81-
using v4 = typename sycl::detail::VecStorage<T, 4>::DataType;
82-
using v8 = typename sycl::detail::VecStorage<T, 8>::DataType;
80+
using v2 = typename sycl::vec<T, 2>::vector_t;
81+
using v4 = typename sycl::vec<T, 4>::vector_t;
82+
using v8 = typename sycl::vec<T, 8>::vector_t;
8383
};
8484
} // namespace ncpu_types
8585

@@ -252,8 +252,8 @@ DefShuffleINTEL_All(double, f64, double)
252252
DefShuffleINTEL_All(float, f32, float)
253253

254254
#define DefineShuffleVec(T, N, Sfx, MuxType) \
255-
using vt##T##N = sycl::detail::VecStorage<T, N>::DataType; \
256-
using vt##MuxType##N = sycl::detail::VecStorage<MuxType, N>::DataType; \
255+
using vt##T##N = sycl::vec<T, N>::vector_t; \
256+
using vt##MuxType##N = sycl::vec<MuxType, N>::vector_t; \
257257
DefShuffleINTEL_All(vt##T##N, v##N##Sfx, vt##MuxType##N)
258258

259259
#define DefineShuffleVec2to16(Type, Sfx, MuxType) \

sycl/include/sycl/detail/generic_type_traits.hpp

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -344,20 +344,7 @@ template <typename T> auto convertToOpenCLType(T &&x) {
344344
std::declval<ElemTy>()))>,
345345
no_ref::size()>;
346346
#ifdef __SYCL_DEVICE_ONLY__
347-
348-
#ifndef __INTEL_PREVIEW_BREAKING_CHANGES
349-
// TODO: for some mysterious reasons on NonUniformGroups E2E tests fail if
350-
// we use the "else" version only. I suspect that's an issues with
351-
// non-uniform groups implementation.
352-
if constexpr (std::is_same_v<MatchingVec, no_ref>)
353-
return static_cast<typename MatchingVec::vector_t>(x);
354-
else
355-
return static_cast<typename MatchingVec::vector_t>(
356-
x.template as<MatchingVec>());
357-
#else // __INTEL_PREVIEW_BREAKING_CHANGES
358347
return sycl::bit_cast<typename MatchingVec::vector_t>(x);
359-
#endif // __INTEL_PREVIEW_BREAKING_CHANGES
360-
361348
#else
362349
return x.template as<MatchingVec>();
363350
#endif

sycl/include/sycl/ext/oneapi/bfloat16.hpp

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -78,25 +78,6 @@ template <int N> void BF16VecToFloatVec(const bfloat16 src[N], float dst[N]) {
7878
}
7979
#endif
8080
}
81-
82-
// sycl::vec support
83-
namespace bf16 {
84-
#ifndef __INTEL_PREVIEW_BREAKING_CHANGES
85-
#ifdef __SYCL_DEVICE_ONLY__
86-
using Vec2StorageT = Bfloat16StorageT __attribute__((ext_vector_type(2)));
87-
using Vec3StorageT = Bfloat16StorageT __attribute__((ext_vector_type(3)));
88-
using Vec4StorageT = Bfloat16StorageT __attribute__((ext_vector_type(4)));
89-
using Vec8StorageT = Bfloat16StorageT __attribute__((ext_vector_type(8)));
90-
using Vec16StorageT = Bfloat16StorageT __attribute__((ext_vector_type(16)));
91-
#else
92-
using Vec2StorageT = std::array<Bfloat16StorageT, 2>;
93-
using Vec3StorageT = std::array<Bfloat16StorageT, 3>;
94-
using Vec4StorageT = std::array<Bfloat16StorageT, 4>;
95-
using Vec8StorageT = std::array<Bfloat16StorageT, 8>;
96-
using Vec16StorageT = std::array<Bfloat16StorageT, 16>;
97-
#endif
98-
#endif // __INTEL_PREVIEW_BREAKING_CHANGES
99-
} // namespace bf16
10081
} // namespace detail
10182

10283
class bfloat16 {

sycl/include/sycl/half_type.hpp

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -248,34 +248,12 @@ class half;
248248
using StorageT = _Float16;
249249
using BIsRepresentationT = _Float16;
250250
using VecElemT = _Float16;
251-
252-
#ifndef __INTEL_PREVIEW_BREAKING_CHANGES
253-
using Vec2StorageT = VecElemT __attribute__((ext_vector_type(2)));
254-
using Vec3StorageT = VecElemT __attribute__((ext_vector_type(3)));
255-
using Vec4StorageT = VecElemT __attribute__((ext_vector_type(4)));
256-
using Vec8StorageT = VecElemT __attribute__((ext_vector_type(8)));
257-
using Vec16StorageT = VecElemT __attribute__((ext_vector_type(16)));
258-
#endif // __INTEL_PREVIEW_BREAKING_CHANGES
259-
260251
#else // SYCL_DEVICE_ONLY
261252
using StorageT = detail::host_half_impl::half;
262253
// No need to extract underlying data type for built-in functions operating on
263254
// host
264255
using BIsRepresentationT = half;
265256
using VecElemT = half;
266-
267-
#ifndef __INTEL_PREVIEW_BREAKING_CHANGES
268-
// On the host side we cannot use OpenCL cl_half# types as an underlying type
269-
// for vec because they are actually defined as an integer type under the
270-
// hood. As a result half values will be converted to the integer and passed
271-
// as a kernel argument which is expected to be floating point number.
272-
using Vec2StorageT = std::array<VecElemT, 2>;
273-
using Vec3StorageT = std::array<VecElemT, 3>;
274-
using Vec4StorageT = std::array<VecElemT, 4>;
275-
using Vec8StorageT = std::array<VecElemT, 8>;
276-
using Vec16StorageT = std::array<VecElemT, 16>;
277-
#endif // __INTEL_PREVIEW_BREAKING_CHANGES
278-
279257
#endif // SYCL_DEVICE_ONLY
280258

281259
#ifndef __SYCL_DEVICE_ONLY__

sycl/include/sycl/types.hpp

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,6 @@
2121
#include <sycl/half_type.hpp> // for StorageT, half, Vec16...
2222
#include <sycl/marray.hpp> // for __SYCL_BINOP, __SYCL_...
2323
#include <sycl/multi_ptr.hpp> // for multi_ptr
24-
#ifdef __INTEL_PREVIEW_BREAKING_CHANGES
25-
#include <sycl/vector_preview.hpp> // for sycl::vec and swizzles
26-
#else
27-
#include <sycl/vector.hpp> // for sycl::vec and swizzles
28-
#endif
24+
#include <sycl/vector_preview.hpp> // for sycl::vec and swizzles
2925

3026
#include <sycl/ext/oneapi/bfloat16.hpp> // bfloat16

0 commit comments

Comments
 (0)