[Openmp-commits] [PATCH] D147756: [Libomptarget] Load an image if it is compatible with at least one device

Jan-Patrick Lehr via Phabricator via Openmp-commits openmp-commits at lists.llvm.org
Tue May 9 04:05:46 PDT 2023

jplehr added a comment.

In D147756#4252032 <https://reviews.llvm.org/D147756#4252032>, @jhuber6 wrote:

> In D147756#4251909 <https://reviews.llvm.org/D147756#4251909>, @jdoerfert wrote:
>> It sounds like this might break some invariants we have about plugins, devices, and images.
>> If this does not work, some alternative ideas:
>> What if we make the plugins detect that they have different architectures and they create one instance per arch?
>> Though, we could also force the plugin to choose. If device 0 works with in image and device 1 does not, we ignore 1 from now on.
> Yes, the problem right now is that we assign device ID's based on the logical devices found, not whether or not they loaded an image. So to make this work we would need to initialize the devices in order of images we find them compatible for. So on a system offloading to `gfx90a` and `gfx908`, if we had a `gfx908` image, we would find it matches `gfx908` and assign that device to zero. This is definitely a break from the current logic where we simply initialize all the devices found.

This is not part of this patch though, or am I missing something here?

  rG LLVM Github Monorepo



More information about the Openmp-commits mailing list