Skip to content

Commit 1d8acac

Browse files
committed
[Offload] Move HIP and CUDA to new driver by default
Summary: This patch updates the `--offload-new-driver` flag to be default for all current offloading languages. This mostly just required updating a lot of tests to use the old format. I tried to update them where possible, but some were directly checking the old format. This is not intended to be landed immediately, but to allow for greater testing. One potential issue I've discovered is the lack of SPIR-V support or handling for `--offload`.
1 parent 439d7de commit 1d8acac

20 files changed

+82
-95
lines changed

clang/lib/Driver/Driver.cpp

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4154,11 +4154,9 @@ void Driver::BuildActions(Compilation &C, DerivedArgList &Args,
41544154
handleArguments(C, Args, Inputs, Actions);
41554155

41564156
bool UseNewOffloadingDriver =
4157-
C.isOffloadingHostKind(Action::OFK_OpenMP) ||
4158-
Args.hasFlag(options::OPT_foffload_via_llvm,
4159-
options::OPT_fno_offload_via_llvm, false) ||
4157+
C.getActiveOffloadKinds() != Action::OFK_None &&
41604158
Args.hasFlag(options::OPT_offload_new_driver,
4161-
options::OPT_no_offload_new_driver, false);
4159+
options::OPT_no_offload_new_driver, true);
41624160

41634161
// Builder to be used to build offloading actions.
41644162
std::unique_ptr<OffloadingActionBuilder> OffloadBuilder =
@@ -4879,7 +4877,7 @@ Action *Driver::ConstructPhaseAction(
48794877
offloadDeviceOnly() ||
48804878
(TargetDeviceOffloadKind == Action::OFK_HIP &&
48814879
!Args.hasFlag(options::OPT_offload_new_driver,
4882-
options::OPT_no_offload_new_driver, false)))
4880+
options::OPT_no_offload_new_driver, true)))
48834881
? types::TY_LLVM_IR
48844882
: types::TY_LLVM_BC;
48854883
return C.MakeAction<BackendJobAction>(Input, Output);

clang/lib/Driver/ToolChains/Clang.cpp

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -4981,8 +4981,9 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA,
49814981
bool IsHostOffloadingAction =
49824982
JA.isHostOffloading(Action::OFK_OpenMP) ||
49834983
(JA.isHostOffloading(C.getActiveOffloadKinds()) &&
4984+
C.getActiveOffloadKinds() != Action::OFK_None &&
49844985
Args.hasFlag(options::OPT_offload_new_driver,
4985-
options::OPT_no_offload_new_driver, false));
4986+
options::OPT_no_offload_new_driver, true));
49864987

