Skip to content

Commit c71a6e0

Browse files
authored
Revert dx fence (#1359)
* Revert dx fence deletion * Remove column that no longer exists * Add line * add missing file
1 parent d2a5639 commit c71a6e0

5 files changed

Lines changed: 102 additions & 4 deletions

api/cl_khr_external_semaphore.asciidoc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,8 @@ This extension defines:
6565
semaphores created from different handle types.
6666
* API query exportable semaphores handles using specified handle type.
6767

68-
The layered extensions {cl_khr_external_semaphore_opaque_fd_EXT},
68+
The layered extensions {cl_khr_external_semaphore_dx_fence_EXT},
69+
{cl_khr_external_semaphore_opaque_fd_EXT},
6970
{cl_khr_external_semaphore_sync_fd_EXT}, and
7071
{cl_khr_external_semaphore_win32_EXT} define specific external semaphores
7172
that may be imported into or exported from OpenCL.
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
// Copyright 2021-2024 The Khronos Group Inc.
2+
// SPDX-License-Identifier: CC-BY-4.0
3+
4+
include::{generated}/meta/{refprefix}cl_khr_external_semaphore_dx_fence.txt[]
5+
6+
=== Other Extension Metadata
7+
8+
*Last Modified Date*::
9+
2021-09-10
10+
*IP Status*::
11+
No known IP claims.
12+
*Contributors*::
13+
- Ajit Hakke-Patil, NVIDIA
14+
- Amit Rao, NVIDIA
15+
- Balaji Calidas, QUALCOMM
16+
- Ben Ashbaugh, INTEL
17+
- Carsten Rohde, NVIDIA
18+
- Christoph Kubisch, NVIDIA
19+
- Debalina Bhattacharjee, NVIDIA
20+
- Faith Ekstrand, INTEL
21+
- James Jones, NVIDIA
22+
- Jeremy Kemp, IMAGINATION
23+
- Joshua Kelly, QUALCOMM
24+
- Karthik Raghavan Ravi, NVIDIA
25+
- Kedar Patil, NVIDIA
26+
- Kevin Petit, ARM
27+
- Nikhil Joshi, NVIDIA
28+
- Sharan Ashwathnarayan, NVIDIA
29+
- Vivek Kini, NVIDIA
30+
31+
=== Description
32+
33+
{cl_khr_external_semaphore_dx_fence_EXT} supports importing and exporting a
34+
D3D12 fence as an external semaphore using the APIs introduced by
35+
{cl_khr_external_semaphore_EXT}.
36+
37+
=== New Enums
38+
39+
* {cl_external_semaphore_handle_type_khr_TYPE}
40+
** {CL_SEMAPHORE_HANDLE_D3D12_FENCE_KHR}
41+
42+
=== Version History
43+
44+
* Revision 0.9.0, 2021-09-10
45+
** Initial version (provisional).

api/opencl_runtime_layer.asciidoc

Lines changed: 42 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13737,10 +13737,42 @@ endif::cl_khr_external_semaphore_sync_fd[]
1373713737
endif::cl_khr_external_semaphore_opaque_fd,cl_khr_external_semaphore_sync_fd[]
1373813738

1373913739

13740-
ifdef::cl_khr_external_semaphore_win32[]
13740+
ifdef::cl_khr_external_semaphore_dx_fence,cl_khr_external_semaphore_win32[]
1374113741

1374213742
==== NT Handle Types
1374313743

13744+
ifdef::cl_khr_external_semaphore_dx_fence[]
13745+
13746+
The {cl_khr_external_semaphore_dx_fence_EXT} extension extends
13747+
{cl_external_semaphore_handle_type_khr_TYPE} to support the following new
13748+
types of handles, and adds as a property that may be specified when creating
13749+
a semaphore from an external handle:
13750+
13751+
* {CL_SEMAPHORE_HANDLE_D3D12_FENCE_KHR} specifies an NT handle returned by
13752+
`ID3D12Device::CreateSharedHandle` referring to a Direct3D 12 fence, or
13753+
`ID3D11Device5::CreateFence` referring to a Direct3D 11 fence.
13754+
It owns a reference to the underlying synchronization primitive
13755+
associated with the Direct3D fence.
13756+
13757+
When waiting on semaphores using {clEnqueueWaitSemaphoresKHR} or signaling
13758+
semaphores using {clEnqueueSignalSemaphoresKHR}, the semaphore payload must
13759+
be provided for semaphores created from
13760+
{CL_SEMAPHORE_HANDLE_D3D12_FENCE_KHR}.
13761+
13762+
* If _sema_objects_ list has a mix of semaphores obtained from
13763+
{CL_SEMAPHORE_HANDLE_D3D12_FENCE_KHR} and other handle types, then the
13764+
_sema_payload_list_ should point to a list of _num_sema_objects_ payload
13765+
values for each semaphore in _sema_objects_.
13766+
However, the payload values corresponding to semaphores with type
13767+
{CL_SEMAPHORE_TYPE_BINARY_KHR} can be set to 0 or will be ignored.
13768+
13769+
{clEnqueueWaitSemaphoresKHR} and {clEnqueueSignalSemaphoresKHR} may return
13770+
{CL_INVALID_VALUE} if _sema_objects_ list has one or more semaphores
13771+
obtained from {CL_SEMAPHORE_HANDLE_D3D12_FENCE_KHR} and _sema_payload_list_
13772+
is NULL.
13773+
13774+
endif::cl_khr_external_semaphore_dx_fence[]
13775+
1374413776
ifdef::cl_khr_external_semaphore_win32[]
1374513777

1374613778
The {cl_khr_external_semaphore_win32_EXT} extension extends
@@ -13778,6 +13810,14 @@ endif::cl_khr_external_semaphore_win32[]
1377813810
|====
1377913811
| Handle Type | Transference
1378013812

13813+
ifdef::cl_khr_external_semaphore_dx_fence[]
13814+
| {CL_SEMAPHORE_HANDLE_D3D12_FENCE_KHR_anchor}
13815+
13816+
include::{generated}/api/version-notes/CL_SEMAPHORE_HANDLE_D3D12_FENCE_KHR.asciidoc[]
13817+
| Reference
13818+
13819+
endif::cl_khr_external_semaphore_dx_fence[]
13820+
1378113821
ifdef::cl_khr_external_semaphore_win32[]
1378213822
| {CL_SEMAPHORE_HANDLE_OPAQUE_WIN32_KHR_anchor}
1378313823

@@ -13804,7 +13844,7 @@ For handle types defined as NT handles, the application must release
1380413844
ownership using the `CloseHandle` system call when the handle is no longer
1380513845
needed.
1380613846

13807-
endif::cl_khr_external_semaphore_win32[]
13847+
endif::cl_khr_external_semaphore_dx_fence,cl_khr_external_semaphore_win32[]
1380813848

1380913849
endif::cl_khr_external_semaphore[]
1381013850

ext/quick_reference.asciidoc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,10 @@ Language Specifications.
120120
| Common Functionality for External Semaphore Sharing
121121
| Extension
122122

123+
| [[cl_khr_external_semaphore_dx_fence]] link:{APISpecURL}#cl_khr_external_semaphore[{cl_khr_external_semaphore_dx_fence_EXT}]
124+
| Direct3D 12 External Semaphore Handles
125+
| Provisional Extension
126+
123127
| [[cl_khr_external_semaphore_opaque_fd]] link:{APISpecURL}#cl_khr_external_semaphore[{cl_khr_external_semaphore_opaque_fd_EXT}]
124128
| Opaque File Descriptor External Semaphore Handles
125129
| Extension

xml/cl.xml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1891,7 +1891,7 @@ server's OpenCL/api-docs repository.
18911891
<enum value="0x2056" name="CL_SEMAPHORE_HANDLE_OPAQUE_WIN32_KHR"/>
18921892
<enum value="0x2057" name="CL_SEMAPHORE_HANDLE_OPAQUE_WIN32_KMT_KHR"/>
18931893
<enum value="0x2058" name="CL_SEMAPHORE_HANDLE_SYNC_FD_KHR"/>
1894-
<unused start="0x2059" end="0x2059" comment="Reserved to Khronos for interop"/>
1894+
<enum value="0x2059" name="CL_SEMAPHORE_HANDLE_D3D12_FENCE_KHR"/>
18951895
<enum value="0x2060" name="CL_EXTERNAL_MEMORY_HANDLE_OPAQUE_FD_KHR"/>
18961896
<enum value="0x2061" name="CL_EXTERNAL_MEMORY_HANDLE_OPAQUE_WIN32_KHR"/>
18971897
<enum value="0x2062" name="CL_EXTERNAL_MEMORY_HANDLE_OPAQUE_WIN32_KMT_KHR"/>
@@ -7118,6 +7118,14 @@ server's OpenCL/api-docs repository.
71187118
<command name="clGetSemaphoreHandleForTypeKHR"/>
71197119
</require>
71207120
</extension>
7121+
<extension name="cl_khr_external_semaphore_dx_fence" revision="0.9.0" supported="opencl" depends="CL_VERSION_1_2+cl_khr_semaphore+cl_khr_external_semaphore" ratified="opencl" provisional="true">
7122+
<require>
7123+
<type name="CL/cl.h"/>
7124+
</require>
7125+
<require comment="cl_external_semaphore_handle_type_khr">
7126+
<enum name="CL_SEMAPHORE_HANDLE_D3D12_FENCE_KHR"/>
7127+
</require>
7128+
</extension>
71217129
<extension name="cl_khr_external_semaphore_opaque_fd" revision="1.0.0" supported="opencl" depends="CL_VERSION_1_2+cl_khr_semaphore+cl_khr_external_semaphore" ratified="opencl">
71227130
<require>
71237131
<type name="CL/cl.h"/>

0 commit comments

Comments
 (0)