================
@@ -0,0 +1,63 @@
+/// Tests for Intel GPU names in --offload-arch.
+
+/// An Intel GPU name names a device job.
+// RUN: %clang -ccc-print-phases --target=x86_64-unknown-linux-gnu -fsycl \
+// RUN:   --offload-targets=spirv64-unknown-unknown --offload-arch=xe-bmg-g21 \
+// RUN:   --offload-arch=xe-dg2 -c %s 2>&1 \
+// RUN:   | FileCheck -check-prefixes=CHK-SYCL %s
+// CHK-SYCL-DAG: offload, "device-sycl (spirv64-unknown-unknown:xe-bmg-g21)"
+// CHK-SYCL-DAG: offload, "device-sycl (spirv64-unknown-unknown:xe-dg2)"
+
+/// A device name, its numeric name and an alias are one device job, labeled
+/// with the device name.
+// RUN: %clang -ccc-print-phases --target=x86_64-unknown-linux-gnu -fsycl \
+// RUN:   --offload-targets=spirv64-unknown-unknown --offload-arch=xe-bmg-g21 \
+// RUN:   --offload-arch=xe_20.1.0 -c %s 2>&1 \
+// RUN:   | FileCheck -check-prefixes=CHK-ONE-BMG %s
+// CHK-ONE-BMG-NOT: offload, "device-sycl
+// CHK-ONE-BMG: offload, "device-sycl (spirv64-unknown-unknown:xe-bmg-g21)"
+// CHK-ONE-BMG-NOT: offload, "device-sycl
+// RUN: %clang -ccc-print-phases --target=x86_64-unknown-linux-gnu -fsycl \
+// RUN:   --offload-targets=spirv64-unknown-unknown --offload-arch=xe-arl-u \
+// RUN:   --offload-arch=xe-mtl-u --offload-arch=xe_12.70 -c %s 2>&1 \
+// RUN:   | FileCheck -check-prefixes=CHK-ONE-MTL %s
+// CHK-ONE-MTL-NOT: offload, "device-sycl
+// CHK-ONE-MTL: offload, "device-sycl (spirv64-unknown-unknown:xe-mtl-u)"
+// CHK-ONE-MTL-NOT: offload, "device-sycl
+// RUN: %clang -ccc-print-phases --target=x86_64-unknown-linux-gnu -fsycl \
+// RUN:   --offload-targets=spirv64-unknown-unknown --offload-arch=xe-tgllp -c 
%s 2>&1 \
+// RUN:   | FileCheck -check-prefixes=CHK-TGL %s
+// CHK-TGL: offload, "device-sycl (spirv64-unknown-unknown:xe-tgl)"
+
+/// Removing any spelling removes the device.
+// RUN: %clang -ccc-print-phases --target=x86_64-unknown-linux-gnu -fsycl \
+// RUN:   --offload-targets=spirv64-unknown-unknown --offload-arch=xe-bmg-g21 \
+// RUN:   --offload-arch=generic --no-offload-arch=xe_20.1.0 -c %s 2>&1 \
+// RUN:   | FileCheck -check-prefixes=CHK-NO-ARCH %s
+// RUN: %clang -ccc-print-phases --target=x86_64-unknown-linux-gnu -fsycl \
+// RUN:   --offload-targets=spirv64-unknown-unknown --offload-arch=xe_20.1.0 \
+// RUN:   --offload-arch=generic --no-offload-arch=xe-bmg-g21 -c %s 2>&1 \
+// RUN:   | FileCheck -check-prefixes=CHK-NO-ARCH %s
----------------
bader wrote:

The previous check seems to be good enough. I suggest checking aliases instead 
of spellings.
```suggestion
// RUN: %clang -ccc-print-phases --target=x86_64-unknown-linux-gnu -fsycl \
// RUN:   --offload-targets=spirv64-unknown-unknown --offload-arch=xe-tgl \
// RUN:   --offload-arch=generic --no-offload-arch=xe-tgllp -c %s 2>&1 \
// RUN:   | FileCheck -check-prefixes=CHK-NO-ARCH %s
```

https://github.com/llvm/llvm-project/pull/229247
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to