Figure out wide char (s)printf on GPUs
- Dominant language
- LLVM
- Stars
- 40.5k
- Forks
- 18.7k
- PR merge metrics
- PR metrics pending
Description
#213860 enabled the sprintf_test on the GPUs (which only run hermetic tests), exposing the fact that the wide-char part of the test does not work on these targets:
```
[32m[ RUN ] [0mLlvmLibcSprintfTest.WideCharConversion
/home/botworker/builds/openmp-offload-amdgpu-runtime-2/llvm.src/libc/src/__support/printf_core/generic/error_mapper.h:41: Assertion failed: 'false && "Invalid internal printf error code passed to internal_error_to_errno"' in function: 'int __llvm_libc_24_0_0_git::printf_core::internal_error_to_errno(int)'
```
I'm going to re-disable this part of the test, but this is a short term solution.
For long term, it's unclear to me whether wide chars are *supposed to* work on GPUs or not. If not, then these targets should probably define LIBC_COPT_PRINTF_DISABLE_WIDE. If not, then I guess someone needs to figure out why is this failing.
(@michaelrj-google @jhuber6)
Contributor guide
Research direction
Start with the named LlvmLibcSprintfTest.WideCharConversion test and the failure in libc/src/__support/printf_core/generic/error_mapper.h. Determine whether wide-character printf support is intended for GPU targets, then either verify the relevant LIBC_COPT_PRINTF_DISABLE_WIDE configuration or identify why the test reaches the invalid internal error path.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- compilers
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Needs clarification
- Newbie friendliness
- 38/100