Skip to content

Commit 349ec2d

Browse files
committed
Update description of -sycl-ext option
Clarified behavior when flag was set several times or the same extension name was specified several times.
1 parent 385b6a4 commit 349ec2d

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

sycl/doc/ControllingSYCLLanguageFeatures.md

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,11 +72,19 @@ standard version.
7272

7373
Enabling/disabling extensions is done via single `-sycl-ext` option. It accepts
7474
comma-separated list of extension names prefixed with `+` or `-` to indicate
75-
whether particular extension should be enabled or disabled.
75+
whether particular extension should be enabled or disabled. It is possible to
76+
specify that option several times: value from each next occurrence will be added
77+
to already specified ones, forming single extensions string.
7678

7779
Example: `-sycl-ext=+EXTENSION_NAME1,-EXTENSION_NAME2` - this option specifies
7880
that `EXTENSION_NAME1` extension should be enabled and `EXTENSION_NAME2` should
79-
be disabled.
81+
be disabled. `-sycl-ext=+EXTENSION_NAME1 -sycl-ext=-EXTENSION_NAME2` gives the
82+
same result.
83+
84+
When the same extension is mentioned several times within single (or several)
85+
`-sycl-ext` options, the last occurrence overrides all previous ones, i.e.
86+
`-sycl-ext=+EXTENSION_NAME1,-EXTENSION_NAME1,+EXTENSION_NAME1` will leave
87+
`EXTENSION_NAME1` enabled.
8088

8189
When particular extension is enabled, the compiler automatically defines a macro
8290
with the same name, i.e. if `-sycl-ext=EXTENSION_NAME1` command line option was

0 commit comments

Comments
 (0)