The Thrust examples are currently validated by comparing their output to a reference output using the LLVM FileCheck utility. This additional validation is not enabled by default, and as a result the ctest tests that run example code cannot fail by default.
Failures
After enabling FileCheck, examples start failing on configurations with a non-cpp host:
The example.sum seems to have a serious issue with producing stable results:
$ for i in `seq 10`;do examples/thrust.omp.omp.cpp11.example.sum; done
sum is 509119
sum is 498850
sum is 521001
sum is 510424
sum is 527787
sum is 507166
sum is 500323
sum is 519696
sum is 524764
sum is 528394
example.bucket_sort2d
The example.bucket_sort2d failures seem to be from the output being written in non-deterministic order when the host system is not cpp.
RCCA: Replace FileCheck with more robust runtime checks
We need to address these failures and fix them, but should also reconsider the use of optional dependencies like FileCheck for testing, since these failures have done undetected for a while. Instead, the example executables should validate themselves at runtime and use their exit code to indicate failure. This will simplify our ctest harness significantly.
Open Question: DVS?
I'm not sure how difficult it would be to update DVS to expect runtime failures. Updating CMake for this would be trivial.
@allisonvacanti is this still relevant? It sounds like we'd want to add the equivalent of unit test EXPECTS logic to the examples to verify they produce valid output at runtime?
Background
The Thrust examples are currently validated by comparing their output to a reference output using the LLVM
FileCheck
utility. This additional validation is not enabled by default, and as a result the ctest tests that run example code cannot fail by default.Failures
After enabling
FileCheck
, examples start failing on configurations with a non-cpp
host:example.sum
The
example.sum
seems to have a serious issue with producing stable results:example.bucket_sort2d
The
example.bucket_sort2d
failures seem to be from the output being written in non-deterministic order when the host system is notcpp
.RCCA: Replace
FileCheck
with more robust runtime checksWe need to address these failures and fix them, but should also reconsider the use of optional dependencies like
FileCheck
for testing, since these failures have done undetected for a while. Instead, the example executables should validate themselves at runtime and use their exit code to indicate failure. This will simplify our ctest harness significantly.Open Question: DVS?
I'm not sure how difficult it would be to update DVS to expect runtime failures. Updating CMake for this would be trivial.