summaryrefslogtreecommitdiff
path: root/dev-util/hip/files/hip-3.5.1-detect_offload-arch_for_clang-roc.patch
diff options
context:
space:
mode:
Diffstat (limited to 'dev-util/hip/files/hip-3.5.1-detect_offload-arch_for_clang-roc.patch')
-rw-r--r--dev-util/hip/files/hip-3.5.1-detect_offload-arch_for_clang-roc.patch21
1 files changed, 21 insertions, 0 deletions
diff --git a/dev-util/hip/files/hip-3.5.1-detect_offload-arch_for_clang-roc.patch b/dev-util/hip/files/hip-3.5.1-detect_offload-arch_for_clang-roc.patch
new file mode 100644
index 000000000000..7997e2929666
--- /dev/null
+++ b/dev-util/hip/files/hip-3.5.1-detect_offload-arch_for_clang-roc.patch
@@ -0,0 +1,21 @@
+diff -uprN HIP-rocm-3.5.1/bin/hipcc patched/bin/hipcc
+--- HIP-rocm-3.5.1/bin/hipcc 2020-07-21 14:29:11.625878447 +0800
++++ patched/bin/hipcc 2020-07-21 14:34:11.454395203 +0800
+@@ -675,7 +675,7 @@ foreach $arg (@ARGV)
+ $prevArg = $arg;
+ }
+
+-if($HIP_PLATFORM eq "hcc"){
++if($HIP_PLATFORM eq "hcc" || $HIP_PLATFORM eq "rocclr"){
+ # No AMDGPU target specified at commandline. So look for HCC_AMDGPU_TARGET
+ if($default_amdgpu_target eq 1) {
+ if (defined $ENV{HCC_AMDGPU_TARGET}) {
+@@ -694,6 +694,8 @@ if($HIP_PLATFORM eq "hcc"){
+
+ if($HIP_COMPILER eq "hcc") {
+ $GPU_ARCH_OPT = " --amdgpu-target=";
++ } elsif($HIP_COMPILER eq "clang") {
++ $GPU_ARCH_OPT = " --offload-arch=";
+ } else {
+ $GPU_ARCH_OPT = " --cuda-gpu-arch=";
+ }