-
Notifications
You must be signed in to change notification settings - Fork 798
[SYCL RTC] Exclude libdevice's .o/.spv files from resources
#20759
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
Conversation
We only use `.bc` files from libdevice. Another potential implementation for this was to update libdevice's CMakeLists.txt to have separate `libdevice-bc` and `libdevice-non-bc` install components and only install the former into `rtc-resoruce-install` directory. However, that would be intrusive to libdevice with zero benefit there, so I decided to do the filter on the sycl-jit's side inside `generate.py`.
138dba1 to
8821e2e
Compare
|
@intel/llvm-reviewers-runtime , Chris is on vacation, can someone review this? |
|
|
||
| def process_file(file_path): | ||
| # We only need .bc files from libdevice: | ||
| if re.search(r"[/\\]libsycl-.*\.(o|obj|spv)$", file_path): |
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.
would it be simpler to just check if it ends in .bc than to check if it is not bc?
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.
This is used for .h/.hpp/.inc/etc. files as well (when processing components other than libdevice).
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.
maybe im being pedantic but would something like this work?
if "libsycl-" in file_path and file_path.endswith(".bc"):
return
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.
Let me re-phrase, it's better to embed more than not to embed something necessary. As such, I think matching a subset of known exclusions is better that skipping everything other than a few known pieces.
As for your exact suggestion, I think you're missing a negation (or I wasn't clear somewhere). .bc are the ones we need, so we shouldn't early return for them.
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.
ah yeah sorry the second part needs a negation, but with your explanation it lgtm as is
We only use
.bcfiles from libdevice. Another potential implementation for this was to update libdevice's CMakeLists.txt to have separatelibdevice-bcandlibdevice-non-bcinstall components and only install the former intortc-resoruce-installdirectory. However, that would be intrusive to libdevice with zero benefit there, so I decided to do the filter on the sycl-jit's side insidegenerate.py.