c/parallel/test should capture std::cerr on tests checking that compilation fails
- Dominant language
- C++
- Stars
- 2.5k
- Forks
- 486
- Avg merge
- 2d 6h
- Merged PRs (30d)
- 295
Description
`"test_unique_by_key.cpp"` file contains a test checking that call to `cccl_device_unique_by_key_build` returns an error code for some problem.
c/parallel library unconditionally outputs compilation/linking log to `std::cerr` when build step fails. Seeing these outputs during a green test run is counter-intuitive.
```
(cccl) coder ➜ ~/cccl $ ./build/cuda12.8-gcc13/cccl-c-parallel/bin/cccl.c.parallel.test.unique_by_key.cpp
Randomness seeded to: 73079813
ptxas error : Entry function '_ZN3cub17CUB_300100_SM_8606detail13unique_by_key28DeviceUniqueByKeySweepKernelI27device_unique_by_key_policyP9storage_tPiS6_S7_S7_NS0_13ScanTileStateIyLb1EEE10op_wrappery33device_unique_by_key_vsmem_helperEEvT0_T1_T2_T3_T4_T5_T6_T7_iNS1_7vsmem_tE' uses too much shared data (0xd000 bytes, 0xc000 max)
ERROR NVJITLINK_ERROR_PTX_COMPILE: JIT the PTX (ltoPtx)
EXCEPTION in cccl_device_unique_by_key_build(): nvJitLink error: 4
===============================================================================
All tests passed (826 assertions in 19 test cases)
```
The message comes from the test which checks for a failure to build:
```
(cccl) coder ➜ ~/cccl $ ./build/cuda12.8-gcc13/cccl-c-parallel/bin/cccl.c.parallel.test.unique_by_key.cpp "*DeviceSelect::UniqueByKey fails to build for large types due to no vsmem*"
Filters: "*DeviceSelect::UniqueByKey fails to build for large types due to no vsmem*"
Randomness seeded to: 1149896101
ptxas error : Entry function '_ZN3cub17CUB_300100_SM_8606detail13unique_by_key28DeviceUniqueByKeySweepKernelI27device_unique_by_key_policyP9storage_tPiS6_S7_S7_NS0_13ScanTileStateIyLb1EEE10op_wrappery33device_unique_by_key_vsmem_helperEEvT0_T1_T2_T3_T4_T5_T6_T7_iNS1_7vsmem_tE' uses too much shared data (0xd000 bytes, 0xc000 max)
ERROR NVJITLINK_ERROR_PTX_COMPILE: JIT the PTX (ltoPtx)
EXCEPTION in cccl_device_unique_by_key_build(): nvJitLink error: 4
===============================================================================
All tests passed (12 assertions in 1 test case)
```
This task is for the test to capture `std::cerr` stream and suppress such outputs, or validate that the output is not empty and contains "too much shared data" substring.
Contributor guide
Assessment
This issue has not been assessed yet.