Skip to content

Commit 8d3f416

Browse files
committed
fixup
1 parent fb52c11 commit 8d3f416

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

Diff for: src/main.cpp

+7-6
Original file line numberDiff line numberDiff line change
@@ -332,21 +332,22 @@ void check_solution(const size_t num_times, T const* a, T const* b, T const* c,
332332
size_t failed = 0;
333333
T max_rel = std::numeric_limits<T>::epsilon() * T(100.0);
334334
T max_rel_dot = std::numeric_limits<T>::epsilon() * T(10000000.0);
335-
auto check = [&](const char* name, T is, T should, T max_rel, size_t i = size_t(-1)) {
335+
auto check = [&](const char* name, T is, T should, T mrel, size_t i = size_t(-1)) {
336336
// Relative difference:
337337
T diff = std::abs(is - should);
338338
T abs_is = std::abs(is);
339339
T abs_sh = std::abs(should);
340340
T largest = std::max(abs_is, abs_sh);
341-
T same = diff <= largest * max_rel;
341+
T same = diff <= largest * mrel;
342342
if (!same || std::isnan(is)) {
343343
++failed;
344344
if (failed > 10) return;
345345
std::cerr << "FAILED validation of " << name;
346346
if (i != size_t(-1)) std::cerr << "[" << i << "]";
347347
std::cerr << ": " << is << " (is) != " << should
348348
<< " (should)" << ", diff=" << diff << " > "
349-
<< largest * max_rel << std::endl;
349+
<< largest * mrel << " (largest=" << largest
350+
<< ", max_rel=" << mrel << ")" << std::endl;
350351
}
351352
};
352353

@@ -360,9 +361,9 @@ void check_solution(const size_t num_times, T const* a, T const* b, T const* c,
360361

361362
// Calculate the L^infty-norm relative error
362363
for (size_t i = 0; i < array_size; ++i) {
363-
check("a", a[i], goldA, i, max_rel);
364-
check("b", b[i], goldB, i, max_rel);
365-
check("c", c[i], goldC, i, max_rel);
364+
check("a", a[i], goldA, max_rel, i);
365+
check("b", b[i], goldB, max_rel, i);
366+
check("c", c[i], goldC, max_rel, i);
366367
}
367368

368369
if (failed > 0 && !silence_errors)

Diff for: src/std/STDStream.cpp

-1
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,6 @@ void STDStream<T>::nstream()
160160
auto as = std::ranges::subrange(a, a + array_size);
161161
auto bs = std::ranges::subrange(b, b + array_size);
162162
auto cs = std::ranges::subrange(c, c + array_size);
163-
auto r = std::views::zip(as, bs, cs);
164163
std::transform(exe_policy, r.begin(), r.end(), a, [](auto vs) {
165164
auto [a, b, c] = vs;
166165
return a + b + startScalar * c;

Diff for: src/std/model.cmake

+1-1
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ macro(setup)
6060
register_append_link_flags(${NVHPC_FLAGS})
6161
endif ()
6262
if (USE_TBB)
63-
register_link_library(TBB::tbb)
63+
register_link_library(TBB::tbb)
6464
endif ()
6565
if (USE_ONEDPL)
6666
register_definitions(USE_ONEDPL)

0 commit comments

Comments
 (0)