From 33f88a43719b341c8479a57ceee87c4c6ead0ec7 Mon Sep 17 00:00:00 2001 From: Alexey Sachkov Date: Fri, 27 Oct 2023 07:44:20 -0700 Subject: [PATCH] Do not use `assert` in device code `assert` is not guaranteed to be supported by a SYCL implementation and therefore we can't really use it in CTS. Removed `assert` uses from velue operations helpers, which are used by some of CTS tests (`accessor`, `vector_swizzles`). --- tests/common/value_operations.h | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/tests/common/value_operations.h b/tests/common/value_operations.h index 4a7900071..8e0c4b9f7 100644 --- a/tests/common/value_operations.h +++ b/tests/common/value_operations.h @@ -26,7 +26,6 @@ #define __SYCLCTS_TESTS_COMMON_VALUE_OPERATIONS_H #include "../../util/type_traits.h" -#include #include #include #include @@ -174,7 +173,6 @@ inline typename std::enable_if_t< detail::is_non_array_with_subscript_and_size_v && detail::is_non_array_with_subscript_and_size_v> assign(LeftArrT& left, const RightArrT& right) { - assert((left.size() == right.size()) && "Arrays have to be the same size"); for (size_t i = 0; i < left.size(); ++i) { detail::assign_value_or_even(left[i], right[i]); } @@ -251,7 +249,7 @@ inline typename std::enable_if_t< detail::is_non_array_with_subscript_and_size_v, bool> are_equal(const LeftArrT& left, const RightArrT& right) { - assert((left.size() == right.size()) && "Arrays have to be the same size"); + if (left.size() != right.size()) return false; for (size_t i = 0; i < left.size(); ++i) { if (!detail::are_equal_value_or_even(left[i], right[i])) return false; }