Skip to content

Commit

Permalink
Do not use assert in device code
Browse files Browse the repository at this point in the history
`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`).
  • Loading branch information
AlexeySachkov committed Oct 27, 2023
1 parent eec8701 commit 33f88a4
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions tests/common/value_operations.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
#define __SYCLCTS_TESTS_COMMON_VALUE_OPERATIONS_H
#include "../../util/type_traits.h"

#include <cassert>
#include <tuple>
#include <utility>
#include <variant>
Expand Down Expand Up @@ -174,7 +173,6 @@ inline typename std::enable_if_t<
detail::is_non_array_with_subscript_and_size_v<LeftArrT> &&
detail::is_non_array_with_subscript_and_size_v<RightArrT>>
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]);
}
Expand Down Expand Up @@ -251,7 +249,7 @@ inline typename std::enable_if_t<
detail::is_non_array_with_subscript_and_size_v<RightArrT>,
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;
}
Expand Down

0 comments on commit 33f88a4

Please sign in to comment.