Skip to content

Commit e5ccd59

Browse files
[SYCL] Switch to preview implementation of sycl::vec
1 parent a4f1010 commit e5ccd59

File tree

9 files changed

+317
-2780
lines changed

9 files changed

+317
-2780
lines changed

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.hpp> // for sycl::vec and swizzles
2925

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

0 commit comments

Comments
 (0)