-
Notifications
You must be signed in to change notification settings - Fork 790
[Driver][SYCL] Provide ability to use an external host compiler #3530
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
Conversation
The default toolchain when performing -fsycl compilations is to use the clang compiler for the device and host compilations. Enable the ability to use an external host compiler (e.g. gcc/g++) to be used when creating the host objects. This introduces 2 options: -fsycl-host-compiler=<arg> When specified, this option informs the compiler driver that the host compilation step that is performed as part of the greater compilation flow will be performed by the compiler <arg>. It is expected that <arg> is the compiler to be called, either by name (in which the PATH will be used to discover it) or a fully qualified directory with compiler to invoke. This option is only useful when used with when '-fsycl' is provided on the command line. -fsycl-host-compiler-options="opts" Passes along the space separated quoted "opts" string as option arguments to the compiler specified with the -fsycl-host-compiler=<arg> option. It is expected that the options used here are compatible with the compiler specified via -fsycl-host-compiler=<arg>. This option does not have any affect without -fsycl-host-compiler=<arg>.
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.
doc ok
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.
Mostly just small nits from me.
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.
LGTM!
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.
LGTM. Thanks!
@AGindinson , can you take a look? |
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.
Is it possible to add E2E tests of some sort into llvm-test-suite or sycl tests?
While working on an E2E test, I found issues at runtime. When using the external compiler and using -I /include/sycl there would be a runtime fault. Poking around I found that if I used theclang++ as an external host compiler and tried it would still fail in the same manner. Forcing the usage of -internal-isystem <dir>/include/sycl allows for the runtime to succeed. I've reached out to @premanandrao for help, but maybe @AaronBallman has any ideas what is going on?
|
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.
The changes LGTM on the whole. I'm joining to the help request for @premanandrao or @AaronBallman on the matter of E2E testing.
I'm not clear on how we position |
I've tried various things including |
That seems pretty strange to me and may be worth opening an issue to try to track down the root cause of. It seems odd that we need to use the undocumented flag (https://clang.llvm.org/docs/ClangCommandLineReference.html#include-path-management) to get things to work. |
Looks like my environment is somewhat tainted. I had a |
This may explain why I am not able to reproduce this failure. :-) |
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.
LGTM. A similar E2E Windows test could be "intuitively nice", but I personally believe the Linux one provides sufficient coverage for the Driver part.
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.
Thanks, sycl/test/regression
part LGTM
Missed this. Agree, E2E test on Windows with msvc will be nice to have test, but only Linux one looks ok. |
2d66de2
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.
sycl/test/regression
part LGTM
b39f7ab
Everything should be accounted for, could I get a final look? @kbobrovs, @pvchupin , @AaronBallman, @dm-vodopyanov |
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.
doc ok
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.
sycl/test/regression
part LGTM
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.
FE changes continue to look good to me.
The default toolchain when performing -fsycl compilations is to use the
clang compiler for the device and host compilations. Enable the ability
to use an external host compiler (e.g. gcc/g++) to be used when creating
the host objects. This introduces 2 options:
-fsycl-host-compiler=
When specified, this option informs the compiler driver that the host
compilation step that is performed as part of the greater compilation
flow will be performed by the compiler . It is expected that
is the compiler to be called, either by name (in which the PATH
will be used to discover it) or a fully qualified directory with
compiler to invoke. This option is only useful when used with when
'-fsycl' is provided on the command line.
-fsycl-host-compiler-options="opts"
Passes along the space separated quoted "opts" string as option
arguments to the compiler specified with the -fsycl-host-compiler=
option. It is expected that the options used here are compatible with
the compiler specified via -fsycl-host-compiler=. This option
does not have any affect without -fsycl-host-compiler=.