annotate clang/test/Driver/cuda-options.cu @ 222:81f6424ef0e3 llvm-original

LLVM original branch
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Sun, 18 Jul 2021 22:10:01 +0900 (2021-07-18)
parents 79ff65ed7e25
children c4bab56944e8
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
150
anatofuz
parents:
diff changeset
1 // Tests CUDA compilation pipeline construction in Driver.
anatofuz
parents:
diff changeset
2 // REQUIRES: clang-driver
anatofuz
parents:
diff changeset
3 // REQUIRES: x86-registered-target
anatofuz
parents:
diff changeset
4 // REQUIRES: nvptx-registered-target
anatofuz
parents:
diff changeset
5
anatofuz
parents:
diff changeset
6 // Simple compilation case. Compile device-side to PTX assembly and make sure
anatofuz
parents:
diff changeset
7 // we use it on the host side.
anatofuz
parents:
diff changeset
8 // RUN: %clang -### -target x86_64-linux-gnu -c %s 2>&1 \
anatofuz
parents:
diff changeset
9 // RUN: | FileCheck -check-prefix DEVICE -check-prefix DEVICE-NOSAVE \
anatofuz
parents:
diff changeset
10 // RUN: -check-prefix HOST -check-prefix INCLUDES-DEVICE \
anatofuz
parents:
diff changeset
11 // RUN: -check-prefix NOLINK %s
anatofuz
parents:
diff changeset
12
anatofuz
parents:
diff changeset
13 // Typical compilation + link case.
anatofuz
parents:
diff changeset
14 // RUN: %clang -### -target x86_64-linux-gnu %s 2>&1 \
anatofuz
parents:
diff changeset
15 // RUN: | FileCheck -check-prefix DEVICE -check-prefix DEVICE-NOSAVE \
anatofuz
parents:
diff changeset
16 // RUN: -check-prefix HOST -check-prefix INCLUDES-DEVICE \
anatofuz
parents:
diff changeset
17 // RUN: -check-prefix LINK %s
anatofuz
parents:
diff changeset
18
anatofuz
parents:
diff changeset
19 // Verify that --cuda-host-only disables device-side compilation, but doesn't
anatofuz
parents:
diff changeset
20 // disable host-side compilation/linking.
anatofuz
parents:
diff changeset
21 // RUN: %clang -### -target x86_64-linux-gnu --cuda-host-only %s 2>&1 \
anatofuz
parents:
diff changeset
22 // RUN: | FileCheck -check-prefix NODEVICE -check-prefix HOST \
anatofuz
parents:
diff changeset
23 // RUN: -check-prefix NOINCLUDES-DEVICE -check-prefix LINK %s
anatofuz
parents:
diff changeset
24
anatofuz
parents:
diff changeset
25 // Verify that --cuda-device-only disables host-side compilation and linking.
anatofuz
parents:
diff changeset
26 // RUN: %clang -### -target x86_64-linux-gnu --cuda-device-only %s 2>&1 \
anatofuz
parents:
diff changeset
27 // RUN: | FileCheck -check-prefix DEVICE -check-prefix DEVICE-NOSAVE \
anatofuz
parents:
diff changeset
28 // RUN: -check-prefix NOHOST -check-prefix NOLINK %s
anatofuz
parents:
diff changeset
29
anatofuz
parents:
diff changeset
30 // Check that the last of --cuda-compile-host-device, --cuda-host-only, and
anatofuz
parents:
diff changeset
31 // --cuda-device-only wins.
anatofuz
parents:
diff changeset
32
anatofuz
parents:
diff changeset
33 // RUN: %clang -### -target x86_64-linux-gnu --cuda-device-only \
anatofuz
parents:
diff changeset
34 // RUN: --cuda-host-only %s 2>&1 \
anatofuz
parents:
diff changeset
35 // RUN: | FileCheck -check-prefix NODEVICE -check-prefix HOST \
anatofuz
parents:
diff changeset
36 // RUN: -check-prefix NOINCLUDES-DEVICE -check-prefix LINK %s
anatofuz
parents:
diff changeset
37
anatofuz
parents:
diff changeset
38 // RUN: %clang -### -target x86_64-linux-gnu --cuda-compile-host-device \
anatofuz
parents:
diff changeset
39 // RUN: --cuda-host-only %s 2>&1 \
anatofuz
parents:
diff changeset
40 // RUN: | FileCheck -check-prefix NODEVICE -check-prefix HOST \
anatofuz
parents:
diff changeset
41 // RUN: -check-prefix NOINCLUDES-DEVICE -check-prefix LINK %s
anatofuz
parents:
diff changeset
42
anatofuz
parents:
diff changeset
43 // RUN: %clang -### -target x86_64-linux-gnu --cuda-host-only \
anatofuz
parents:
diff changeset
44 // RUN: --cuda-device-only %s 2>&1 \
anatofuz
parents:
diff changeset
45 // RUN: | FileCheck -check-prefix DEVICE -check-prefix DEVICE-NOSAVE \
anatofuz
parents:
diff changeset
46 // RUN: -check-prefix NOHOST -check-prefix NOLINK %s
anatofuz
parents:
diff changeset
47
anatofuz
parents:
diff changeset
48 // RUN: %clang -### -target x86_64-linux-gnu --cuda-compile-host-device \
anatofuz
parents:
diff changeset
49 // RUN: --cuda-device-only %s 2>&1 \
anatofuz
parents:
diff changeset
50 // RUN: | FileCheck -check-prefix DEVICE -check-prefix DEVICE-NOSAVE \
anatofuz
parents:
diff changeset
51 // RUN: -check-prefix NOHOST -check-prefix NOLINK %s
anatofuz
parents:
diff changeset
52
anatofuz
parents:
diff changeset
53 // RUN: %clang -### -target x86_64-linux-gnu --cuda-host-only \
anatofuz
parents:
diff changeset
54 // RUN: --cuda-compile-host-device %s 2>&1 \
anatofuz
parents:
diff changeset
55 // RUN: | FileCheck -check-prefix DEVICE -check-prefix DEVICE-NOSAVE \
anatofuz
parents:
diff changeset
56 // RUN: -check-prefix HOST -check-prefix INCLUDES-DEVICE \
anatofuz
parents:
diff changeset
57 // RUN: -check-prefix LINK %s
anatofuz
parents:
diff changeset
58
anatofuz
parents:
diff changeset
59 // RUN: %clang -### -target x86_64-linux-gnu --cuda-device-only \
anatofuz
parents:
diff changeset
60 // RUN: --cuda-compile-host-device %s 2>&1 \
anatofuz
parents:
diff changeset
61 // RUN: | FileCheck -check-prefix DEVICE -check-prefix DEVICE-NOSAVE \
anatofuz
parents:
diff changeset
62 // RUN: -check-prefix HOST -check-prefix INCLUDES-DEVICE \
anatofuz
parents:
diff changeset
63 // RUN: -check-prefix LINK %s
anatofuz
parents:
diff changeset
64
anatofuz
parents:
diff changeset
65 // Verify that --cuda-gpu-arch option passes the correct GPU architecture to
anatofuz
parents:
diff changeset
66 // device compilation.
anatofuz
parents:
diff changeset
67 // RUN: %clang -### -target x86_64-linux-gnu --cuda-gpu-arch=sm_30 -c %s 2>&1 \
anatofuz
parents:
diff changeset
68 // RUN: | FileCheck -check-prefix DEVICE -check-prefix DEVICE-NOSAVE \
anatofuz
parents:
diff changeset
69 // RUN: -check-prefix DEVICE-SM30 -check-prefix HOST \
anatofuz
parents:
diff changeset
70 // RUN: -check-prefix INCLUDES-DEVICE -check-prefix NOLINK %s
anatofuz
parents:
diff changeset
71
anatofuz
parents:
diff changeset
72 // Verify that there is one device-side compilation per --cuda-gpu-arch args
anatofuz
parents:
diff changeset
73 // and that all results are included on the host side.
anatofuz
parents:
diff changeset
74 // RUN: %clang -### -target x86_64-linux-gnu \
anatofuz
parents:
diff changeset
75 // RUN: --cuda-gpu-arch=sm_35 --cuda-gpu-arch=sm_30 -c %s 2>&1 \
anatofuz
parents:
diff changeset
76 // RUN: | FileCheck -check-prefixes DEVICE,DEVICE-NOSAVE,DEVICE2 \
anatofuz
parents:
diff changeset
77 // RUN: -check-prefixes DEVICE-SM30,DEVICE2-SM35 \
anatofuz
parents:
diff changeset
78 // RUN: -check-prefixes INCLUDES-DEVICE,INCLUDES-DEVICE2 \
anatofuz
parents:
diff changeset
79 // RUN: -check-prefixes HOST,HOST-NOSAVE,NOLINK %s
anatofuz
parents:
diff changeset
80
anatofuz
parents:
diff changeset
81 // Verify that device-side results are passed to the correct tool when
anatofuz
parents:
diff changeset
82 // -save-temps is used.
anatofuz
parents:
diff changeset
83 // RUN: %clang -### -target x86_64-linux-gnu -save-temps -c %s 2>&1 \
anatofuz
parents:
diff changeset
84 // RUN: | FileCheck -check-prefix DEVICE -check-prefix DEVICE-SAVE \
anatofuz
parents:
diff changeset
85 // RUN: -check-prefix HOST -check-prefix HOST-SAVE -check-prefix NOLINK %s
anatofuz
parents:
diff changeset
86
anatofuz
parents:
diff changeset
87 // Verify that device-side results are passed to the correct tool when
anatofuz
parents:
diff changeset
88 // -fno-integrated-as is used.
anatofuz
parents:
diff changeset
89 // RUN: %clang -### -target x86_64-linux-gnu -fno-integrated-as -c %s 2>&1 \
anatofuz
parents:
diff changeset
90 // RUN: | FileCheck -check-prefix DEVICE -check-prefix DEVICE-NOSAVE \
anatofuz
parents:
diff changeset
91 // RUN: -check-prefix HOST -check-prefix HOST-NOSAVE \
anatofuz
parents:
diff changeset
92 // RUN: -check-prefix HOST-AS -check-prefix NOLINK %s
anatofuz
parents:
diff changeset
93
anatofuz
parents:
diff changeset
94 // Verify that --[no-]cuda-gpu-arch arguments are handled correctly.
anatofuz
parents:
diff changeset
95 // a) --no-cuda-gpu-arch=X negates preceding --cuda-gpu-arch=X
anatofuz
parents:
diff changeset
96 // RUN: %clang -### -target x86_64-linux-gnu --cuda-device-only \
anatofuz
parents:
diff changeset
97 // RUN: --cuda-gpu-arch=sm_35 --cuda-gpu-arch=sm_30 \
anatofuz
parents:
diff changeset
98 // RUN: --no-cuda-gpu-arch=sm_35 \
anatofuz
parents:
diff changeset
99 // RUN: -c %s 2>&1 \
anatofuz
parents:
diff changeset
100 // RUN: | FileCheck -check-prefixes NOARCH-SM20,ARCH-SM30,NOARCH-SM35 %s
anatofuz
parents:
diff changeset
101
anatofuz
parents:
diff changeset
102 // b) --no-cuda-gpu-arch=X negates more than one preceding --cuda-gpu-arch=X
anatofuz
parents:
diff changeset
103 // RUN: %clang -### -target x86_64-linux-gnu --cuda-device-only \
anatofuz
parents:
diff changeset
104 // RUN: --cuda-gpu-arch=sm_35 --cuda-gpu-arch=sm_35 --cuda-gpu-arch=sm_30 \
anatofuz
parents:
diff changeset
105 // RUN: --no-cuda-gpu-arch=sm_35 \
anatofuz
parents:
diff changeset
106 // RUN: -c %s 2>&1 \
anatofuz
parents:
diff changeset
107 // RUN: | FileCheck -check-prefixes NOARCH-SM20,ARCH-SM30,NOARCH-SM35 %s
anatofuz
parents:
diff changeset
108
anatofuz
parents:
diff changeset
109 // c) if --no-cuda-gpu-arch=X negates all preceding --cuda-gpu-arch=X
anatofuz
parents:
diff changeset
110 // we default to sm_20 -- same as if no --cuda-gpu-arch were passed.
anatofuz
parents:
diff changeset
111 // RUN: %clang -### -target x86_64-linux-gnu --cuda-device-only \
anatofuz
parents:
diff changeset
112 // RUN: --cuda-gpu-arch=sm_35 --cuda-gpu-arch=sm_30 \
anatofuz
parents:
diff changeset
113 // RUN: --no-cuda-gpu-arch=sm_35 --no-cuda-gpu-arch=sm_30 \
anatofuz
parents:
diff changeset
114 // RUN: -c %s 2>&1 \
anatofuz
parents:
diff changeset
115 // RUN: | FileCheck -check-prefixes ARCH-SM20,NOARCH-SM30,NOARCH-SM35 %s
anatofuz
parents:
diff changeset
116
anatofuz
parents:
diff changeset
117 // d) --no-cuda-gpu-arch=X is a no-op if there's no preceding --cuda-gpu-arch=X
anatofuz
parents:
diff changeset
118 // RUN: %clang -### -target x86_64-linux-gnu --cuda-device-only \
anatofuz
parents:
diff changeset
119 // RUN: --cuda-gpu-arch=sm_35 --cuda-gpu-arch=sm_30\
anatofuz
parents:
diff changeset
120 // RUN: --no-cuda-gpu-arch=sm_50 \
anatofuz
parents:
diff changeset
121 // RUN: -c %s 2>&1 \
anatofuz
parents:
diff changeset
122 // RUN: | FileCheck -check-prefixes NOARCH-SM20,ARCH-SM30,ARCH-SM35 %s
anatofuz
parents:
diff changeset
123
anatofuz
parents:
diff changeset
124 // e) --no-cuda-gpu-arch=X does not affect following --cuda-gpu-arch=X
anatofuz
parents:
diff changeset
125 // RUN: %clang -### -target x86_64-linux-gnu --cuda-device-only \
anatofuz
parents:
diff changeset
126 // RUN: --no-cuda-gpu-arch=sm_35 --no-cuda-gpu-arch=sm_30 \
anatofuz
parents:
diff changeset
127 // RUN: --cuda-gpu-arch=sm_35 --cuda-gpu-arch=sm_30 \
anatofuz
parents:
diff changeset
128 // RUN: -c %s 2>&1 \
anatofuz
parents:
diff changeset
129 // RUN: | FileCheck -check-prefixes NOARCH-SM20,ARCH-SM30,ARCH-SM35 %s
anatofuz
parents:
diff changeset
130
anatofuz
parents:
diff changeset
131 // f) --no-cuda-gpu-arch=all negates all preceding --cuda-gpu-arch=X
anatofuz
parents:
diff changeset
132 // RUN: %clang -### -target x86_64-linux-gnu --cuda-device-only \
anatofuz
parents:
diff changeset
133 // RUN: --cuda-gpu-arch=sm_20 --cuda-gpu-arch=sm_30 \
anatofuz
parents:
diff changeset
134 // RUN: --no-cuda-gpu-arch=all \
anatofuz
parents:
diff changeset
135 // RUN: --cuda-gpu-arch=sm_35 \
anatofuz
parents:
diff changeset
136 // RUN: -c %s 2>&1 \
anatofuz
parents:
diff changeset
137 // RUN: | FileCheck -check-prefixes NOARCH-SM20,NOARCH-SM30,ARCH-SM35 %s
anatofuz
parents:
diff changeset
138
anatofuz
parents:
diff changeset
139 // g) There's no --cuda-gpu-arch=all
anatofuz
parents:
diff changeset
140 // RUN: %clang -### -target x86_64-linux-gnu --cuda-device-only \
anatofuz
parents:
diff changeset
141 // RUN: --cuda-gpu-arch=all \
anatofuz
parents:
diff changeset
142 // RUN: -c %s 2>&1 \
anatofuz
parents:
diff changeset
143 // RUN: | FileCheck -check-prefix ARCHALLERROR %s
anatofuz
parents:
diff changeset
144
anatofuz
parents:
diff changeset
145
anatofuz
parents:
diff changeset
146 // Verify that --[no-]cuda-include-ptx arguments are handled correctly.
anatofuz
parents:
diff changeset
147 // a) by default we're including PTX for all GPUs.
anatofuz
parents:
diff changeset
148 // RUN: %clang -### -target x86_64-linux-gnu \
anatofuz
parents:
diff changeset
149 // RUN: --cuda-gpu-arch=sm_35 --cuda-gpu-arch=sm_30 \
anatofuz
parents:
diff changeset
150 // RUN: -c %s 2>&1 \
anatofuz
parents:
diff changeset
151 // RUN: | FileCheck -check-prefixes FATBIN-COMMON,PTX-SM35,PTX-SM30 %s
anatofuz
parents:
diff changeset
152
anatofuz
parents:
diff changeset
153 // b) --no-cuda-include-ptx=all disables PTX inclusion for all GPUs
anatofuz
parents:
diff changeset
154 // RUN: %clang -### -target x86_64-linux-gnu \
anatofuz
parents:
diff changeset
155 // RUN: --cuda-gpu-arch=sm_35 --cuda-gpu-arch=sm_30 \
anatofuz
parents:
diff changeset
156 // RUN: --no-cuda-include-ptx=all \
anatofuz
parents:
diff changeset
157 // RUN: -c %s 2>&1 \
anatofuz
parents:
diff changeset
158 // RUN: | FileCheck -check-prefixes FATBIN-COMMON,NOPTX-SM35,NOPTX-SM30 %s
anatofuz
parents:
diff changeset
159
anatofuz
parents:
diff changeset
160 // c) --no-cuda-include-ptx=sm_XX disables PTX inclusion for that GPU only.
anatofuz
parents:
diff changeset
161 // RUN: %clang -### -target x86_64-linux-gnu \
anatofuz
parents:
diff changeset
162 // RUN: --cuda-gpu-arch=sm_35 --cuda-gpu-arch=sm_30 \
anatofuz
parents:
diff changeset
163 // RUN: --no-cuda-include-ptx=sm_35 \
anatofuz
parents:
diff changeset
164 // RUN: -c %s 2>&1 \
anatofuz
parents:
diff changeset
165 // RUN: | FileCheck -check-prefixes FATBIN-COMMON,NOPTX-SM35,PTX-SM30 %s
anatofuz
parents:
diff changeset
166 // RUN: %clang -### -target x86_64-linux-gnu \
anatofuz
parents:
diff changeset
167 // RUN: --cuda-gpu-arch=sm_35 --cuda-gpu-arch=sm_30 \
anatofuz
parents:
diff changeset
168 // RUN: --no-cuda-include-ptx=sm_30 \
anatofuz
parents:
diff changeset
169 // RUN: -c %s 2>&1 \
anatofuz
parents:
diff changeset
170 // RUN: | FileCheck -check-prefixes FATBIN-COMMON,PTX-SM35,NOPTX-SM30 %s
anatofuz
parents:
diff changeset
171
anatofuz
parents:
diff changeset
172 // d) --cuda-include-ptx=all overrides preceding --no-cuda-include-ptx=all
anatofuz
parents:
diff changeset
173 // RUN: %clang -### -target x86_64-linux-gnu \
anatofuz
parents:
diff changeset
174 // RUN: --cuda-gpu-arch=sm_35 --cuda-gpu-arch=sm_30 \
anatofuz
parents:
diff changeset
175 // RUN: --no-cuda-include-ptx=all --cuda-include-ptx=all \
anatofuz
parents:
diff changeset
176 // RUN: -c %s 2>&1 \
anatofuz
parents:
diff changeset
177 // RUN: | FileCheck -check-prefixes FATBIN-COMMON,PTX-SM35,PTX-SM30 %s
anatofuz
parents:
diff changeset
178
anatofuz
parents:
diff changeset
179 // e) --cuda-include-ptx=all overrides preceding --no-cuda-include-ptx=sm_XX
anatofuz
parents:
diff changeset
180 // RUN: %clang -### -target x86_64-linux-gnu \
anatofuz
parents:
diff changeset
181 // RUN: --cuda-gpu-arch=sm_35 --cuda-gpu-arch=sm_30 \
anatofuz
parents:
diff changeset
182 // RUN: --no-cuda-include-ptx=sm_30 --cuda-include-ptx=all \
anatofuz
parents:
diff changeset
183 // RUN: -c %s 2>&1 \
anatofuz
parents:
diff changeset
184 // RUN: | FileCheck -check-prefixes FATBIN-COMMON,PTX-SM35,PTX-SM30 %s
anatofuz
parents:
diff changeset
185
221
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
186 // Verify -flto=thin -fwhole-program-vtables handling. This should result in
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
187 // both options being passed to the host compilation, with neither passed to
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
188 // the device compilation.
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
189 // RUN: %clang -### -target x86_64-linux-gnu -c -flto=thin -fwhole-program-vtables %s 2>&1 \
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
190 // RUN: | FileCheck -check-prefixes DEVICE,DEVICE-NOSAVE,HOST,INCLUDES-DEVICE,NOLINK,THINLTOWPD %s
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
191 // THINLTOWPD-NOT: error: invalid argument '-fwhole-program-vtables' only allowed with '-flto'
150
anatofuz
parents:
diff changeset
192
anatofuz
parents:
diff changeset
193 // ARCH-SM20: "-cc1"{{.*}}"-target-cpu" "sm_20"
anatofuz
parents:
diff changeset
194 // NOARCH-SM20-NOT: "-cc1"{{.*}}"-target-cpu" "sm_20"
anatofuz
parents:
diff changeset
195 // ARCH-SM30: "-cc1"{{.*}}"-target-cpu" "sm_30"
anatofuz
parents:
diff changeset
196 // NOARCH-SM30-NOT: "-cc1"{{.*}}"-target-cpu" "sm_30"
anatofuz
parents:
diff changeset
197 // ARCH-SM35: "-cc1"{{.*}}"-target-cpu" "sm_35"
anatofuz
parents:
diff changeset
198 // NOARCH-SM35-NOT: "-cc1"{{.*}}"-target-cpu" "sm_35"
anatofuz
parents:
diff changeset
199 // ARCHALLERROR: error: Unsupported CUDA gpu architecture: all
anatofuz
parents:
diff changeset
200
anatofuz
parents:
diff changeset
201 // Match device-side preprocessor and compiler phases with -save-temps.
anatofuz
parents:
diff changeset
202 // DEVICE-SAVE: "-cc1" "-triple" "nvptx64-nvidia-cuda"
anatofuz
parents:
diff changeset
203 // DEVICE-SAVE-SAME: "-aux-triple" "x86_64-unknown-linux-gnu"
anatofuz
parents:
diff changeset
204 // DEVICE-SAVE-SAME: "-fcuda-is-device"
anatofuz
parents:
diff changeset
205 // DEVICE-SAVE-SAME: "-x" "cuda"
anatofuz
parents:
diff changeset
206
anatofuz
parents:
diff changeset
207 // DEVICE-SAVE: "-cc1" "-triple" "nvptx64-nvidia-cuda"
anatofuz
parents:
diff changeset
208 // DEVICE-SAVE-SAME: "-aux-triple" "x86_64-unknown-linux-gnu"
anatofuz
parents:
diff changeset
209 // DEVICE-SAVE-SAME: "-fcuda-is-device"
anatofuz
parents:
diff changeset
210 // DEVICE-SAVE-SAME: "-x" "cuda-cpp-output"
anatofuz
parents:
diff changeset
211
anatofuz
parents:
diff changeset
212 // Match the job that produces PTX assembly.
anatofuz
parents:
diff changeset
213 // DEVICE: "-cc1" "-triple" "nvptx64-nvidia-cuda"
anatofuz
parents:
diff changeset
214 // DEVICE-NOSAVE-SAME: "-aux-triple" "x86_64-unknown-linux-gnu"
221
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
215 // THINLTOWPD-NOT: "-flto=thin"
150
anatofuz
parents:
diff changeset
216 // DEVICE-SAME: "-fcuda-is-device"
anatofuz
parents:
diff changeset
217 // DEVICE-SM30-SAME: "-target-cpu" "sm_30"
221
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
218 // THINLTOWPD-NOT: "-fwhole-program-vtables"
150
anatofuz
parents:
diff changeset
219 // DEVICE-SAME: "-o" "[[PTXFILE:[^"]*]]"
anatofuz
parents:
diff changeset
220 // DEVICE-NOSAVE-SAME: "-x" "cuda"
anatofuz
parents:
diff changeset
221 // DEVICE-SAVE-SAME: "-x" "ir"
anatofuz
parents:
diff changeset
222
anatofuz
parents:
diff changeset
223 // Match the call to ptxas (which assembles PTX to SASS).
anatofuz
parents:
diff changeset
224 // DEVICE:ptxas
anatofuz
parents:
diff changeset
225 // DEVICE-SM30-DAG: "--gpu-name" "sm_30"
anatofuz
parents:
diff changeset
226 // DEVICE-DAG: "--output-file" "[[CUBINFILE:[^"]*]]"
anatofuz
parents:
diff changeset
227 // DEVICE-DAG: "[[PTXFILE]]"
anatofuz
parents:
diff changeset
228
anatofuz
parents:
diff changeset
229 // Match another device-side compilation.
anatofuz
parents:
diff changeset
230 // DEVICE2: "-cc1" "-triple" "nvptx64-nvidia-cuda"
anatofuz
parents:
diff changeset
231 // DEVICE2-SAME: "-aux-triple" "x86_64-unknown-linux-gnu"
anatofuz
parents:
diff changeset
232 // DEVICE2-SAME: "-fcuda-is-device"
anatofuz
parents:
diff changeset
233 // DEVICE2-SM35-SAME: "-target-cpu" "sm_35"
anatofuz
parents:
diff changeset
234 // DEVICE2-SAME: "-o" "[[PTXFILE2:[^"]*]]"
anatofuz
parents:
diff changeset
235 // DEVICE2-SAME: "-x" "cuda"
anatofuz
parents:
diff changeset
236
anatofuz
parents:
diff changeset
237 // Match another call to ptxas.
anatofuz
parents:
diff changeset
238 // DEVICE2: ptxas
anatofuz
parents:
diff changeset
239 // DEVICE2-SM35-DAG: "--gpu-name" "sm_35"
anatofuz
parents:
diff changeset
240 // DEVICE2-DAG: "--output-file" "[[CUBINFILE2:[^"]*]]"
anatofuz
parents:
diff changeset
241 // DEVICE2-DAG: "[[PTXFILE2]]"
anatofuz
parents:
diff changeset
242
anatofuz
parents:
diff changeset
243 // Match no device-side compilation.
anatofuz
parents:
diff changeset
244 // NODEVICE-NOT: "-cc1" "-triple" "nvptx64-nvidia-cuda"
anatofuz
parents:
diff changeset
245 // NODEVICE-NOT: "-fcuda-is-device"
anatofuz
parents:
diff changeset
246
anatofuz
parents:
diff changeset
247 // INCLUDES-DEVICE:fatbinary
anatofuz
parents:
diff changeset
248 // INCLUDES-DEVICE-DAG: "--create" "[[FATBINARY:[^"]*]]"
anatofuz
parents:
diff changeset
249 // INCLUDES-DEVICE-DAG: "--image=profile=sm_{{[0-9]+}},file=[[CUBINFILE]]"
anatofuz
parents:
diff changeset
250 // INCLUDES-DEVICE-DAG: "--image=profile=compute_{{[0-9]+}},file=[[PTXFILE]]"
anatofuz
parents:
diff changeset
251 // INCLUDES-DEVICE2-DAG: "--image=profile=sm_{{[0-9]+}},file=[[CUBINFILE2]]"
anatofuz
parents:
diff changeset
252 // INCLUDES-DEVICE2-DAG: "--image=profile=compute_{{[0-9]+}},file=[[PTXFILE2]]"
anatofuz
parents:
diff changeset
253
anatofuz
parents:
diff changeset
254 // Match host-side preprocessor job with -save-temps.
anatofuz
parents:
diff changeset
255 // HOST-SAVE: "-cc1" "-triple" "x86_64-unknown-linux-gnu"
anatofuz
parents:
diff changeset
256 // HOST-SAVE-SAME: "-aux-triple" "nvptx64-nvidia-cuda"
anatofuz
parents:
diff changeset
257 // HOST-SAVE-NOT: "-fcuda-is-device"
anatofuz
parents:
diff changeset
258 // HOST-SAVE-SAME: "-x" "cuda"
anatofuz
parents:
diff changeset
259
anatofuz
parents:
diff changeset
260 // Match host-side compilation.
anatofuz
parents:
diff changeset
261 // HOST: "-cc1" "-triple" "x86_64-unknown-linux-gnu"
anatofuz
parents:
diff changeset
262 // HOST-SAME: "-aux-triple" "nvptx64-nvidia-cuda"
221
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
263 // THINLTOWPD-SAME: "-flto=thin"
150
anatofuz
parents:
diff changeset
264 // HOST-NOT: "-fcuda-is-device"
anatofuz
parents:
diff changeset
265 // There is only one GPU binary after combining it with fatbinary!
anatofuz
parents:
diff changeset
266 // INCLUDES-DEVICE2-NOT: "-fcuda-include-gpubinary"
anatofuz
parents:
diff changeset
267 // INCLUDES-DEVICE-SAME: "-fcuda-include-gpubinary" "[[FATBINARY]]"
anatofuz
parents:
diff changeset
268 // There is only one GPU binary after combining it with fatbinary.
anatofuz
parents:
diff changeset
269 // INCLUDES-DEVICE2-NOT: "-fcuda-include-gpubinary"
221
79ff65ed7e25 LLVM12 Original
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents: 150
diff changeset
270 // THINLTOWPD-SAME: "-fwhole-program-vtables"
150
anatofuz
parents:
diff changeset
271 // HOST-SAME: "-o" "[[HOSTOUTPUT:[^"]*]]"
anatofuz
parents:
diff changeset
272 // HOST-NOSAVE-SAME: "-x" "cuda"
anatofuz
parents:
diff changeset
273 // HOST-SAVE-SAME: "-x" "cuda-cpp-output"
anatofuz
parents:
diff changeset
274
anatofuz
parents:
diff changeset
275 // Match external assembler that uses compilation output.
anatofuz
parents:
diff changeset
276 // HOST-AS: "-o" "{{.*}}.o" "[[HOSTOUTPUT]]"
anatofuz
parents:
diff changeset
277
anatofuz
parents:
diff changeset
278 // Match no GPU code inclusion.
anatofuz
parents:
diff changeset
279 // NOINCLUDES-DEVICE-NOT: "-fcuda-include-gpubinary"
anatofuz
parents:
diff changeset
280
anatofuz
parents:
diff changeset
281 // Match no host compilation.
anatofuz
parents:
diff changeset
282 // NOHOST-NOT: "-cc1" "-triple"
anatofuz
parents:
diff changeset
283 // NOHOST-NOT: "-x" "cuda"
anatofuz
parents:
diff changeset
284
anatofuz
parents:
diff changeset
285 // Match linker.
anatofuz
parents:
diff changeset
286 // LINK: "{{.*}}{{ld|link}}{{(.exe)?}}"
anatofuz
parents:
diff changeset
287 // LINK-SAME: "[[HOSTOUTPUT]]"
anatofuz
parents:
diff changeset
288
anatofuz
parents:
diff changeset
289 // Match no linker.
anatofuz
parents:
diff changeset
290 // NOLINK-NOT: "{{.*}}{{ld|link}}{{(.exe)?}}"
anatofuz
parents:
diff changeset
291
anatofuz
parents:
diff changeset
292 // FATBIN-COMMON:fatbinary
anatofuz
parents:
diff changeset
293 // FATBIN-COMMON: "--create" "[[FATBINARY:[^"]*]]"
anatofuz
parents:
diff changeset
294 // FATBIN-COMMON: "--image=profile=sm_30,file=
anatofuz
parents:
diff changeset
295 // PTX-SM30: "--image=profile=compute_30,file=
anatofuz
parents:
diff changeset
296 // NOPTX-SM30-NOT: "--image=profile=compute_30,file=
anatofuz
parents:
diff changeset
297 // FATBIN-COMMON: "--image=profile=sm_35,file=
anatofuz
parents:
diff changeset
298 // PTX-SM35: "--image=profile=compute_35,file=
anatofuz
parents:
diff changeset
299 // NOPTX-SM35-NOT: "--image=profile=compute_35,file=