Commit 40e6a9c
committed
Avoid "statement is unreachable" compile errors in async_reduce.cu test
Test test_async_reduce_allocator_on_then_after in async_reduce.cu has
"KNOWN_FAILURE;" in the middle of a code block. This results in "statement is
unreachable" compiler errors from NVC++ on the following line.
```
"/proj/cuda/thrust/main/testing/async_reduce.cu", line 978: error: statement is
unreachable
ASSERT_EQUAL_QUIET(stream1, f2.stream().native_handle());
^
detected during:
instantiation of "void unittest::for_each_type<TypeList, Function,
T, i>::operator()(U) [with TypeList=NumericTypes,
Function=test_async_reduce_allocator_on_then_after,
T=char, i=0U, U=size_t]" at line 537 of
"/proj/cuda/thrust/main/testing/unittest/testframework.h"
instantiation of "void VariableUnitTest<TestName, TypeList>::run()
[with TestName=test_async_reduce_allocator_on_then_after,
TypeList=NumericTypes]"
```
The compiler error is correct. KNOWN_FAILURE expands to a throw expression,
so everything after it is dead code.
Fix the problem by putting everything after KNOWN_FAILURE in a "#if 0" block.1 parent 0c81f42 commit 40e6a9c
1 file changed
Lines changed: 2 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
973 | 973 | | |
974 | 974 | | |
975 | 975 | | |
| 976 | + | |
976 | 977 | | |
977 | 978 | | |
978 | 979 | | |
| |||
986 | 987 | | |
987 | 988 | | |
988 | 989 | | |
| 990 | + | |
989 | 991 | | |
990 | 992 | | |
991 | 993 | | |
| |||
0 commit comments