Skip to content

[SYCL] Added changes to support multiple archs in command line - #22945

Open
bviyer wants to merge 1 commit into
syclfrom
bviyer-support-passing-multiple-args
Open

[SYCL] Added changes to support multiple archs in command line#22945
bviyer wants to merge 1 commit into
syclfrom
bviyer-support-passing-multiple-args

Conversation

@bviyer

@bviyer bviyer commented Aug 14, 2026

Copy link
Copy Markdown
Contributor

The clang-linker-wrapper --device-compiler=/--device-linker= channel did not distinguish between architectures sharing the same triple, so with-fsycl-targets=spir64_gen,intel_gpu_skl plus per-target -Xsycl-target-backend, all options were emitted under a single spir64_gen-unknown-unknown entry and per-arch tokens leaked across ocloc invocations (e.g. skl's options ended up on the pvc call and vice versa). The driver now emits one --device-compiler/--device-linker per (triple, arch) with tokens joined into a single value; gen entries carry a leading "-device " that the wrapper uses to route each value to the matching ocloc call, while values without "-device" (or from non-gen triples) still apply to every arch of the triple. This feature affects the new-offload-model only.

@bviyer
bviyer requested review from a team as code owners August 14, 2026 20:40
@bviyer bviyer changed the title Added changes to support multiple archs in command line [SYCL] Added changes to support multiple archs in command line Aug 14, 2026
Comment on lines +2738 to +2739
// Value is space-joined; a leading "-device <arch>" routes it to
// that arch only. No -device prefix -> apply to every arch.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ocloc doesn't work like that.

ocloc -device X -A -device Y -B - you assume ocloc will apply -A option to the compilation for device X and -B to the compilation for device Y. In fact, -A -B is applied to both compilations.

@sarnex sarnex Aug 14, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is the -device_options option that may do what you want:

  -device_options <device_type> <options>   Optional OpenCL C compilation options
                                            as defined by OpenCL specification - specific to a single target device.
                                            Multiple product acronyms may be provided - separated by commas.
                                            <device_type> can be product acronym or version passed in -device i.e. dg1 or 12.10.0

I didn't review the PR yet so maybe it doesn't, I just saw Alexey's comment.

Comment on lines +12349 to +12353
for (const char *T : BuildArgs) {
if (!Joined.empty())
Joined += ' ';
Joined += T;
}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The dd9abc1 change purposefully tokenizes the options to be passed to the clang-linker-wrapper. We seem to have effectively lost this behavior. Is there a reason why?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants