-
Notifications
You must be signed in to change notification settings - Fork 14.4k
[libclc] [cmake] Fix per-target *_convert.cl dependencies #127315
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
Merged
Merged
Conversation
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
Fix `add_libclc_builtin_set` to add an appropriate dependency to either `clspv-generate_convert.cl` or `generate_convert.cl` based on the `ARCH` argument, rather than to both unconditionally. This fixes build failures due to missing dependencies when `clspv*` targets are not enabled.
thesamesam
approved these changes
Feb 15, 2025
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.
Please note in the commit message that you're using the same check from libclc/CMakeLists.txt
. LGTM with that.
frasercrmck
reviewed
Feb 15, 2025
I will merge it as it as it fixes #127378 and apt.llvm.org has been broken for a few days because of this This PR can be improved later. |
frasercrmck
added a commit
to frasercrmck/llvm-project
that referenced
this pull request
Feb 17, 2025
In llvm#127378 it was reported that builds without clspv targets enabled were failing after llvm#124727, as all targets had a dependency on a file that only clspv targets generated. A quick fix was merged in llvm#127315 which wasn't correct. It moved the dependency on those generated files to the spirv targets, instead of onto the clspv targets. This means a build with spirv targets and without clspv targets would see the same problems as llvm#127378 reported. I tried simply removing the requirement to explicitly add dependencies to the custom command, relying instead on the file-level dependencies. This didn't seem reliable enough; in some cases on a Makefiles build, the clang command compiling (e.g.,) convert.cl would begin before the file was fully written. Instead, we keep the target-level dependency but automatically infer it based on the generated file name, to avoid manual book-keeping of pairs of files and targets. This commit also fixes what looks like an unintended bug where, when ENABLE_RUNTIME_SUBNORMAL was enabled, the OpenCL conversions weren't being compiled.
frasercrmck
added a commit
that referenced
this pull request
Feb 17, 2025
In #127378 it was reported that builds without clspv targets enabled were failing after #124727, as all targets had a dependency on a file that only clspv targets generated. A quick fix was merged in #127315 which wasn't correct. It moved the dependency on those generated files to the spirv targets, instead of onto the clspv targets. This means a build with spirv targets and without clspv targets would see the same problems as #127378 reported. I tried simply removing the requirement to explicitly add dependencies to the custom command, relying instead on the file-level dependencies. This didn't seem reliable enough; in some cases on a Makefiles build, the clang command compiling (e.g.,) convert.cl would begin before the file was fully written. Instead, we keep the target-level dependency but automatically infer it based on the generated file name, to avoid manual book-keeping of pairs of files and targets. This commit also fixes what looks like an unintended bug where, when ENABLE_RUNTIME_SUBNORMAL was enabled, the OpenCL conversions weren't being compiled.
sivan-shani
pushed a commit
to sivan-shani/llvm-project
that referenced
this pull request
Feb 24, 2025
Fix `add_libclc_builtin_set` to add an appropriate dependency to either `clspv-generate_convert.cl` or `generate_convert.cl` based on the `ARCH` argument, rather than to both unconditionally. This fixes build failures due to missing dependencies when `clspv*` targets are not enabled. The added check mirrors the one from `libclc/CMakeLists.txt`. Fixes: llvm#127378
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.
Fix
add_libclc_builtin_set
to add an appropriate dependency to eitherclspv-generate_convert.cl
orgenerate_convert.cl
based on theARCH
argument, rather than to both unconditionally. This fixes build failures due to missing dependencies whenclspv*
targets are not enabled.The added check mirrors the one from
libclc/CMakeLists.txt
.Fixes: #127378