-
Notifications
You must be signed in to change notification settings - Fork 790
[SYCL] Driver option to select SYCL version #355
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
User can select the version of SYCL the compiler will use via the flag -sycl-std, similar to -cl-std. The flag defines the LangOpts.SYCLVersion option to the version of SYCL. The default value is undefined. If driver is building SYCL code, flag is set to the default SYCL version (1.2.1) The preprocessor uses this variable to define CL_SYCL_LANGUAGE_VERSION macro, which should be defined according to SYCL 1.2.1 standard. Only valid value at this point for the flag is 1.2.1. Co-Authored-By: David Wood <[email protected]> Signed-off-by: Ruyman Reyes <[email protected]>
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.
@Ruyk, thanks for working on this!
LGTM.
I have just one minor comment regarding the test.
Also I'd like @mdtoguchi to review the driver and documentation changes.
BTW, we added (or will add) a bunch of extensions to the standard functionality from SYCL 1.2.1 (see https://github.com/intel/llvm/tree/sycl/sycl/doc/extensions). Some of the extensions are following SYCL spec recommendation and define new functionality in Do you think it might be useful to add This might help users to separate standard (i.e. portable across different implementations) functionality from non-standard extensions. |
Yeah, that was my thinking moving forward. Intel extensions could be enabled with -sycl-std=1.2.1-intel , so that 1.2.1 can be used to ensure a purely conformant SYCL application. next or *201y" or similar can be used for experimental or features coming on new revisions of the standard. |
I've moved the test to the preprocessor and fixed some issues. |
The -fsycl-is-host option is used during the host side of the compilation for any -fsycl compilation from source. |
In the driver, the following bools are defined to determine the compilation | ||
mode in SYCL: | ||
|
||
* IsSYCL : True if the user has passed `-fsycl` or `-sycl` to the compilation |
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.
syntax of device only option is '--sycl'
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.
Let's document -fsycl-is-device
.
We are going to remove --sycl
.
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.
Let's document
-fsycl-is-device
.
We are going to remove--sycl
.
I believe the option is '-fsycl-device-only', right?
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.
@mdtoguchi, right. I just realized that this renaming is not done yet.
Please, ignore my comment.
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.
Which one should I keep on my commit then?
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 use '--sycl'
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.
Let's document
-fsycl-is-device
.
We are going to remove--sycl
.
As an aside, would removal of the --sycl
flag stop the ability to compile just the kernel bitcode and integration header or are you planning to add some other functionality/way of achieving the same thing with a different combination of flags? I ask as being able to separate the offloading and just compile the required device output has been quite useful.
And if -save-temps is still broken (#25) I imagine (but could be wrong) using the --sycl
flag is currently the simplest way to get access to just the kernel bitcode and integration header if you want to inspect them. I'm not against removing it, but I have found the --sycl
option useful in the past!
Sorry for derailing the code review.
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 behavior is not going away, we are replacing the option with a more friendly external option name (-fsycl-device-only)
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.
Ah, great news. Thanks for the information!
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.
Pushed the fix , thanks!
@Ruyk, could you sign your second commit too, please? |
That looks good. |
* Moved macro test to Preprocessor * Fixed when the value of the SYCL Standard is set for different flags Signed-off-by: Ruyman Reyes <[email protected]>
Signed-off-by: Ruyman Reyes <[email protected]>
Signed-off-by: Sergey Kanaev <[email protected]>
User can select the version of SYCL the compiler will
use via the flag -sycl-std, similar to -cl-std.
The flag defines the LangOpts.SYCLVersion option to the
version of SYCL. The default value is undefined.
If driver is building SYCL code, flag is set to the default SYCL
version (1.2.1)
The preprocessor uses this variable to define CL_SYCL_LANGUAGE_VERSION macro,
which should be defined according to SYCL 1.2.1 standard.
Only valid value at this point for the flag is 1.2.1.
Co-Authored-By: David Wood [email protected]
Signed-off-by: Ruyman Reyes [email protected]