[Driver][SYCL] Bound architecture mismatch with multiple targets #15501
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 passing -fsycl-targets to specify targets to offload to, the user can pass multiple targets. When those targets are meant to set various associated architectures, those architectures should only be set for a singular given toolchain/target.
Specifying a setting like -fsycl-targets=nvptx64,spir64_gen was setting the wrong device architecture for the spir64_gen compilation. The associated boundarch for nvptx64 (in this case sm_50) was being pushed to the spir64_gen target, causing the wrong device value to be used for the AOT compilation.
Fix this issue by fixing the logic in which we were assigning the bound architecture to a given triple. The logic was not taking into account non-spir64_gen targets, assigning the wrong arch when spir64_gen was encountered after the nvptx64 target.