|
188 | 188 | // RUN: %clangxx -fsycl -### -fsycl-targets=spir64_gen --offload-new-driver \ |
189 | 189 | // RUN: -Xsycl-target-backend=spir64_gen "-device pvc,bdw" %s 2>&1 \ |
190 | 190 | // RUN: | FileCheck -check-prefix COMMA_FILE %s |
191 | | -// COMMA_FILE: llvm-offload-binary{{.*}} "--image=file={{.*}}pvc@bdw{{.*}},triple=spir64_gen-unknown-unknown,arch=pvc,bdw,kind=sycl,compile-opts=-device_options pvc -ze-intel-enable-auto-large-GRF-mode" |
| 191 | +// COMMA_FILE: llvm-offload-binary{{.*}} "--image=file={{.*}}pvc@bdw{{.*}},triple=spir64_gen-unknown-unknown,arch=pvc,arch=bdw,kind=sycl,compile-opts=-device_options pvc -ze-intel-enable-auto-large-GRF-mode -device pvc,compile-opts=bdw" |
192 | 192 |
|
193 | 193 | /// Verify the arch value for the packager is populated with different |
194 | 194 | /// scenarios for spir64_gen |
|
212 | 212 | // RUN: | FileCheck -check-prefix ARCH_CHECK %s |
213 | 213 | // ARCH_CHECK: llvm-offload-binary{{.*}} "--image=file={{.*}}triple=spir64_gen-unknown-unknown,arch=bdw,kind=sycl{{.*}}" |
214 | 214 |
|
| 215 | +// Verify when a comma-separated list of architectures is provided in -device, they are |
| 216 | +// passed to llvm-offload-binary correctly. |
| 217 | +// RUN: %clangxx -fsycl -### -fsycl-targets=spir64_gen --offload-new-driver \ |
| 218 | +// RUN: -Xsycl-target-backend "-device pvc,bdw" %s 2>&1 \ |
| 219 | +// RUN: | FileCheck -check-prefix MULTI_ARCH %s |
| 220 | +// RUN: %clangxx -fsycl -### -fsycl-targets=spir64_gen --offload-new-driver \ |
| 221 | +// RUN: -Xsycl-target-backend=spir64_gen "-device pvc,bdw" %s 2>&1 \ |
| 222 | +// RUN: | FileCheck -check-prefix MULTI_ARCH %s |
| 223 | +// RUN: %clangxx -fsycl -### -fsycl-targets=spir64_gen --offload-new-driver \ |
| 224 | +// RUN: -Xs "-device pvc,bdw" %s 2>&1 \ |
| 225 | +// RUN: | FileCheck -check-prefix MULTI_ARCH %s |
| 226 | +// MULTI_ARCH: llvm-offload-binary{{.*}} "--image=file={{.*}}triple=spir64_gen-unknown-unknown,arch=pvc,arch=bdw,kind=sycl |
| 227 | +// MULTI_ARCH-SAME: compile-opts=-device_options pvc -ze-intel-enable-auto-large-GRF-mode -device pvc,compile-opts=bdw" |
| 228 | + |
| 229 | +// Verify that when an object produced by llvm-offload-binary with multiple Intel GPU architectures |
| 230 | +// clang-linker-wrapper will call ocloc with -device listing all architectures. |
| 231 | +// RUN: %clangxx -fsycl -fsycl-targets=spir64_gen --offload-new-driver \ |
| 232 | +// RUN: -Xsycl-target-backend=spir64_gen "-device pvc,bdw" -c %s -o %t_multiarch_test.o |
| 233 | +// RUN: clang-linker-wrapper --dry-run --linker-path=/usr/bin/ld \ |
| 234 | +// RUN: --host-triple=x86_64-unknown-linux-gnu %t_multiarch_test.o 2>&1 \ |
| 235 | +// RUN: | FileCheck -check-prefix=OCLOC_MULTI_ARCH %s |
| 236 | +// OCLOC_MULTI_ARCH: ocloc{{.*}}-device pvc,bdw |
| 237 | + |
| 238 | +// Verify for multiple targets with -Xsycl-target-backend= with commas in the values |
| 239 | +// are passed correctly to llvm-offload-binary. |
| 240 | +// RUN: %clangxx -fsycl -### --offload-new-driver \ |
| 241 | +// RUN: -fsycl-targets=nvptx64-nvidia-cuda,amdgcn-amd-amdhsa,spir64_gen \ |
| 242 | +// RUN: -Xsycl-target-backend=amdgcn-amd-amdhsa --offload-arch=gfx908,gfx1010 \ |
| 243 | +// RUN: -Xsycl-target-backend=nvptx64-nvidia-cuda --offload-arch=sm_86,sm_87,sm_89 \ |
| 244 | +// RUN: -Xsycl-target-backend=spir64_gen "-device pvc,bdw" \ |
| 245 | +// RUN: -Xsycl-target-linker=spir64_gen "-DFOO,BAR" \ |
| 246 | +// RUN: -nogpulib %s 2>&1 | FileCheck -check-prefix=MULTI_ARCH2 %s |
| 247 | +// MULTI_ARCH2: llvm-offload-binary{{.*}} "--image=file={{.*}}triple=amdgcn-amd-amdhsa,arch=gfx1010,kind=sycl,compile-opts=--offload-arch=gfx908,compile-opts=gfx1010" |
| 248 | +// MULTI_ARCH2-SAME: "--image=file={{.*}}triple=amdgcn-amd-amdhsa,arch=gfx908,kind=sycl,compile-opts=--offload-arch=gfx908,compile-opts=gfx1010" |
| 249 | +// MULTI_ARCH2-SAME: "--image=file={{.*}}triple=nvptx64-nvidia-cuda,arch=sm_86,kind=sycl,compile-opts=--offload-arch=sm_86,compile-opts=sm_87,compile-opts=sm_89" |
| 250 | +// MULTI_ARCH2-SAME: "--image=file={{.*}}triple=nvptx64-nvidia-cuda,arch=sm_87,kind=sycl,compile-opts=--offload-arch=sm_86,compile-opts=sm_87,compile-opts=sm_89" |
| 251 | +// MULTI_ARCH2-SAME: "--image=file={{.*}}triple=nvptx64-nvidia-cuda,arch=sm_89,kind=sycl,compile-opts=--offload-arch=sm_86,compile-opts=sm_87,compile-opts=sm_89" |
| 252 | +// MULTI_ARCH2-SAME: "--image=file={{.*}}triple=spir64_gen-unknown-unknown,arch=pvc,arch=bdw,kind=sycl,compile-opts=-device_options pvc -ze-intel-enable-auto-large-GRF-mode -device pvc,compile-opts=bdw,link-opts=-DFOO,link-opts=BAR" |
| 253 | + |
| 254 | +// Verify that the driver correctly handles link-opt and compile-opt values with commas |
| 255 | +// RUN: %clangxx -fsycl -### -fsycl-targets=spir64_gen --offload-new-driver \ |
| 256 | +// RUN: -Xsycl-target-backend "-device bdw -FOO a,b" \ |
| 257 | +// RUN: -Xsycl-target-linker "-BAR x,y" %s 2>&1 \ |
| 258 | +// RUN: | FileCheck -check-prefix COMMA_OPTS %s |
| 259 | +// COMMA_OPTS: llvm-offload-binary{{.*}} "--image=file={{.*}}triple=spir64_gen-unknown-unknown,arch=bdw,kind=sycl,compile-opts=-device bdw -FOO a,compile-opts=b,link-opts=-BAR x,link-opts=y" |
| 260 | + |
215 | 261 | /// Verify that --cuda-path is passed to clang-linker-wrapper for SYCL offload |
216 | 262 | // RUN: %clangxx -fsycl -### -fsycl-targets=nvptx64-nvidia-cuda -fno-sycl-libspirv \ |
217 | 263 | // RUN: --cuda-gpu-arch=sm_20 --cuda-path=%S/Inputs/CUDA_80/usr/local/cuda %s \ |
|
0 commit comments