[llvm] [Offload][AMDGPU] accept generic target (PR #118919)

via llvm-commits llvm-commits at lists.llvm.org
Sat Dec 7 16:45:36 PST 2024


================
@@ -190,8 +190,9 @@ Error asyncMemCopy(bool UseMultipleSdmaEngines, void *Dst, hsa_agent_t DstAgent,
 #endif
 }
 
-Expected<std::string> getTargetTripleAndFeatures(hsa_agent_t Agent) {
-  std::string Target;
+Expected<StringRef>
+getTargetTripleAndFeatures(hsa_agent_t Agent, SmallVector<StringRef> &Targets) {
+  StringRef SpecificTarget;
----------------
hidekisaito wrote:

I'm talking about the case where the app contains device images for both gfx10-3-generic and gfx1036 and HSA is returning both gfx10-3-generic and gfx1036. gfx10-3-generic image will match up with gfx10-3-generic and gfx1036 image will match up with gfx1036. Functionally, choosing either images should be fine, but I'd like to ensure actual execution happens with gfx1036 image (because the programmer intentionally decided to include that version of image to be used on gfx1036 capable device). If anyone can tell me that it is already happening, great. Please point me to the areas of code for my education. Otherwise, that's where my next exploration would be --- 1) try doing that through HSA interface? 2) try doing that through PluginManager? or 3) let amdgpu RTL do that?

If this explanation does not resonate with you, I'll just give up hunting for SpecificTarget ISA from this patch --- to get the functional implementation land sooner. In terms of functional correctness, generic target feature should work fine without it. I can follow up on the rest after the functional implementation patch lands. On the side note, checking for generic via ends_with() would be incorrect then.

https://github.com/llvm/llvm-project/pull/118919


More information about the llvm-commits mailing list