================
@@ -1444,16 +1550,25 @@ getDeviceInput(const ArgList &Args) {
                              B.getBinary()->getArch().count(':');
                     });
 
+  // A SYCL image can list Intel GPUs in "code", e.g. "code=xe-mtl-h,xe-mtl-u".
+  // Images with different lists are linked separately, so the key of an image
+  // is its target and its "code".
+  using ImageID = std::pair<OffloadFile::TargetID, StringRef>;
----------------
YuriPlyakhin wrote:

@jhuber6,

I'd like your opinion on where this belongs.

With this PR, `code` (the list of real devices to compile a virtual arch for) 
is part of what decides whether two images link together, so it is checked 
inline here through a local `ImageID` wrapper, next to `areTargetsEquivalent` / 
`areTargetsCompatible`.

Would you prefer `code` to be part of `OffloadFile::TargetID` instead, so that 
those two functions hold the whole rule (`triple`, `arch`, `code`, and the 
`generic` exception) for every offload kind?

The wrapper is their only user, so the change should be small.

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