For NVPTX, printf can be used just with a function declaration. For AMDGCN, an
function definition is added, but it simply returns.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
I think clang will lower printf for nvptx targets to vprintf. Can you check that. Also check what it emits for amdgcn targets.
openmp/libomptarget/DeviceRTL/src/Debug.cpp | ||
---|---|---|
37 ↗ | (On Diff #372358) | no need for these annotations. |
I'm surprised that compiles for amdgpu, should be an error about variadic functions being unimplemented. Perhaps the cmake for the new runtime only builds on nvptx?
I checked nvptx, it works. Will Ask @JonChesterfield to help see if clang lowers it to vprintf as well.
openmp/libomptarget/DeviceRTL/src/Debug.cpp | ||
---|---|---|
37 ↗ | (On Diff #372369) | Since AMD FE doesn't lower it to vprintf, what should we do here? If we enable the feature, there will be link error. |
Stub it out with a macro until printf exists for amdgpu. Hopefully that won't be too much longer
gaurd the code with macro for now
openmp/libomptarget/DeviceRTL/include/Debug.h | ||
---|---|---|
35 | @JonChesterfield This should be sufficient, right? |
If we use PRINT everywhere, sure. Else we need PRINTF too.
I had #define printf(...) in mind instead of the MACROs, but strictly speaking one probably shouldn't override a libc function like that.