Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions sycl-jit/jit-compiler/utils/generate.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import os
import argparse
import glob
import re


def main():
Expand Down Expand Up @@ -33,6 +34,9 @@ def main():
)

def process_file(file_path):
# We only need .bc files from libdevice:
if re.search(r"[/\\]libsycl-.*\.(o|obj|spv)$", file_path):
Copy link
Contributor

@sarnex sarnex Nov 25, 2025

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?

Copy link
Contributor Author

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).

Copy link
Contributor

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

Copy link
Contributor Author

@aelovikov-intel aelovikov-intel Nov 25, 2025

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.

Copy link
Contributor

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

return
out.write(
f"""
{{
Expand Down