[SYCL] Don't load all fallback spirv when launching from SPIRV file #11734
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.
Currently, sycl-post-link tool scans user's device image to detect any undefined function call to items in fallback spirv devicelibs and create a property in final executable to tell which fallback devicelibs are really needed. SYCL runtime will load required fallback spirv libs according to this property.
However, if "SYCL_USE_KERNEL_SPIRV" is used, the kernel is launched from spv file and sycl-post-link tool is not involved to scan and generate the property. Previously, we just load and link all fallback spv files and underlying runtime will remove them when they don't need those code. However, we received a lot of complains about seeing a lot of unnecessary code from underlying runtime. So, this PR is to avoid loading this unnecessary code.
If anyone uses clang++ driver to generate spv file, this file won't depend on any functions from fallback spv since device code has to be linked with wrapper .obj to involve any functions from fallback spv.