[SYCL] Fix and enable bindless image copy tests on L0 #20096
+379
−196
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The
sycl_ext_oneapi_bindless_images
extension specification documents multiple overloads for copying between bindless images depending on source and destination types (i.e. image mem handle to USM, USM to USM, etc.).At Unified Runtime level, there is a single function
urBindlessImagesImageCopyExp
which implements all kinds of copies. However, at lower levels such as CUDA and Level Zero there are several different APIs for different kinds of copies. To understand which one to call, a "copy direction" argument is passed.However, that "copy direction" information is useless for the L0 path, because L0 API is not based on a direction, but it is based on input types (mem handle vs USM). What we have today is tailored to CUDA and if we change copy directions to be tailored to L0, then CUDA breaks (because input types also matter there, but to lesser extent).
In order to fix all issues with bindless image copies and make them work across all adapters, a new argument is introduced into
urBindlessImagesImageCopyExp
to specify types of source and destination arguments. L0 UR adapter makes a decision about which API to call solely on this information, ignoring "copy direction".CUDA & HIP adapters are left as-is - they still use "copy direction" information and sometimes try to guess the type of input arguments to call the right API. With the new argument introduced by this patch, those adapters could be refactored to reduce amount of guessing, but that is outside of the scope of this PR.