49874988
bool IsRDCMode =
49884989
Args.hasFlag(options::OPT_fgpu_rdc, options::OPT_fno_gpu_rdc, false);
@@ -5309,7 +5310,7 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA,
53095310
if (IsUsingLTO) {
53105311
if (IsDeviceOffloadAction && !JA.isDeviceOffloading(Action::OFK_OpenMP) &&
53115312
!Args.hasFlag(options::OPT_offload_new_driver,
5312-
options::OPT_no_offload_new_driver, false) &&
5313+
options::OPT_no_offload_new_driver, true) &&
53135314
!Triple.isAMDGPU()) {
53145315
D.Diag(diag::err_drv_unsupported_opt_for_target)
53155316
<< Args.getLastArg(options::OPT_foffload_lto,
@@ -6774,16 +6775,12 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA,
67746775
Args.addOptOutFlag(CmdArgs, options::OPT_fopenmp_extensions,
67756776
options::OPT_fno_openmp_extensions);
67766777
}
6777-
// Forward the offload runtime change to code generation, liboffload implies
6778-
// new driver. Otherwise, check if we should forward the new driver to change
6779-
// offloading code generation.
6780-
if (Args.hasFlag(options::OPT_foffload_via_llvm,
6781-
options::OPT_fno_offload_via_llvm, false)) {
6782-
CmdArgs.append({"--offload-new-driver", "-foffload-via-llvm"});
6783-
} else if (Args.hasFlag(options::OPT_offload_new_driver,
6784-
options::OPT_no_offload_new_driver, false)) {
6778+
6779+
// Forward the new driver to change offloading code generation.
6780+
if (C.getActiveOffloadKinds() != Action::OFK_None &&
6781+
Args.hasFlag(options::OPT_offload_new_driver,
6782+
options::OPT_no_offload_new_driver, true))
67856783
CmdArgs.push_back("--offload-new-driver");
6786-
}
67876784

67886785
SanitizeArgs.addArgs(TC, Args, CmdArgs, InputType);
67896786

clang/test/Driver/cl-offload.cu

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,10 @@
1818
// CUDA-SAME: "-Weverything"
1919
// CUDA: link
2020

21-
// HIP: "-cc1" "-triple" "x86_64-pc-windows-msvc{{.*}}" "-aux-triple" "amdgcn-amd-amdhsa"
22-
// HIP-SAME: "-Weverything"
2321
// HIP: "-cc1" "-triple" "amdgcn-amd-amdhsa" "-aux-triple" "x86_64-pc-windows-msvc"
2422
// HIP-SAME: "-Weverything"
25-
// HIP: {{lld.* "-flavor" "gnu" "-m" "elf64_amdgpu"}}
23+
// HIP: "-cc1" "-triple" "x86_64-pc-windows-msvc{{.*}}" "-aux-triple" "amdgcn-amd-amdhsa"
24+
// HIP-SAME: "-Weverything"
2625
// HIP: {{link.* "amdhip64.lib"}}
2726

2827
// CMake uses this option when finding packages for HIP, so

clang/test/Driver/cuda-arch-translation.cu

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -68,19 +68,19 @@
6868

6969
// HIP: clang-offload-bundler
7070

71-
// SM20:--image=profile=sm_20{{.*}}--image=profile=compute_20
72-
// SM21:--image=profile=sm_21{{.*}}--image=profile=compute_20
73-
// SM30:--image=profile=sm_30{{.*}}--image=profile=compute_30
74-
// SM32:--image=profile=sm_32{{.*}}--image=profile=compute_32
75-
// SM35:--image=profile=sm_35{{.*}}--image=profile=compute_35
76-
// SM37:--image=profile=sm_37{{.*}}--image=profile=compute_37
77-
// SM50:--image=profile=sm_50{{.*}}--image=profile=compute_50
78-
// SM52:--image=profile=sm_52{{.*}}--image=profile=compute_52
79-
// SM53:--image=profile=sm_53{{.*}}--image=profile=compute_53
80-
// SM60:--image=profile=sm_60{{.*}}--image=profile=compute_60
81-
// SM61:--image=profile=sm_61{{.*}}--image=profile=compute_61
82-
// SM62:--image=profile=sm_62{{.*}}--image=profile=compute_62
83-
// SM70:--image=profile=sm_70{{.*}}--image=profile=compute_70
71+
// SM20:--image=profile=sm_20{{.*}}
72+
// SM21:--image=profile=sm_21{{.*}}
73+
// SM30:--image=profile=sm_30{{.*}}
74+
// SM32:--image=profile=sm_32{{.*}}
75+
// SM35:--image=profile=sm_35{{.*}}
76+
// SM37:--image=profile=sm_37{{.*}}
77+
// SM50:--image=profile=sm_50{{.*}}
78+
// SM52:--image=profile=sm_52{{.*}}
79+
// SM53:--image=profile=sm_53{{.*}}
80+
// SM60:--image=profile=sm_60{{.*}}
81+
// SM61:--image=profile=sm_61{{.*}}
82+
// SM62:--image=profile=sm_62{{.*}}
83+
// SM70:--image=profile=sm_70{{.*}}
8484
// GFX600:-targets=host-x86_64-unknown-linux,hipv4-amdgcn-amd-amdhsa--gfx600
8585
// GFX601:-targets=host-x86_64-unknown-linux,hipv4-amdgcn-amd-amdhsa--gfx601
8686
// GFX602:-targets=host-x86_64-unknown-linux,hipv4-amdgcn-amd-amdhsa--gfx602

clang/test/Driver/cuda-bindings.cu

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,14 @@
2323
// BIN-NOT: cuda-bindings-device-cuda-nvptx64
2424
// BIN: # "powerpc64le-ibm-linux-gnu" - "clang",{{.*}} output:
2525
// BIN-NOT: cuda-bindings-device-cuda-nvptx64
26-
// BIN: # "powerpc64le-ibm-linux-gnu" - "GNU::Linker", inputs:{{.*}}, output: "a.out"
26+
// BIN: # "powerpc64le-ibm-linux-gnu" - "Offload::Linker", inputs:{{.*}}, output: "a.out"
2727

2828
//
2929
// Test single gpu architecture up to the assemble phase.
3030
//
3131
// RUN: %clang -target powerpc64le-ibm-linux-gnu -ccc-print-bindings --cuda-gpu-arch=sm_30 %s -S 2>&1 \
3232
// RUN: | FileCheck -check-prefix=ASM %s
33-
// ASM-DAG: # "nvptx64-nvidia-cuda" - "clang",{{.*}} output: "cuda-bindings-cuda-nvptx64-nvidia-cuda-sm_30.s"
33+
// ASM-DAG: # "nvptx64-nvidia-cuda" - "clang",{{.*}} output: "[[BINDINGS:.+.s]]"
3434
// ASM-DAG: # "powerpc64le-ibm-linux-gnu" - "clang",{{.*}} output: "cuda-bindings.s"
3535

3636
//
@@ -61,8 +61,8 @@
6161
// BIN2-NOT: cuda-bindings-device-cuda-nvptx64
6262
// BIN2: # "powerpc64le-ibm-linux-gnu" - "clang",{{.*}} output:
6363
// BIN2-NOT: cuda-bindings-device-cuda-nvptx64
64-
// AOUT: # "powerpc64le-ibm-linux-gnu" - "GNU::Linker", inputs:{{.*}}, output: "a.out"
65-
// TOUT: # "powerpc64le-ibm-linux-gnu" - "GNU::Linker", inputs:{{.*}}, output: "{{.*}}/out"
64+
// AOUT: # "powerpc64le-ibm-linux-gnu" - "Offload::Linker", inputs:{{.*}}, output: "a.out"
65+
// TOUT: # "powerpc64le-ibm-linux-gnu" - "Offload::Linker", inputs:{{.*}}, output: "{{.*}}/out"
6666

6767
// .. same, but with -fsyntax-only
6868
// RUN: %clang -target powerpc64le-ibm-linux-gnu -ccc-print-bindings -fsyntax-only \
@@ -78,9 +78,9 @@
7878
// RUN: --offload-arch=sm_30,sm_35 %s -o %t/out 2>&1 \
7979
// RUN: | FileCheck -check-prefix=SYN %s
8080
// SYN-NOT: inputs:
81-
// SYN: # "powerpc64le-ibm-linux-gnu" - "clang", inputs: [{{.*}}], output: (nothing)
82-
// SYN-NEXT: # "nvptx64-nvidia-cuda" - "clang", inputs: [{{.*}}], output: (nothing)
81+
// SYN: # "nvptx64-nvidia-cuda" - "clang", inputs: [{{.*}}], output: (nothing)
8382
// SYN-NEXT: # "nvptx64-nvidia-cuda" - "clang", inputs: [{{.*}}], output: (nothing)
83+
// SYN-NEXT: # "powerpc64le-ibm-linux-gnu" - "clang", inputs: [{{.*}}], output: (nothing)
8484
// SYN-NOT: inputs
8585

8686
// .. and with --offload-new-driver
@@ -97,7 +97,7 @@
9797
// RUN: --offload-arch=sm_30,sm_35 %s --offload-new-driver -o %t/out 2>&1 \
9898
// RUN: | FileCheck -check-prefix=NDSYN %s
9999
// NDSYN-NOT: inputs:
100-
// NDSYN: # "nvptx64-nvidia-cuda" - "clang", inputs: [{{.*}}], output: (nothing)
100+
// NDSYN: # "nvptx64-nvidia-cuda" - "clang", inputs: [{{.*}}], output: (nothing)
101101
// NDSYN-NEXT: # "nvptx64-nvidia-cuda" - "clang", inputs: [{{.*}}], output: (nothing)
102102
// NDSYN-NEXT: # "powerpc64le-ibm-linux-gnu" - "clang", inputs: [{{.*}}], output: (nothing)
103103
// NDSYN-NOT: inputs:
@@ -109,8 +109,8 @@
109109
// RUN: %clang -target powerpc64le-ibm-linux-gnu -ccc-print-bindings \
110110
// RUN: --cuda-gpu-arch=sm_30 --cuda-gpu-arch=sm_35 %s -S 2>&1 \
111111
// RUN: | FileCheck -check-prefix=ASM2 %s
112-
// ASM2-DAG: # "nvptx64-nvidia-cuda" - "clang",{{.*}} output: "cuda-bindings-cuda-nvptx64-nvidia-cuda-sm_30.s"
113-
// ASM2-DAG: # "nvptx64-nvidia-cuda" - "clang",{{.*}} output: "cuda-bindings-cuda-nvptx64-nvidia-cuda-sm_35.s"
112+
// ASM2-DAG: # "nvptx64-nvidia-cuda" - "clang",{{.*}} output: "[[SM30:.+.s]]"
113+
// ASM2-DAG: # "nvptx64-nvidia-cuda" - "clang",{{.*}} output: "[[SM35:.+.s]]"
114114
// ASM2-DAG: # "powerpc64le-ibm-linux-gnu" - "clang",{{.*}} output: "cuda-bindings.s"
115115

116116
//
@@ -125,7 +125,7 @@
125125
// RUN: | FileCheck -check-prefix=HBIN %s
126126
// HBIN: # "powerpc64le-ibm-linux-gnu" - "clang",{{.*}} output:
127127
// HBIN-NOT: cuda-bindings-device-cuda-nvptx64
128-
// HBIN: # "powerpc64le-ibm-linux-gnu" - "GNU::Linker", inputs:{{.*}}, output: "a.out"
128+
// HBIN: # "powerpc64le-ibm-linux-gnu" - "Offload::Linker", inputs:{{.*}}, output: "a.out"
129129

130130
//
131131
// Test one or more gpu architecture up to the assemble phase in host-only
@@ -163,7 +163,7 @@
163163
// Test two gpu architectures with complete compilation in device-only
164164
// compilation mode.
165165
//
166-
// RUN: %clang -target powerpc64le-ibm-linux-gnu -ccc-print-bindings \
166+
// RUN: %clang -target powerpc64le-ibm-linux-gnu -ccc-print-bindings --no-offload-new-driver \
167167
// RUN: --cuda-gpu-arch=sm_30 --cuda-gpu-arch=sm_35 %s --cuda-device-only 2>&1 \
168168
// RUN: | FileCheck -check-prefix=DBIN2 %s
169169
// DBIN2: # "nvptx64-nvidia-cuda" - "clang",{{.*}} output:
@@ -177,7 +177,7 @@
177177
// Test two gpu architectures up to the assemble phase in device-only
178178
// compilation mode.
179179
//
180-
// RUN: %clang -target powerpc64le-ibm-linux-gnu -ccc-print-bindings \
180+
// RUN: %clang -target powerpc64le-ibm-linux-gnu -ccc-print-bindings --no-offload-new-driver \
181181
// RUN: --cuda-gpu-arch=sm_30 --cuda-gpu-arch=sm_35 %s --cuda-device-only -S 2>&1 \
182182
// RUN: | FileCheck -check-prefix=DASM2 %s
183183
// DASM2: # "nvptx64-nvidia-cuda" - "clang",{{.*}} output: "cuda-bindings-cuda-nvptx64-nvidia-cuda-sm_30.s"

clang/test/Driver/cuda-options.cu

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@
22

33
// Simple compilation case. Compile device-side to PTX assembly and make sure
44
// we use it on the host side.
5-
// RUN: %clang -### -target x86_64-linux-gnu -c -nogpulib -nogpuinc %s 2>&1 \
5+
// RUN: %clang -### --cuda-include-ptx=all -target x86_64-linux-gnu -c -nogpulib -nogpuinc %s 2>&1 \
66
// RUN: | FileCheck -check-prefix DEVICE -check-prefix DEVICE-NOSAVE \
77
// RUN: -check-prefix HOST -check-prefix INCLUDES-DEVICE \
88
// RUN: -check-prefix NOLINK %s
99

1010
// Typical compilation + link case.
11-
// RUN: %clang -### -target x86_64-linux-gnu -nogpulib -nogpuinc %s 2>&1 \
11+
// RUN: %clang -### --cuda-include-ptx=all -target x86_64-linux-gnu -nogpulib -nogpuinc %s 2>&1 \
1212
// RUN: | FileCheck -check-prefix DEVICE -check-prefix DEVICE-NOSAVE \
1313
// RUN: -check-prefix HOST -check-prefix INCLUDES-DEVICE \
1414
// RUN: -check-prefix LINK %s
@@ -33,7 +33,7 @@
3333
// RUN: -check-prefix NOINCLUDES-DEVICE -check-prefix LINK %s
3434

3535
// RUN: %clang -### --target=x86_64-linux-gnu --cuda-compile-host-device \
36-
// RUN: --cuda-host-only -nogpulib -nogpuinc %s 2>&1 \
36+
// RUN: --cuda-host-only --cuda-path=%S/Inputs/CUDA/usr/local/cuda %s 2>&1 \
3737
// RUN: | FileCheck -check-prefix NODEVICE -check-prefix HOST \
3838
// RUN: -check-prefix NOINCLUDES-DEVICE -check-prefix LINK %s
3939

@@ -48,27 +48,27 @@
4848
// RUN: -check-prefix NOHOST -check-prefix NOLINK %s
4949

5050
// RUN: %clang -### --target=x86_64-linux-gnu --cuda-host-only \
51-
// RUN: -nogpulib -nogpuinc --cuda-compile-host-device %s 2>&1 \
51+
// RUN: --cuda-include-ptx=all -nogpulib -nogpuinc --cuda-compile-host-device %s 2>&1 \
5252
// RUN: | FileCheck -check-prefix DEVICE -check-prefix DEVICE-NOSAVE \
5353
// RUN: -check-prefix HOST -check-prefix INCLUDES-DEVICE \
5454
// RUN: -check-prefix LINK %s
5555

5656
// RUN: %clang -### --target=x86_64-linux-gnu --cuda-device-only \
57-
// RUN: -nogpulib -nogpuinc --cuda-compile-host-device %s 2>&1 \
57+
// RUN: --cuda-include-ptx=all -nogpulib -nogpuinc --cuda-compile-host-device %s 2>&1 \
5858
// RUN: | FileCheck -check-prefix DEVICE -check-prefix DEVICE-NOSAVE \
5959
// RUN: -check-prefix HOST -check-prefix INCLUDES-DEVICE \
6060
// RUN: -check-prefix LINK %s
6161

6262
// Verify that --cuda-gpu-arch option passes the correct GPU architecture to
6363
// device compilation.
64-
// RUN: %clang -### -nogpulib -nogpuinc --target=x86_64-linux-gnu --cuda-gpu-arch=sm_52 -c %s 2>&1 \
64+
// RUN: %clang -### --cuda-include-ptx=all -nogpulib -nogpuinc --target=x86_64-linux-gnu --cuda-gpu-arch=sm_52 -c %s 2>&1 \
6565
// RUN: | FileCheck -check-prefix DEVICE -check-prefix DEVICE-NOSAVE \
6666
// RUN: -check-prefix DEVICE-SM52 -check-prefix HOST \
6767
// RUN: -check-prefix INCLUDES-DEVICE -check-prefix NOLINK %s
6868

6969
// Verify that there is one device-side compilation per --cuda-gpu-arch args
7070
// and that all results are included on the host side.
71-
// RUN: %clang -### --target=x86_64-linux-gnu \
71+
// RUN: %clang -### --target=x86_64-linux-gnu --cuda-include-ptx=all \
7272
// RUN: -nogpulib -nogpuinc --cuda-gpu-arch=sm_60 --cuda-gpu-arch=sm_52 -c %s 2>&1 \
7373
// RUN: | FileCheck -check-prefixes DEVICE,DEVICE-NOSAVE,DEVICE2 \
7474
// RUN: -check-prefixes DEVICE-SM52,DEVICE2-SM60 \
@@ -128,9 +128,9 @@
128128
// f) --no-cuda-gpu-arch=all negates all preceding --cuda-gpu-arch=X
129129
// RUN: %clang -### -target x86_64-linux-gnu --cuda-device-only \
130130
// RUN: -nogpulib -nogpuinc --cuda-gpu-arch=sm_60 --cuda-gpu-arch=sm_52 \
131-
// RUN: --no-cuda-gpu-arch=all \
131+
// RUN: --no-cuda-version-check --no-cuda-gpu-arch=all \
132132
// RUN: --cuda-gpu-arch=sm_70 \
133-
// RUN: -c -nogpulib -nogpuinc %s 2>&1 \
133+
// RUN: -c --cuda-path=%S/Inputs/CUDA/usr/local/cuda %s 2>&1 \
134134
// RUN: | FileCheck -check-prefixes NOARCH-SM52,NOARCH-SM60,ARCH-SM70 %s
135135

136136
// g) There's no --cuda-gpu-arch=all
@@ -141,7 +141,7 @@
141141

142142

143143
// Verify that --[no-]cuda-include-ptx arguments are handled correctly.
144-
// a) by default we're including PTX for all GPUs.
144+
// a) by default we're not including PTX for all GPUs.
145145
// RUN: %clang -### --target=x86_64-linux-gnu -nogpulib -nogpuinc \
146146
// RUN: --cuda-gpu-arch=sm_60 --cuda-gpu-arch=sm_52 \
147147
// RUN: -c %s 2>&1 \
@@ -183,7 +183,8 @@
183183
// Verify -flto=thin -fwhole-program-vtables handling. This should result in
184184
// both options being passed to the host compilation, with neither passed to
185185
// the device compilation.
186-
// RUN: %clang -### --target=x86_64-linux-gnu -nogpulib -nogpuinc -c -flto=thin -fwhole-program-vtables %s 2>&1 \
186+
// RUN: %clang -### --target=x86_64-linux-gnu --cuda-include-ptx=all \
187+
// RUN: -nogpulib -nogpuinc -c -flto=thin -fwhole-program-vtables %s 2>&1 \
187188
// RUN: | FileCheck -check-prefixes DEVICE,DEVICE-NOSAVE,HOST,INCLUDES-DEVICE,NOLINK,THINLTOWPD %s
188189
// THINLTOWPD-NOT: error: invalid argument '-fwhole-program-vtables' only allowed with '-flto'
189190

clang/test/Driver/cuda-output-asm.cu

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,9 @@
1717
// SM30-DAG: "-cc1" "-triple" "nvptx64-nvidia-cuda"
1818
// SM30-same: "-target-cpu" "sm_30"
1919

20-
// RUN: not %clang -### -S --target=x86_64-linux-gnu -o foo.s %s 2>&1 \
21-
// RUN: | FileCheck -check-prefix MULTIPLE-OUTPUT-FILES %s
2220
// RUN: not %clang -### -S --target=x86_64-linux-gnu --cuda-device-only \
2321
// RUN: --cuda-gpu-arch=sm_20 --cuda-gpu-arch=sm_30 -o foo.s %s 2>&1 \
2422
// RUN: | FileCheck -check-prefix MULTIPLE-OUTPUT-FILES %s
25-
// RUN: not %clang -### -emit-llvm -c --target=x86_64-linux-gnu -o foo.s %s 2>&1 \
26-
// RUN: | FileCheck -check-prefix MULTIPLE-OUTPUT-FILES %s
2723
// MULTIPLE-OUTPUT-FILES: error: cannot specify -o when generating multiple output files
2824
// Make sure we do not get duplicate diagnostics.
2925
// MULTIPLE-OUTPUT-FILES-NOT: error: cannot specify -o when generating multiple output files

clang/test/Driver/hip-gz-options.hip

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,3 @@
1111
// CHECK-DAG: {{".*clang.*" .* "--compress-debug-sections=zlib"}}
1212
// CHECK-DAG: {{".*lld" .* "--compress-debug-sections=zlib"}}
1313
// CHECK-DAG: {{".*clang.*" .* "--compress-debug-sections=zlib"}}
14-
// CHECK: "--compress-debug-sections=zlib"

clang/test/Driver/hip-invalid-target-id.hip

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
// RUN: --rocm-path=%S/Inputs/rocm \
55
// RUN: %s 2>&1 | FileCheck -check-prefix=NOPLUS %s
66

7-
// NOPLUS: error: invalid target ID 'gfx908xnack'
7+
// NOPLUS: error: unsupported HIP gpu architecture: gfx908xnack
88

99
// RUN: not %clang -### --target=x86_64-linux-gnu \
1010
// RUN: -x hip --offload-arch=gfx900 \
@@ -55,7 +55,7 @@
5555
// RUN: --rocm-path=%S/Inputs/rocm \
5656
// RUN: %s 2>&1 | FileCheck -check-prefix=NOCOLON %s
5757

58-
// NOCOLON: error: invalid target ID 'gfx900+xnack'
58+
// NOCOLON: error: unsupported HIP gpu architecture: gfx900+xnack
5959

6060
// RUN: not %clang -### --target=x86_64-linux-gnu \
6161
// RUN: -x hip --offload-arch=gfx908 \

clang/test/Driver/hip-macros.hip

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,6 @@
7373
// RUN: %clang -E -dM --offload-arch=gfx940 --cuda-device-only -nogpuinc -nogpulib \
7474
// RUN: %s 2>&1 | FileCheck --check-prefixes=NOPTS %s
7575
// PTS-DAG: #define __HIP_API_PER_THREAD_DEFAULT_STREAM__ 1
76-
// PTS-DAG: #define __HIP_API_PER_THREAD_DEFAULT_STREAM__ 1
77-
// PTS-DAG: #define HIP_API_PER_THREAD_DEFAULT_STREAM 1
7876
// PTS-DAG: #define HIP_API_PER_THREAD_DEFAULT_STREAM 1
7977
// NOPTS-NOT: #define __HIP_API_PER_THREAD_DEFAULT_STREAM__
8078
// NOPTS-NOT: #define HIP_API_PER_THREAD_DEFAULT_STREAM
@@ -85,4 +83,3 @@
8583
// RUN: %s 2>&1 | FileCheck --check-prefix=APPROX %s
8684
// NOAPPROX-NOT: #define __CLANG_GPU_APPROX_TRANSCENDENTALS__
8785
// APPROX: #define __CLANG_GPU_APPROX_TRANSCENDENTALS__ 1
88-
// APPROX: #define __CLANG_GPU_APPROX_TRANSCENDENTALS__ 1

0 commit comments

Comments
 (0)