Skip to content

Commit c22e2d7

Browse files
committed
Specify that implementations may choose to not use secondary queues
This commit changes the specification for the submit function taking a secondary queue, specifying that implementations may choose to not associate the secondary queue with the command-groups. In tandem with this, the changes use the term "associated" in more places to make it clearer that cases requiring exceptions for secondary queues are only if the implementations elect to associate the secondary queues with the command-groups. Signed-off-by: Larsen, Steffen <[email protected]>
1 parent 938dd0d commit c22e2d7

File tree

2 files changed

+38
-30
lines changed

2 files changed

+38
-30
lines changed

adoc/chapters/device_compiler.adoc

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -424,12 +424,12 @@ implementation supports the features on any of its devices.
424424
Of course, applications that make use of optional kernel features should ensure
425425
that a kernel using such a feature is submitted only to a device that supports
426426
the feature.
427-
If the application submits a <<command-group>> using a secondary queue, then any
428-
kernel submitted from the <<command-group>> should use only features that are
429-
supported by both the primary queue's device and the secondary queue's device.
430-
If an application fails to do this, the implementation must throw a synchronous
431-
exception with the [code]#errc::kernel_not_supported# error code from the
432-
<<kernel-invocation-command>> (e.g. [code]#parallel_for()#).
427+
If the application submits a <<command-group>> that has a secondary queue
428+
associated with it, then any kernel submitted from the <<command-group>> should
429+
use only features that are supported by both the primary queue's device and the
430+
secondary queue's device. If an application fails to do this, the implementation
431+
must throw a synchronous exception with the [code]#errc::kernel_not_supported#
432+
error code from the <<kernel-invocation-command>> (e.g. [code]#parallel_for()#).
433433

434434
It is legal for a SYCL application to define several kernels in the same
435435
translation unit even if they use different optional features, as shown in the
@@ -630,10 +630,10 @@ Specifying this attribute on a kernel has two effects. First, it causes the
630630
[code]#errc::kernel_not_supported# error code if the kernel is submitted to a
631631
device that does not have one of the listed aspects. (This includes the device
632632
associated with the secondary queue if the kernel is submitted from a
633-
<<command-group>> that has a secondary queue.) Second, it causes the compiler
634-
to issue a diagnostic if the kernel (or any of the functions it calls) uses an
635-
optional feature that is associated with an aspect that is not listed in the
636-
attribute.
633+
<<command-group>> with an associated secondary queue.) Second, it causes the
634+
compiler to issue a diagnostic if the kernel (or any of the functions it calls)
635+
uses an optional feature that is associated with an aspect that is not listed in
636+
the attribute.
637637

638638
The value of each parameter to this attribute must be equal to one of the
639639
values in the [code]#sycl::aspect# enumeration type (including any extended

adoc/chapters/programming_interface.adoc

Lines changed: 28 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -4150,6 +4150,10 @@ device.
41504150
On a kernel error, this <<command-group-function-object>> may be scheduled for
41514151
execution on the secondary queue [code]#secondaryQueue# as described in
41524152
<<sec::fallback-mechanism>>.
4153+
The implementation may elect to not use the secondary queue
4154+
[code]#secondaryQueue#, in which case the secondary queue is not considered
4155+
associated with the enqueued <<command-group>> and any <<handler>> object passed
4156+
to it.
41534157

41544158
_Returns:_ An event which represents the <<command>> which is submitted to the
41554159
queue.
@@ -5533,10 +5537,10 @@ via the SYCL [code]#device# class info query
55335537
the implementation to throw an [code]#exception# with the [code]#errc::invalid#
55345538
error code from the [code]#accessor# constructor (if the accessor is not a
55355539
placeholder) or from [code]#handler::require()# (if the accessor is a
5536-
placeholder). If the accessor is bound to a <<command-group>> with a secondary
5537-
queue, the sub-buffer's alignment must be compatible with both the primary
5538-
queue's device and the secondary queue's device, otherwise this exception is
5539-
thrown.
5540+
placeholder). If the accessor is bound to a <<command-group>> with an
5541+
associated secondary queue, the sub-buffer's alignment must be compatible with
5542+
both the primary queue's device and the secondary queue's device, otherwise this
5543+
exception is thrown.
55405544

55415545
Must throw an [code]#exception# with the [code]#errc::invalid# error code if
55425546
[code]#b# is a sub-buffer.
@@ -14600,7 +14604,8 @@ implicitly uses the kernel bundle that contains the [code]#kernelObject#.
1460014604
Throws an [code]#exception# with the [code]#errc::kernel_not_supported# error
1460114605
code if the [code]#kernelObject# is not compatible with either the device
1460214606
associated with the primary queue of the <<command-group>> or with the device
14603-
associated with the secondary queue (if specified).
14607+
associated with the secondary queue (if one is associated with the
14608+
<<command-group>>).
1460414609

