================
@@ -1,21 +1,56 @@
 /// Tests for Intel GPU names in --offload-arch.
 
-/// An Intel GPU name names a device job.
+/// An Intel GPU is compiled for its IGCA target, e.g. xe-bmg-g21 for igca_40r.
 // 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)"
+// CHK-SYCL-DAG: offload, "device-sycl (spirv64-unknown-unknown:igca_40r)"
+// CHK-SYCL-DAG: offload, "device-sycl (spirv64-unknown-unknown:igca_15ra)"
 
-/// A device name, an alias and a numeric name are kept as given.
-// RUN: %clang -ccc-print-phases --target=x86_64-unknown-linux-gnu -fsycl \
+/// A device name, an alias and a numeric name of one device give one device
+/// image for its IGCA target, which lists each name as given, to compile ahead
+/// of time for.
+// RUN: %clang -### --target=x86_64-unknown-linux-gnu -fsycl \
 // RUN:   --offload-targets=spirv64-unknown-unknown --offload-arch=xe-mtl-u \
 // RUN:   --offload-arch=xe-arl-u --offload-arch=xe_12.70.0 -c %s 2>&1 \
 // RUN:   | FileCheck -check-prefixes=CHK-AS-GIVEN %s
-// CHK-AS-GIVEN-DAG: offload, "device-sycl (spirv64-unknown-unknown:xe-mtl-u)"
-// CHK-AS-GIVEN-DAG: offload, "device-sycl (spirv64-unknown-unknown:xe-arl-u)"
-// CHK-AS-GIVEN-DAG: offload, "device-sycl 
(spirv64-unknown-unknown:xe_12.70.0)"
+// CHK-AS-GIVEN: llvm-offload-binary" "-o" "{{[^"]*}}" 
"--image=file={{[^"]*}},triple=spirv64-unknown-unknown,arch=igca_30r,kind=sycl,code=xe-arl-u,code=xe-mtl-u,code=xe_12.70.0"{{$}}
+
+/// The devices are sorted, so that objects compiled for the same devices in 
any
+/// order have the same list and are linked together.
+// RUN: %clang -### --target=x86_64-unknown-linux-gnu -fsycl \
+// RUN:   --offload-arch=xe-mtl-h,xe-mtl-u -c %s 2>&1 \
+// RUN:   | FileCheck -check-prefixes=CHK-SORTED %s
+// RUN: %clang -### --target=x86_64-unknown-linux-gnu -fsycl \
+// RUN:   --offload-arch=xe-mtl-u,xe-mtl-h -c %s 2>&1 \
+// RUN:   | FileCheck -check-prefixes=CHK-SORTED %s
+// CHK-SORTED: 
"--image=file={{[^"]*}},triple=spirv64-unknown-unknown,arch=igca_30r,kind=sycl,code=xe-mtl-h,code=xe-mtl-u"
+
+/// An IGCA target given directly lists no devices, so it is compiled just in
+/// time.
+// RUN: %clang -### --target=x86_64-unknown-linux-gnu -fsycl \
+// RUN:   --offload-arch=igca_30r -c %s 2>&1 \
+// RUN:   | FileCheck -check-prefixes=CHK-IGCA-ONLY %s
+// CHK-IGCA-ONLY: 
"--image=file={{[^"]*}},triple=spirv64-unknown-unknown,arch=igca_30r,kind=sycl"
+
+/// -Xarch_ names the IGCA target of the device compile, not an Intel GPU, as
+/// one device compile can be for several Intel GPUs.
+// RUN: %clang -### --target=x86_64-unknown-linux-gnu -fsycl \
+// RUN:   --offload-arch=xe-pvc -Xarch_igca_20ca -DFOO -Xarch_xe-pvc -DBAR \
----------------
srividya-sundaram wrote:

No, clang warns "argument unused during compilation: '-Xarch_xe-pvc -DBAR'". I 
added a check for the warning in 
[sycl-intel-gpu-arch.cpp#L50-L57](https://github.com/llvm/llvm-project/blob/b0fda271560f/clang/test/Driver/sycl-intel-gpu-arch.cpp#L50-L57),
 in https://github.com/llvm/llvm-project/pull/239010/commits/25a6b9d9af0b.

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

Reply via email to