Skip to content

Commit 40fbb79

Browse files
author
Sreelakshmi Haridas Maruthur
authored
cl_khr_external_semaphore: Clarify language (KhronosGroup#938)
* cl_khr_external_semaphore: Clarify language Refined the cl_khr_external_semaphore spec. Removed references to permanence which appear to have been leveraged from the Vulkan spec but don’t apply to the OpenCL spec in its current form. * Fix table format
1 parent b6abbbd commit 40fbb79

File tree

1 file changed

+23
-58
lines changed

1 file changed

+23
-58
lines changed

api/opencl_runtime_layer.asciidoc

Lines changed: 23 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -12866,6 +12866,10 @@ ifdef::cl_khr_external_semaphore[]
1286612866

1286712867
[open,refpage='clGetSemaphoreHandleForTypeKHR',desc='Export external handle from a semaphore',type='protos']
1286812868
--
12869+
12870+
Export operations have the same transference as the specified handle type's import operations. Additionally, exporting a semaphore payload to a handle with copy transference has the same side effects on the source semaphore's payload as executing a semaphore wait operation.
12871+
12872+
Please refer to handle specific documentation for more details on transference requirements per handle type.
1286912873
To export an external handle from a semaphore, call the function
1287012874

1287112875
include::{generated}/api/protos/clGetSemaphoreHandleForTypeKHR.txt[]
@@ -12919,53 +12923,19 @@ Otherwise, it returns one of the following errors:
1291912923

1292012924
=== Importing Semaphore External Handles
1292112925

12922-
Applications can import a semaphore payload into an existing semaphore using
12923-
an external semaphore handle.
12924-
The effects of the import operation will be either temporary or permanent,
12925-
as specified by the application.
12926-
If the import is temporary, the implementation must restore the semaphore to
12927-
its prior permanent state after submitting the next semaphore wait
12928-
operation.
12929-
Performing a subsequent temporary import on a semaphore before performing a
12930-
semaphore wait has no effect on this requirement; the next wait submitted on
12931-
the semaphore must still restore its last permanent state.
12932-
A permanent payload import behaves as if the target semaphore was destroyed,
12933-
and a new semaphore was created with the same handle but the imported
12934-
payload.
12935-
Because importing a semaphore payload temporarily or permanently detaches
12936-
the existing payload from a semaphore, similar usage restrictions to those
12937-
applied to {clReleaseSemaphoreKHR} are applied to any command that imports a
12938-
semaphore payload.
12939-
Which of these import types is used is referred to as the import operation's
12940-
permanence.
12941-
Each handle type supports either one or both types of permanence.
12942-
12943-
The implementation must perform the import operation by either referencing
12944-
or copying the payload referred to by the specified external semaphore
12945-
handle, depending on the handle's type.
12946-
The import method used is referred to as the handle type's transference.
12947-
When using handle types with reference transference, importing a payload to
12948-
a semaphore adds the semaphore to the set of all semaphores sharing that
12949-
payload.
12950-
This set includes the semaphore from which the payload was exported.
12951-
Semaphore signaling and waiting operations performed on any semaphore in the
12952-
set must behave as if the set were a single semaphore.
12953-
Importing a payload using handle types with copy transference creates a
12954-
duplicate copy of the payload at the time of import, but makes no further
12955-
reference to it.
12956-
Semaphore signaling and waiting operations performed on the target of copy
12957-
imports must not affect any other semaphore or payload.
12958-
12959-
Export operations have the same transference as the specified handle type's
12960-
import operations.
12961-
Additionally, exporting a semaphore payload to a handle with copy
12962-
transference has the same side effects on the source semaphore's payload as
12963-
executing a semaphore wait operation.
12964-
If the semaphore was using a temporarily imported payload, the semaphore's
12965-
prior permanent payload will be restored.
12966-
12967-
Please refer to handle specific specifications for more details on
12968-
transference and permanence requirements specific to handle type.
12926+
Applications can import a semaphore payload by creating a semaphore from an external handle. The
12927+
implementation must perform the import operation by either referencing or copying the payload
12928+
referred to by the specified external semaphore handle, depending on the handle's type. When using
12929+
handle types with reference transference, importing a payload to a semaphore adds the semaphore to
12930+
the set of all semaphores sharing that payload. This set includes the semaphore from which the payload
12931+
was exported. Semaphore signaling and waiting operations performed on any semaphore in the set must
12932+
behave as if the set were a single semaphore. Importing a payload using handle types with copy
12933+
transference creates a duplicate copy of the payload at the time of import, but makes no further
12934+
reference to it. Semaphore signaling and waiting operations performed on the target of copy imports
12935+
must not affect any other semaphore or payload.
12936+
12937+
Please refer to handle specific documentation for more details on transference requirements per
12938+
handle type.
1296912939

1297012940

1297112941
=== Descriptions of External Semaphore Handle Types
@@ -13034,25 +13004,23 @@ descriptor when exporting a {CL_SEMAPHORE_HANDLE_SYNC_FD_KHR} from a
1303413004

1303513005
endif::cl_khr_external_semaphore_sync_fd[]
1303613006

13037-
.Transference and Permanence Properties for File Descriptor Handles
13038-
[width="100%",cols="60%,<20%,<20%",options="header"]
13007+
.Transference Properties for File Descriptor Handles
13008+
[width="100%",cols="60%,<40%",options="header"]
1303913009
|====
13040-
| Handle Type | Transference | Permanence
13010+
| Handle Type | Transference
1304113011

1304213012
ifdef::cl_khr_external_semaphore_opaque_fd[]
1304313013
| {CL_SEMAPHORE_HANDLE_OPAQUE_FD_KHR_anchor}
1304413014

1304513015
include::{generated}/api/version-notes/CL_SEMAPHORE_HANDLE_OPAQUE_FD_KHR.asciidoc[]
1304613016
| Reference
13047-
| Temporary, Permanent
1304813017
endif::cl_khr_external_semaphore_opaque_fd[]
1304913018

1305013019
ifdef::cl_khr_external_semaphore_sync_fd[]
1305113020
| {CL_SEMAPHORE_HANDLE_SYNC_FD_KHR_anchor}
1305213021

1305313022
include::{generated}/api/version-notes/CL_SEMAPHORE_HANDLE_SYNC_FD_KHR.asciidoc[]
1305413023
| Copy
13055-
| Temporary
1305613024
endif::cl_khr_external_semaphore_sync_fd[]
1305713025
|====
1305813026

@@ -13130,24 +13098,21 @@ a semaphore from an external handle:
1313013098

1313113099
endif::cl_khr_external_semaphore_win32[]
1313213100

13133-
.Transference and Permanence Properties for NT Handle Types
13134-
[width="100%",cols="60%,<20%,<20%",options="header"]
13101+
.Transference Properties for NT Handle Types
13102+
[width="100%",cols="60%,<40%",options="header"]
1313513103
|====
13136-
| Handle Type | Transference | Permanence
13104+
| Handle Type | Transference
1313713105

1313813106
ifdef::cl_khr_external_semaphore_win32[]
1313913107
| {CL_SEMAPHORE_HANDLE_OPAQUE_WIN32_KHR_anchor}
1314013108

1314113109
include::{generated}/api/version-notes/CL_SEMAPHORE_HANDLE_OPAQUE_WIN32_KHR.asciidoc[]
1314213110
| Reference
13143-
| Temporary, Permanent
1314413111
| {CL_SEMAPHORE_HANDLE_OPAQUE_WIN32_KMT_KHR_anchor}
1314513112

1314613113
include::{generated}/api/version-notes/CL_SEMAPHORE_HANDLE_OPAQUE_WIN32_KMT_KHR.asciidoc[]
1314713114
| Reference
13148-
| Temporary, Permanent
1314913115
endif::cl_khr_external_semaphore_win32[]
13150-
|====
1315113116

1315213117
// TODO Why "Windows handles" here but "NT handles" elsewhere?
1315313118

0 commit comments

Comments
 (0)