1460514610
a@
1460614611
[source]
@@ -14622,7 +14627,8 @@ implicitly uses the kernel bundle that contains the [code]#kernelObject#.
1462214627
Throws an [code]#exception# with the [code]#errc::kernel_not_supported# error
1462314628
code if the [code]#kernelObject# is not compatible with either the device
1462414629
associated with the primary queue of the <<command-group>> or with the device
14625-
associated with the secondary queue (if specified).
14630+
associated with the secondary queue (if one is associated with the
14631+
<<command-group>>).
1462614632

1462714633
a@
1462814634
[source]
@@ -14649,7 +14655,8 @@ implicitly uses the kernel bundle that contains the [code]#kernelObject#.
1464914655
Throws an [code]#exception# with the [code]#errc::kernel_not_supported# error
1465014656
code if the [code]#kernelObject# is not compatible with either the device
1465114657
associated with the primary queue of the <<command-group>> or with the device
14652-
associated with the secondary queue (if specified).
14658+
associated with the secondary queue (if one is associated with the
14659+
<<command-group>>).
1465314660

1465414661
|====
1465514662

@@ -15280,10 +15287,10 @@ If the <<command-group>> attempts to invoke a kernel that is not contained by a
1528015287
compatible device image in [code]#execBundle#, the <<kernel-invocation-command>>
1528115288
throws a synchronous [code]#exception# with the
1528215289
[code]#errc::kernel_not_supported# error code.
15283-
If the <<command-group>> has a secondary queue, then the [code]#execBundle# must
15284-
contain a kernel that is compatible with both the primary queue's device and the
15285-
secondary queue's device, otherwise the <<kernel-invocation-command>> throws
15286-
this exception.
15290+
If the <<command-group>> has an associated secondary queue, then the
15291+
[code]#execBundle# must contain a kernel that is compatible with both the
15292+
primary queue's device and the secondary queue's device, otherwise the
15293+
<<kernel-invocation-command>> throws this exception.
1528715294

1528815295
Since the handler method for setting specialization constants is incompatible
1528915296
with the kernel bundle method, applications should not call this function if
@@ -15295,8 +15302,9 @@ _Throws:_
1529515302
* An [code]#exception# with the [code]#errc::invalid# error code if the
1529615303
<<context>> associated with the <<handler>> via its associated primary
1529715304
<<queue>> or the <<context>> associated with the secondary <<queue>> (if
15298-
provided) is different from the <<context>> associated with the
15299-
<<kernel-bundle>> specified by [code]#execBundle#.
15305+
(if one is associated with the <<handler>>) is different from the
15306+
<<context>> associated with the <<kernel-bundle>> specified by
15307+
[code]#execBundle#.
1530015308

1530115309
* An [code]#exception# with the [code]#errc::invalid# error code if
1530215310
[code]#handler::set_specialization_constant()# has been called for this
@@ -15727,8 +15735,8 @@ code if [code]#Backend != get_backend()#.
1572715735
--
1572815736
_Returns:_ The <<native-backend-object>> associated with the <<queue>> that the
1572915737
<<host-task>> was submitted to.
15730-
If the <<command-group>> was submitted with a secondary <<queue>> and the
15731-
fall-back was triggered, the <<queue>> that is associated with the
15738+
If the <<command-group>> was submitted with an associated secondary <<queue>>
15739+
and the fall-back was triggered, the <<queue>> that is associated with the
1573215740
[code]#interop_handle# must be the fall-back <<queue>>.
1573315741
The <<native-backend-object>> returned must be in a state where it is capable of
1573415742
being used in a way appropriate for the associated <<backend>>.
@@ -17468,7 +17476,7 @@ then:
1746817476
==== Asynchronous errors with a secondary queue
1746917477

1747017478
If an <<async-error>> occurs when running or enqueuing a command group which has
17471-
a secondary queue specified, then the command group may be enqueued to the
17479+
a secondary queue associated, then the command group may be enqueued to the
1747217480
secondary queue instead of the primary queue.
1747317481
The error handling in this case is also configured using the <<async-handler>>
1747417482
provided for both queues.
@@ -17480,10 +17488,10 @@ If the primary queue fails and there is an <<async-handler>> given at this
1748017488
queue's construction, which populates the [code]#exception_list# parameter, then
1748117489
any errors will be added and can be thrown whenever the user chooses to handle
1748217490
those exceptions.
17483-
Since there were errors on the primary queue and a secondary queue was given,
17484-
then the execution of the kernel is re-scheduled to the secondary queue and any
17485-
error reporting for the kernel execution on that queue is done through that
17486-
queue, in the same way as described above.
17491+
Since there were errors on the primary queue and a secondary queue was
17492+
associated, then the execution of the kernel is re-scheduled to the secondary
17493+
queue and any error reporting for the kernel execution on that queue is done
17494+
through that queue, in the same way as described above.
1748717495
The secondary queue may fail as well, and the errors will be thrown if there is
1748817496
an <<async-handler>> and either [code]#wait_and_throw()# or [code]#throw()# are
1748917497
called on that queue.

0 commit comments

Comments
 (0)