[SYCL] Add /OPT:NOREF on Windows when -fsycl-allow-device-image-dependencies is used#21929
Open
srividya-sundaram wants to merge 2 commits intointel:syclfrom
Open
[SYCL] Add /OPT:NOREF on Windows when -fsycl-allow-device-image-dependencies is used#21929srividya-sundaram wants to merge 2 commits intointel:syclfrom
srividya-sundaram wants to merge 2 commits intointel:syclfrom
Conversation
…dencies is used with -fsycl.
| /// our flag overrides the user's optimization setting for correctness. | ||
| // RUN: %clang_cl -fsycl --offload-new-driver \ | ||
| // RUN: -fsycl-allow-device-image-dependencies /O2 \ | ||
| // RUN: -### %s /link /OPT:REF 2>&1 \ |
Contributor
Author
There was a problem hiding this comment.
For this particular test case, having -- %s /link /opt:ref makes everything after it treated as input files not options.
And having /link /opt:ref before -- %s captures all remaining arguments after it as linker arguments
And finally /link is needed to pass /OPT:REF in clang-cl, without it, we get warning: argument unused during compilation: '/OPT:REF' - it's ignored, doesn't reach the linker.
Contributor
Author
|
SYCL pre-commit test failure on Linux us unrelated to this patch |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
When
-fsycl-allow-device-image-dependenciesis used, linked libraries maycontain device-side symbols that are required only for SYCL device image
resolution and are not referenced directly from host code.
On Windows, linker optimization
/OPT:REFmay discard such seemingly unusedimport-library references, causing required device image dependencies to be
dropped from the final executable. This can lead to runtime failures such
as "No device image found" when external device images (for example from
oneMKL device API DLLs) are needed.
Add
/OPT:NOREFwhen-fsycl-allow-device-image-dependenciesis present to preserve thesedependencies and ensure correct runtime device image discovery.