Skip to content

Commit 26baba9

Browse files
pcaspersjenkins
authored andcommitted
QPR-12493 limit number of errors that are output
1 parent eacbbf9 commit 26baba9

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

QuantExt/test/computeenvironment.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -337,10 +337,15 @@ BOOST_AUTO_TEST_CASE(testRngGenerationTmp) {
337337

338338
double tol = settings.useDoublePrecision ? 1E-7 : 1E-3;
339339

340+
Size noErrors = 0, errorThreshold = 10;
340341
for (Size j = 0; j < 2; ++j) {
341342
for (Size i = 0; i < n; ++i) {
342343
Real ref = sg.nextSequence().value[0];
343-
BOOST_CHECK_SMALL(output[j][i] - ref, tol);
344+
if(std::abs(output[j][i] - ref) > tol && noErrors < errorThreshold) {
345+
BOOST_ERROR("gpu value (" << output[j][i] << ") at j=" << j << ", i=" << i
346+
<< " does not match cpu value (" << ref << ")");
347+
noErrors++;
348+
}
344349
}
345350
}
346351
}

0 commit comments

Comments
 (0)