[clang] Reland "[HIP] Use original file path for CUID" (#108771) (PR #111885)
Yaxun Liu via cfe-commits
cfe-commits at lists.llvm.org
Wed Jan 22 07:13:05 PST 2025
================
@@ -1,13 +1,15 @@
// Check CUID generated by hash.
// The same CUID is generated for the same file with the same options.
+// RUN: cd %S
+
// RUN: %clang -### -x hip --target=x86_64-unknown-linux-gnu --no-offload-new-driver \
// RUN: --offload-arch=gfx906 -c -nogpuinc -nogpulib -fuse-cuid=hash \
-// RUN: %S/Inputs/hip_multiple_inputs/a.cu >%t.out 2>&1
----------------
yxsamliu wrote:
CUID generated by hashing not only hashes file path, but also original options passed to clang driver. This is to differentiate the situation that one file is compiled with different options to generate different object files (e.g. rccl). Therefore, adding `--offload-host-only` will change the CUID generated by hashing.
This lit test compares the CUID generated by hashing for host and device and makes sure they are the same. We just do not check the literal value of the CUID since it is affected by platform-specific options. If we use `-cuid=`, the CUID will be the specified value and not generated by hashing.
https://github.com/llvm/llvm-project/pull/111885
More information about the cfe-commits
mailing list