Skip to content

[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

Merged
merged 3 commits into from
Jul 26, 2019
Merged

Conversation

Ruyk
Copy link
Contributor

@Ruyk Ruyk commented Jul 21, 2019

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]

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]>
Copy link
Contributor

@bader bader left a 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.

@bader
Copy link
Contributor

bader commented Jul 21, 2019

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 cl::sycl::intel namespace, but it's not always possible, especially if an extension requires compiler support.

Do you think it might be useful to add -sycl-std= option values for SYCL 1.2.1 with extensions and/or working version for next spec version/revision?

This might help users to separate standard (i.e. portable across different implementations) functionality from non-standard extensions.

@Ruyk
Copy link
Contributor Author

Ruyk commented Jul 21, 2019

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.

@Ruyk
Copy link
Contributor Author

Ruyk commented Jul 23, 2019

I've moved the test to the preprocessor and fixed some issues.
When is the -fsycl-is-host option enabled?

@mdtoguchi
Copy link
Contributor

I've moved the test to the preprocessor and fixed some issues.
When is the -fsycl-is-host option enabled?

The -fsycl-is-host option is used during the host side of the compilation for any -fsycl compilation from source.

mdtoguchi
mdtoguchi previously approved these changes Jul 23, 2019
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
Copy link
Contributor

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'

Copy link
Contributor

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.

Copy link
Contributor

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?

Copy link
Contributor

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.

Copy link
Contributor Author

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?

Copy link
Contributor

Choose a reason for hiding this comment

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

Please use '--sycl'

Copy link
Contributor

@agozillon agozillon Jul 25, 2019

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.

Copy link
Contributor

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)

Copy link
Contributor

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!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Pushed the fix , thanks!

@bader
Copy link
Contributor

bader commented Jul 23, 2019

@Ruyk, could you sign your second commit too, please?

@keryell
Copy link
Contributor

keryell commented Jul 24, 2019

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]>
@bader bader merged commit 1b250f7 into intel:sycl Jul 26, 2019
@Ruyk Ruyk deleted the sycl-version-flag branch July 29, 2019 11:09
aelovikov-intel pushed a commit to aelovikov-intel/llvm that referenced this pull request Feb 23, 2023
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.

5 participants