Skip to content

[SYCL] More adjustments for SYCL 2020 vec aliases #7896

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

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
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
11 changes: 0 additions & 11 deletions sycl/include/sycl/detail/generic_type_traits.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -128,17 +128,6 @@ using is_intn = is_contained<T, gtl::vector_signed_int_list>;

template <typename T> using is_genint = is_contained<T, gtl::signed_int_list>;

template <typename T>
using is_ulongn = is_contained<T, gtl::vector_unsigned_long_list>;

template <typename T>
using is_ugenlong = is_contained<T, gtl::unsigned_long_list>;

template <typename T>
using is_longn = is_contained<T, gtl::vector_signed_long_list>;

template <typename T> using is_genlong = is_contained<T, gtl::signed_long_list>;

template <typename T>
using is_ulonglongn = is_contained<T, gtl::vector_unsigned_longlong_list>;

Expand Down
36 changes: 0 additions & 36 deletions sycl/test/basic_tests/generic_type_traits.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -99,42 +99,6 @@ int main() {
is_genint
*/

// is_ulongn
static_assert(d::is_ulongn<s::uchar>::value == false, "");
static_assert(d::is_ulongn<s::ulong>::value == false, "");
static_assert(d::is_ulongn<s::ulong2>::value == true, "");
static_assert(d::is_ulongn<s::ulong3>::value == true, "");
static_assert(d::is_ulongn<s::ulong4>::value == true, "");
static_assert(d::is_ulongn<s::ulong8>::value == true, "");
static_assert(d::is_ulongn<s::ulong16>::value == true, "");

// is_ugenlong
static_assert(d::is_ugenlong<s::uchar>::value == false, "");
static_assert(d::is_ugenlong<s::ulong>::value == true, "");
static_assert(d::is_ugenlong<s::ulong2>::value == true, "");
static_assert(d::is_ugenlong<s::ulong3>::value == true, "");
static_assert(d::is_ugenlong<s::ulong4>::value == true, "");
static_assert(d::is_ugenlong<s::ulong8>::value == true, "");
static_assert(d::is_ugenlong<s::ulong16>::value == true, "");

// is_longn
static_assert(d::is_longn<char>::value == false, "");
static_assert(d::is_longn<long>::value == false, "");
static_assert(d::is_longn<s::long2>::value == true, "");
static_assert(d::is_longn<s::long3>::value == true, "");
static_assert(d::is_longn<s::long4>::value == true, "");
static_assert(d::is_longn<s::long8>::value == true, "");
static_assert(d::is_longn<s::long16>::value == true, "");

// is_genlong
static_assert(d::is_genlong<char>::value == false, "");
static_assert(d::is_genlong<long>::value == true, "");
static_assert(d::is_genlong<s::long2>::value == true, "");
static_assert(d::is_genlong<s::long3>::value == true, "");
static_assert(d::is_genlong<s::long4>::value == true, "");
static_assert(d::is_genlong<s::long8>::value == true, "");
static_assert(d::is_genlong<s::long16>::value == true, "");

/*
is_ulonglongn
is_ugenlonglong
Expand Down
24 changes: 13 additions & 11 deletions sycl/test/basic_tests/vectors/vectors.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@
#define SYCL_SIMPLE_SWIZZLES
#include <sycl/sycl.hpp>

#include <cstddef>

void check_vectors(sycl::int4 a, sycl::int4 b, sycl::int4 c, sycl::int4 gold) {
sycl::int4 result = a * (sycl::int4)b.y() + c;
assert((int)result.x() == (int)gold.x());
Expand Down Expand Up @@ -100,17 +102,17 @@ int main() {
auto asVec = inputVec.template swizzle<sycl::elem::s0, sycl::elem::s1>()
.template as<sycl::vec<int16_t, 1>>();

// Check that [u]long[n] type aliases match vec<[unsigned] long, n> types.
assert((std::is_same<sycl::vec<long, 2>, sycl::long2>::value));
assert((std::is_same<sycl::vec<long, 3>, sycl::long3>::value));
assert((std::is_same<sycl::vec<long, 4>, sycl::long4>::value));
assert((std::is_same<sycl::vec<long, 8>, sycl::long8>::value));
assert((std::is_same<sycl::vec<long, 16>, sycl::long16>::value));
assert((std::is_same<sycl::vec<unsigned long, 2>, sycl::ulong2>::value));
assert((std::is_same<sycl::vec<unsigned long, 3>, sycl::ulong3>::value));
assert((std::is_same<sycl::vec<unsigned long, 4>, sycl::ulong4>::value));
assert((std::is_same<sycl::vec<unsigned long, 8>, sycl::ulong8>::value));
assert((std::is_same<sycl::vec<unsigned long, 16>, sycl::ulong16>::value));
// Check that [u]long[n] type aliases match vec<[u]int64_t, n> types.
assert((std::is_same<sycl::vec<std::int64_t, 2>, sycl::long2>::value));
assert((std::is_same<sycl::vec<std::int64_t, 3>, sycl::long3>::value));
assert((std::is_same<sycl::vec<std::int64_t, 4>, sycl::long4>::value));
assert((std::is_same<sycl::vec<std::int64_t, 8>, sycl::long8>::value));
assert((std::is_same<sycl::vec<std::int64_t, 16>, sycl::long16>::value));
assert((std::is_same<sycl::vec<std::uint64_t, 2>, sycl::ulong2>::value));
assert((std::is_same<sycl::vec<std::uint64_t, 3>, sycl::ulong3>::value));
assert((std::is_same<sycl::vec<std::uint64_t, 4>, sycl::ulong4>::value));
assert((std::is_same<sycl::vec<std::uint64_t, 8>, sycl::ulong8>::value));
assert((std::is_same<sycl::vec<std::uint64_t, 16>, sycl::ulong16>::value));

// Check convert() from and to various types.
check_convert_from<int8_t>();
Expand Down