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.
[SYCL] Link and include LLVMSupport in SYCL library #16763
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[SYCL] Link and include LLVMSupport in SYCL library #16763
Changes from 5 commits
a89edc6
4b479b2
cb78c5e
8eedefa
c8a5bf9
a1c5055
524e961
0a5c250
fb33872
03718f8
a485a81
8c98e5d
71b1abf
0d43f6c
1a45733
1a306df
e65e559
a909259
c25f17d
cd290c4
0653c17
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm skeptical about linking LLVM libraries with SYCL RT. I had a similar discussion with @stdale-intel and @AlexeySachkov while implementing device image compression (like: #15124 (comment)) and one of the major concerns was potential version mismatch between LLVM libraries linked to SYCL RT and other components like
ocloc
.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I spoke to @AlexeySachkov about this and I agree that it could potentially be a problem if we were to link with it dynamically, but I doubt we would ever want to do that. We already ship enough libraries, and I don't imagine
ocloc
links dynamically with the LLVM libraries either. The only reason we want to link with these are to have some common utilities, so the binary size increase should also be minor as we link privately and won't leak any of the symbols from the libraries.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Linking LLVM libraries statically still can be a problem if we export any LLVM symbols from the SYCL runtime library. AFAIK, we have some measures to force SYCL runtime to export only explicitly marked symbols, but I would explicitly test compatibly with the projects linking against both SYCL runtime and LLVM libraries.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I do believe that should be avoided due to the
PRIVATE
linkage. We should also see it in our ABI symbols tests if there were any new symbols added to the binary after this link, but it seems to not be the case on neither Windows nor Linux.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is using
PRIVATE
keyword here enough to protect us from accidentally including LLVM headers into SYCL headers?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Based on local testing, 384 check-sycl tests start failing with "fatal error: 'llvm/X.h' file not found" if I introduce an include of an LLVM header in the non-source headers.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IIRC, you can mark headers as
SYSTEM
in CMake to avoid warning being emitted for them. We do this with the LLVM headers in SYCL-JIT: https://github.com/intel/llvm/blob/sycl/sycl-jit/jit-compiler/CMakeLists.txt#L57-L63There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh neat! Much better. 😄