[PATCH] D81176: [HIP] Add default header and include path
Han Zhu via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Sun Jun 21 23:57:31 PDT 2020
zhuhan0 added a comment.
This broke a test `clang/test/Tooling/clang-check-offload.cpp` for a critical Linux distro at Facebook. With this change, the test adds a `-include __clang_hip_runtime_wrapper` argument. The wrapper includes some standard c++ headers, but our distro don't have those headers in the default include paths, thus causing a break.
I notice this behavior doesn't happen for CUDA tests, which also rely on a similar `__clang_cuda_runtime_wrapper`. I think what's causing the difference is the different handling of `nogpuinc/nogpulib` option. My knowledge on this area is limited, so correct me if I'm wrong. CUDA seems to respect `nogpuinc` and doesn't include its wrapper if the flag is provided: https://github.com/llvm/llvm-project/blob/master/clang/lib/Driver/ToolChains/Cuda.cpp#L255. But based on this change, HIP does things differently: https://github.com/llvm/llvm-project/blob/master/clang/lib/Driver/ToolChains/AMDGPU.cpp#L226.
If I modify `RocmInstallationDetector::AddHIPIncludeArgs` to also respect `nogpuinc/nogpulib`, the test will pass for us. Is it a mistake for HIP to always include the wrapper file? Could you provide a fix for this issue? Thanks!
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D81176/new/
https://reviews.llvm.org/D81176
More information about the cfe-commits
mailing list