Skip to content

device-compiler pipeline#22311

Draft
YuriPlyakhin wants to merge 1 commit into
intel:syclfrom
YuriPlyakhin:device-compiler-option-design
Draft

device-compiler pipeline#22311
YuriPlyakhin wants to merge 1 commit into
intel:syclfrom
YuriPlyakhin:device-compiler-option-design

Conversation

@YuriPlyakhin

Copy link
Copy Markdown
Contributor

No description provided.

`-Xoffload-compiler<triple> <arg>`:
Pass `<arg>` to the offload compilers or the ones identified by `-<triple>`

Open #1: is `Xsycl-target` intended for the same purpose as `-Xoffload-compiler`? Should we deprecate `Xsycl-target` in favor of `-Xoffload-compiler`?

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.

We probably should or atleast start a proposal to do so in future. Two flags that do the same thing is a bit confusing.

So the actual command the driver builds (visible with `clang++ -###`) looks like:

```
clang-linker-wrapper --host-triple=x86_64-unknown-linux-gnu \

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.

Question: In the stage1 command, it was like this:

clang++ -fopenmp --offload-arch=gfx90a -Xoffload-compiler -ffast-math foo.cpp

gfx90a is a AMD GPU right? So how did it get translated to nvptx64-nvidia-cuda?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

examples were created by claude, I don't think they match, all this are illustrative for discussion. Feel free to update to specific options, if you feel it is useful.


Open #1: is `Xsycl-target` intended for the same purpose as `-Xoffload-compiler`? Should we deprecate `Xsycl-target` in favor of `-Xoffload-compiler`?

Open #2: Per https://www.intel.com/content/www/us/en/docs/dpcpp-cpp-compiler/developer-guide-reference/2025-1/xsycl-target.html , it seems `-Xsycl-target-backend`

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

you can do something like that: clang++ ... -flto ... -Xsycl-target-backend="..." "-ocloc_option"
Then in current downstream implementation, it will translate to something like this:
--device-compiler=pisa="-flto" --device-compiler=spirv="-ocloc_option"

-flto is intended for clang++, -ocloc_option is inteded for ocloc. This is the problem.

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.

2 participants