Lines Matching full:cuda
1 // Tests CUDA compilation pipeline construction in Driver.
19 // Verify that --cuda-host-only disables device-side compilation, but doesn't
21 // RUN: %clang -### -target x86_64-linux-gnu --cuda-host-only %s 2>&1 \
25 // Verify that --cuda-device-only disables host-side compilation and linking.
26 // RUN: %clang -### -target x86_64-linux-gnu --cuda-device-only %s 2>&1 \
30 // Check that the last of --cuda-compile-host-device, --cuda-host-only, and
31 // --cuda-device-only wins.
33 // RUN: %clang -### -target x86_64-linux-gnu --cuda-device-only \
34 // RUN: --cuda-host-only %s 2>&1 \
38 // RUN: %clang -### -target x86_64-linux-gnu --cuda-compile-host-device \
39 // RUN: --cuda-host-only %s 2>&1 \
43 // RUN: %clang -### -target x86_64-linux-gnu --cuda-host-only \
44 // RUN: --cuda-device-only %s 2>&1 \
48 // RUN: %clang -### -target x86_64-linux-gnu --cuda-compile-host-device \
49 // RUN: --cuda-device-only %s 2>&1 \
53 // RUN: %clang -### -target x86_64-linux-gnu --cuda-host-only \
54 // RUN: --cuda-compile-host-device %s 2>&1 \
59 // RUN: %clang -### -target x86_64-linux-gnu --cuda-device-only \
60 // RUN: --cuda-compile-host-device %s 2>&1 \
65 // Verify that --cuda-gpu-arch option passes the correct GPU architecture to
67 // RUN: %clang -### -target x86_64-linux-gnu --cuda-gpu-arch=sm_30 -c %s 2>&1 \
72 // Verify that there is one device-side compilation per --cuda-gpu-arch args
75 // RUN: --cuda-gpu-arch=sm_35 --cuda-gpu-arch=sm_30 -c %s 2>&1 \
94 // Verify that --[no-]cuda-gpu-arch arguments are handled correctly.
95 // a) --no-cuda-gpu-arch=X negates preceding --cuda-gpu-arch=X
96 // RUN: %clang -### -target x86_64-linux-gnu --cuda-device-only \
97 // RUN: --cuda-gpu-arch=sm_35 --cuda-gpu-arch=sm_30 \
98 // RUN: --no-cuda-gpu-arch=sm_35 \
102 // b) --no-cuda-gpu-arch=X negates more than one preceding --cuda-gpu-arch=X
103 // RUN: %clang -### -target x86_64-linux-gnu --cuda-device-only \
104 // RUN: --cuda-gpu-arch=sm_35 --cuda-gpu-arch=sm_35 --cuda-gpu-arch=sm_30 \
105 // RUN: --no-cuda-gpu-arch=sm_35 \
109 // c) if --no-cuda-gpu-arch=X negates all preceding --cuda-gpu-arch=X
110 // we default to sm_20 -- same as if no --cuda-gpu-arch were passed.
111 // RUN: %clang -### -target x86_64-linux-gnu --cuda-device-only \
112 // RUN: --cuda-gpu-arch=sm_35 --cuda-gpu-arch=sm_30 \
113 // RUN: --no-cuda-gpu-arch=sm_35 --no-cuda-gpu-arch=sm_30 \
117 // d) --no-cuda-gpu-arch=X is a no-op if there's no preceding --cuda-gpu-arch=X
118 // RUN: %clang -### -target x86_64-linux-gnu --cuda-device-only \
119 // RUN: --cuda-gpu-arch=sm_35 --cuda-gpu-arch=sm_30\
120 // RUN: --no-cuda-gpu-arch=sm_50 \
124 // e) --no-cuda-gpu-arch=X does not affect following --cuda-gpu-arch=X
125 // RUN: %clang -### -target x86_64-linux-gnu --cuda-device-only \
126 // RUN: --no-cuda-gpu-arch=sm_35 --no-cuda-gpu-arch=sm_30 \
127 // RUN: --cuda-gpu-arch=sm_35 --cuda-gpu-arch=sm_30 \
131 // f) --no-cuda-gpu-arch=all negates all preceding --cuda-gpu-arch=X
132 // RUN: %clang -### -target x86_64-linux-gnu --cuda-device-only \
133 // RUN: --cuda-gpu-arch=sm_20 --cuda-gpu-arch=sm_30 \
134 // RUN: --no-cuda-gpu-arch=all \
135 // RUN: --cuda-gpu-arch=sm_35 \
139 // g) There's no --cuda-gpu-arch=all
140 // RUN: %clang -### -target x86_64-linux-gnu --cuda-device-only \
141 // RUN: --cuda-gpu-arch=all \
146 // Verify that --[no-]cuda-include-ptx arguments are handled correctly.
149 // RUN: --cuda-gpu-arch=sm_35 --cuda-gpu-arch=sm_30 \
153 // b) --no-cuda-include-ptx=all disables PTX inclusion for all GPUs
155 // RUN: --cuda-gpu-arch=sm_35 --cuda-gpu-arch=sm_30 \
156 // RUN: --no-cuda-include-ptx=all \
160 // c) --no-cuda-include-ptx=sm_XX disables PTX inclusion for that GPU only.
162 // RUN: --cuda-gpu-arch=sm_35 --cuda-gpu-arch=sm_30 \
163 // RUN: --no-cuda-include-ptx=sm_35 \
167 // RUN: --cuda-gpu-arch=sm_35 --cuda-gpu-arch=sm_30 \
168 // RUN: --no-cuda-include-ptx=sm_30 \
172 // d) --cuda-include-ptx=all overrides preceding --no-cuda-include-ptx=all
174 // RUN: --cuda-gpu-arch=sm_35 --cuda-gpu-arch=sm_30 \
175 // RUN: --no-cuda-include-ptx=all --cuda-include-ptx=all \
179 // e) --cuda-include-ptx=all overrides preceding --no-cuda-include-ptx=sm_XX
181 // RUN: --cuda-gpu-arch=sm_35 --cuda-gpu-arch=sm_30 \
182 // RUN: --no-cuda-include-ptx=sm_30 --cuda-include-ptx=all \
193 // ARCHALLERROR: error: Unsupported CUDA gpu architecture: all
196 // DEVICE-SAVE: "-cc1" "-triple" "nvptx64-nvidia-cuda"
199 // DEVICE-SAVE-SAME: "-x" "cuda"
201 // DEVICE-SAVE: "-cc1" "-triple" "nvptx64-nvidia-cuda"
204 // DEVICE-SAVE-SAME: "-x" "cuda-cpp-output"
207 // DEVICE: "-cc1" "-triple" "nvptx64-nvidia-cuda"
212 // DEVICE-NOSAVE-SAME: "-x" "cuda"
222 // DEVICE2: "-cc1" "-triple" "nvptx64-nvidia-cuda"
227 // DEVICE2-SAME: "-x" "cuda"
236 // NODEVICE-NOT: "-cc1" "-triple" "nvptx64-nvidia-cuda"
248 // HOST-SAVE-SAME: "-aux-triple" "nvptx64-nvidia-cuda"
250 // HOST-SAVE-SAME: "-x" "cuda"
254 // HOST-SAME: "-aux-triple" "nvptx64-nvidia-cuda"
262 // HOST-NOSAVE-SAME: "-x" "cuda"
263 // HOST-SAVE-SAME: "-x" "cuda-cpp-output"
273 // NOHOST-NOT: "-x" "cuda"