Skip to content

Commit

Permalink
Merge pull request #824 from AlexeySachkov/private/asachkov/remove-as…
Browse files Browse the repository at this point in the history
…sert-call-from-device-code

Do not use `assert` in device code
  • Loading branch information
bader authored Nov 4, 2023
2 parents c22fae8 + 33f88a4 commit a6c389b
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 a6c389b

Please sign in to comment.