Skip to content

Commit

Permalink
Compatibility: Only use cl_* types if SYCL_CTS_ENABLE_OPENCL_INTEROP_…
Browse files Browse the repository at this point in the history
…TESTS is set
  • Loading branch information
fknorr committed Feb 17, 2024
1 parent 42e9081 commit ce98390
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 33 deletions.
28 changes: 11 additions & 17 deletions tests/group/group_async_work_group_copy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,10 @@ class TEST_NAME : public util::test_base {
"unsigned long long");
for_type_and_vectors<check_type, float>(log,
"float");

for_type_and_vectors<check_type, sycl::byte>(log,
"sycl::byte");

#if SYCL_CTS_ENABLE_OPENCL_INTEROP_TESTS
for_type_and_vectors<check_type, sycl::cl_bool>(log,
"sycl::cl_bool");
for_type_and_vectors<check_type, sycl::cl_char>(log,
Expand All @@ -89,38 +90,31 @@ class TEST_NAME : public util::test_base {
"sycl::cl_ulong");
for_type_and_vectors<check_type, sycl::cl_float>(log,
"sycl::cl_float");
#endif

#ifdef INT8_MAX
if (!std::is_same<sycl::cl_char, std::int8_t>::value)
for_type_and_vectors<check_type, std::int8_t>(log, "std::int8_t");
for_type_and_vectors<check_type, std::int8_t>(log, "std::int8_t");
#endif
#ifdef INT16_MAX
if (!std::is_same<sycl::cl_short, std::int16_t>::value)
for_type_and_vectors<check_type, std::int16_t>(log, "std::int16_t");
for_type_and_vectors<check_type, std::int16_t>(log, "std::int16_t");
#endif
#ifdef INT32_MAX
if (!std::is_same<sycl::cl_int, std::int32_t>::value)
for_type_and_vectors<check_type, std::int32_t>(log, "std::int32_t");
for_type_and_vectors<check_type, std::int32_t>(log, "std::int32_t");
#endif
#ifdef INT64_MAX
if (!std::is_same<sycl::cl_long, std::int64_t>::value)
for_type_and_vectors<check_type, std::int64_t>(log, "std::int64_t");
for_type_and_vectors<check_type, std::int64_t>(log, "std::int64_t");
#endif
#ifdef UINT8_MAX
if (!std::is_same<sycl::cl_uchar, std::uint8_t>::value)
for_type_and_vectors<check_type, std::uint8_t>(log, "std::uint8_t");
for_type_and_vectors<check_type, std::uint8_t>(log, "std::uint8_t");
#endif
#ifdef UINT16_MAX
if (!std::is_same<sycl::cl_ushort, std::uint16_t>::value)
for_type_and_vectors<check_type, std::uint16_t>(log, "std::uint16_t");
for_type_and_vectors<check_type, std::uint16_t>(log, "std::uint16_t");
#endif
#ifdef UINT32_MAX
if (!std::is_same<sycl::cl_uint, std::uint32_t>::value)
for_type_and_vectors<check_type, std::uint32_t>(log, "std::uint32_t");
for_type_and_vectors<check_type, std::uint32_t>(log, "std::uint32_t");
#endif
#ifdef UINT64_MAX
if (!std::is_same<sycl::cl_ulong, std::uint64_t>::value)
for_type_and_vectors<check_type, std::uint64_t>(log, "std::uint64_t");
for_type_and_vectors<check_type, std::uint64_t>(log, "std::uint64_t");
#endif
}
};
Expand Down
2 changes: 2 additions & 0 deletions tests/group/group_async_work_group_copy_fp64.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,10 @@ class TEST_NAME : public util::test_base {
// Test using queue constructed already
for_type_and_vectors<check_type, double>(queue, log,
"double");
#if SYCL_CTS_ENABLE_OPENCL_INTEROP_TESTS
for_type_and_vectors<check_type, sycl::cl_double>(queue, log,
"sycl::cl_double");
#endif
}
}
};
Expand Down
24 changes: 8 additions & 16 deletions tests/nd_item/nd_item_async_work_group_copy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -80,36 +80,28 @@ class TEST_NAME : public util::test_base {
#endif

#ifdef INT8_MAX
if (!std::is_same<sycl::cl_char, std::int8_t>::value)
for_type_and_vectors<check_type, std::int8_t>(log, "std::int8_t");
for_type_and_vectors<check_type, std::int8_t>(log, "std::int8_t");
#endif
#ifdef INT16_MAX
if (!std::is_same<sycl::cl_short, std::int16_t>::value)
for_type_and_vectors<check_type, std::int16_t>(log, "std::int16_t");
for_type_and_vectors<check_type, std::int16_t>(log, "std::int16_t");
#endif
#ifdef INT32_MAX
if (!std::is_same<sycl::cl_int, std::int32_t>::value)
for_type_and_vectors<check_type, std::int32_t>(log, "std::int32_t");
for_type_and_vectors<check_type, std::int32_t>(log, "std::int32_t");
#endif
#ifdef INT64_MAX
if (!std::is_same<sycl::cl_long, std::int64_t>::value)
for_type_and_vectors<check_type, std::int64_t>(log, "std::int64_t");
for_type_and_vectors<check_type, std::int64_t>(log, "std::int64_t");
#endif
#ifdef UINT8_MAX
if (!std::is_same<sycl::cl_uchar, std::uint8_t>::value)
for_type_and_vectors<check_type, std::uint8_t>(log, "std::uint8_t");
for_type_and_vectors<check_type, std::uint8_t>(log, "std::uint8_t");
#endif
#ifdef UINT16_MAX
if (!std::is_same<sycl::cl_ushort, std::uint16_t>::value)
for_type_and_vectors<check_type, std::uint16_t>(log, "std::uint16_t");
for_type_and_vectors<check_type, std::uint16_t>(log, "std::uint16_t");
#endif
#ifdef UINT32_MAX
if (!std::is_same<sycl::cl_uint, std::uint32_t>::value)
for_type_and_vectors<check_type, std::uint32_t>(log, "std::uint32_t");
for_type_and_vectors<check_type, std::uint32_t>(log, "std::uint32_t");
#endif
#ifdef UINT64_MAX
if (!std::is_same<sycl::cl_ulong, std::uint64_t>::value)
for_type_and_vectors<check_type, std::uint64_t>(log, "std::uint64_t");
for_type_and_vectors<check_type, std::uint64_t>(log, "std::uint64_t");
#endif
}
};
Expand Down
2 changes: 2 additions & 0 deletions tests/nd_item/nd_item_async_work_group_copy_fp16.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,10 @@ class TEST_NAME : public util::test_base {
// Test using queue constructed already
for_type_and_vectors<check_type, sycl::half>(queue, log,
"sycl::half");
#if SYCL_CTS_ENABLE_OPENCL_INTEROP_TESTS
for_type_and_vectors<check_type, sycl::cl_half>(queue, log,
"sycl::cl_half");
#endif
}
}
};
Expand Down
2 changes: 2 additions & 0 deletions tests/nd_item/nd_item_async_work_group_copy_fp64.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,10 @@ class TEST_NAME : public util::test_base {
// Test using queue constructed already
for_type_and_vectors<check_type, double>(queue, log,
"double");
#if SYCL_CTS_ENABLE_OPENCL_INTEROP_TESTS
for_type_and_vectors<check_type, sycl::cl_double>(queue, log,
"sycl::cl_double");
#endif
}
}
};
Expand Down

0 comments on commit ce98390

Please sign in to comment.