Skip to content

Commit bffad0c

Browse files
authored
Merge pull request #594 from isaacault/bindless_images
[Exp][Bindless Images] Experimental Bindless Images
2 parents 5d4431e + 11e504e commit bffad0c

18 files changed

+8612
-758
lines changed

include/ur.py

Lines changed: 373 additions & 73 deletions
Large diffs are not rendered by default.

include/ur_api.h

Lines changed: 1334 additions & 487 deletions
Large diffs are not rendered by default.

include/ur_ddi.h

Lines changed: 328 additions & 107 deletions
Large diffs are not rendered by default.

scripts/core/EXP-BINDLESS-IMAGES.rst

Lines changed: 136 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,136 @@
1+
2+
<%
3+
OneApi=tags['$OneApi']
4+
x=tags['$x']
5+
X=x.upper()
6+
%>
7+
8+
.. _exp-bindless-images:
9+
10+
================================================================================
11+
Bindless Images
12+
================================================================================
13+
14+
.. warning::
15+
16+
Experimental features:
17+
18+
* May be replaced, updated, or removed at any time.
19+
* Do not require maintaining API/ABI stability of their own additions over
20+
time.
21+
* Do not require conformance testing of their own additions.
22+
23+
================================================================================
24+
Terminology
25+
================================================================================
26+
For the purposes of this document, a bindless image is one which provides
27+
access to the underlying data via image reference handles. At the application
28+
level, this allows the user to implement programs where the number of images
29+
is not known at compile-time, and store all handles to images -- irrespective
30+
of varying formats and layouts -- in some container, e.g. a dynamic array.
31+
32+
================================================================================
33+
Motivation
34+
================================================================================
35+
The `DPC++ bindless images extension <https://github.com/intel/llvm/pull/8307>`_
36+
has sought to provide the flexibility of bindless images at the SYCL
37+
application level. This extension has been implemented using the CUDA backend of
38+
the DPC++ PI. With the movement to migrate from PI to the Unified Runtime in
39+
DPC++, as seen in `Port CUDA plugin to Unified Runtime
40+
<https://github.com/intel/llvm/pull/9512/>`_, the Unified Runtime's support for
41+
this experimental feature would enable the DPC++ bindless images extension to be
42+
migrated to UR without issue.
43+
44+
================================================================================
45+
Overview
46+
================================================================================
47+
48+
In this document, we propose the following experimental additions to the Unified
49+
Runtime:
50+
51+
* Bindless images support
52+
53+
* Sampled images
54+
* Unsampled images
55+
* Mipmaps
56+
* USM backed images
57+
58+
* Interoperability support
59+
60+
* External memory
61+
* Semaphores
62+
63+
================================================================================
64+
API
65+
================================================================================
66+
67+
--------------------------------------------------------------------------------
68+
Definitions
69+
--------------------------------------------------------------------------------
70+
71+
* ${x}_exp_sampler_mip_properties_t
72+
73+
The following definitions will be implementation-dependent
74+
75+
* ${x}_exp_image_handle_t
76+
* ${x}_exp_image_mem_handle_t
77+
* ${x}_exp_interop_mem_handle_t
78+
* ${x}_exp_interop_semaphore_handle_t
79+
80+
--------------------------------------------------------------------------------
81+
Enums
82+
--------------------------------------------------------------------------------
83+
84+
* ${x}_device_info_t
85+
* ${x}_command_t
86+
* ${x}_exp_image_copy_flags_t
87+
88+
--------------------------------------------------------------------------------
89+
Interface
90+
--------------------------------------------------------------------------------
91+
92+
* USM
93+
* ${x}USMPitchedAllocExp
94+
95+
* Bindless Images
96+
* ${x}BindlessImagesUnsampledImageHandleDestroyExp
97+
* ${x}BindlessImagesSampledImageHandleDestroyExp
98+
* ${x}BindlessImagesImageAllocateExp
99+
* ${x}BindlessImagesImageFreeExp
100+
* ${x}BindlessImagesUnsampledImageCreateExp
101+
* ${x}BindlessImagesSampledImageCreateExp
102+
* ${x}BindlessImagesImageCopyExp
103+
* ${x}BindlessImagesImageGetInfoExp
104+
* ${x}BindlessImagesMipmapGetLevelExp
105+
* ${x}BindlessImagesMipmapFreeExp
106+
107+
* Interop
108+
* ${x}BindlessImagesImportOpaqueFDExp
109+
* ${x}BindlessImagesMapExternalArrayExp
110+
* ${x}BindlessImagesReleaseInteropExp
111+
* ${x}BindlessImagesImportExternalSemaphoreOpaqueFDExp
112+
* ${x}BindlessImagesDestroyExternalSemaphoreExp
113+
* ${x}BindlessImagesWaitExternalSemaphoreExp
114+
* ${x}BindlessImagesSignalExternalSemaphoreExp
115+
116+
117+
================================================================================
118+
Changelog
119+
================================================================================
120+
121+
+-----------+------------------------+
122+
| Revision | Changes |
123+
+===========+========================+
124+
| 1 | Intial Draft |
125+
+-----------+------------------------+
126+
127+
================================================================================
128+
Contributors
129+
================================================================================
130+
131+
* Isaac Ault `isaac.ault@codeplay.com <isaac.ault@codeplay.com>`_
132+
* Duncan Brawley `duncan.brawley@codeplay.com <duncan.brawley@codeplay.com>`_
133+
* Przemek Malon `przemek.malon@codeplay.com <przemek.malon@codeplay.com>`_
134+
* Chedy Najjar `chedy.najjar@codeplay.com <chedy.najjar@codeplay.com>`_
135+
* Sean Stirling `sean.stirling@codeplay.com <sean.stirling@codeplay.com>`_
136+
* Peter Zuzek `peter@codeplay.com peter@codeplay.com <peter@codeplay.com>`_

scripts/core/common.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -329,6 +329,8 @@ etors:
329329
desc: $x_device_partition_properties_t
330330
- name: EXP_COMMAND_BUFFER_DESC
331331
desc: $x_exp_command_buffer_desc_t
332+
- name: EXP_SAMPLER_MIP_PROPERTIES
333+
desc: $x_exp_sampler_mip_properties_t
332334
--- #--------------------------------------------------------------------------
333335
type: struct
334336
desc: "Base for all properties types"

scripts/core/device.yml

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -385,6 +385,54 @@ etors:
385385
desc: "[uint32_t] The maximum number of registers available per block."
386386
- name: IP_VERSION
387387
desc: "[uint32_t] The device IP version. The meaning of the device IP version is implementation-defined, but newer devices should have a higher version than older devices."
388+
- name: BINDLESS_IMAGES_SUPPORT_EXP
389+
value: "0x2000"
390+
desc: "[$x_bool_t] returns true if the device supports the creation of bindless images"
391+
- name: BINDLESS_IMAGES_1D_USM_SUPPORT_EXP
392+
value: "0x2001"
393+
desc: "[$x_bool_t] returns true if the device supports the creation of 1D bindless images backed by USM"
394+
- name: BINDLESS_IMAGES_2D_USM_SUPPORT_EXP
395+
value: "0x2002"
396+
desc: "[$x_bool_t] returns true if the device supports the creation of 2D bindless images backed by USM"
397+
- name: BINDLESS_IMAGES_3D_USM_SUPPORT_EXP
398+
value: "0x2003"
399+
desc: "[$x_bool_t] returns true if the device supports the creation of 3D bindless images backed by USM"
400+
- name: IMAGE_PITCH_ALIGN_EXP
401+
value: "0x2004"
402+
desc: "[uint32_t] returns the required alignment of the pitch between two rows of an image in bytes"
403+
- name: MAX_IMAGE_LINEAR_WIDTH_EXP
404+
value: "0x2005"
405+
desc: "[size_t] returns the maximum linear width allowed for images allocated using USM"
406+
- name: MAX_IMAGE_LINEAR_HEIGHT_EXP
407+
value: "0x2006"
408+
desc: "[size_t] returns the maximum linear height allowed for images allocated using USM"
409+
- name: MAX_IMAGE_LINEAR_PITCH_EXP
410+
value: "0x2007"
411+
desc: "[size_t] returns the maximum linear pitch allowed for images allocated using USM"
412+
- name: MIPMAP_SUPPORT_EXP
413+
value: "0x2008"
414+
desc: "[$x_bool_t] returns true if the device supports allocating mipmap resources"
415+
- name: MIPMAP_ANISOTROPY_SUPPORT_EXP
416+
value: "0x2009"
417+
desc: "[$x_bool_t] returns true if the device supports sampling mipmap images with anisotropic filtering"
418+
- name: MIPMAP_MAX_ANISOTROPY_EXP
419+
value: "0x200A"
420+
desc: "[uint32_t] returns the maximum anisotropic ratio supported by the device"
421+
- name: MIPMAP_LEVEL_REFERENCE_SUPPORT_EXP
422+
value: "0x200B"
423+
desc: "[$x_bool_t] returns true if the device supports using images created from individual mipmap levels"
424+
- name: INTEROP_MEMORY_IMPORT_SUPPORT_EXP
425+
value: "0x200C"
426+
desc: "[$x_bool_t] returns true if the device supports importing external memory resources"
427+
- name: INTEROP_MEMORY_EXPORT_SUPPORT_EXP
428+
value: "0x200D"
429+
desc: "[$x_bool_t] returns true if the device supports exporting internal memory resources"
430+
- name: INTEROP_SEMAPHORE_IMPORT_SUPPORT_EXP
431+
value: "0x200E"
432+
desc: "[$x_bool_t] returns true if the device supports importing external semaphore resources"
433+
- name: INTEROP_SEMAPHORE_EXPORT_SUPPORT_EXP
434+
value: "0x200F"
435+
desc: "[$x_bool_t] returns true if the device supports exporting internal event resources"
388436
--- #--------------------------------------------------------------------------
389437
type: function
390438
desc: "Retrieves various information about device"

scripts/core/event.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,12 @@ etors:
7575
desc: Event created by $xEnqueueWriteHostPipe
7676
- name: COMMAND_BUFFER_ENQUEUE_EXP
7777
desc: Event created by $xCommandBufferEnqueueExp
78+
- name: INTEROP_SEMAPHORE_WAIT_EXP
79+
value: "0x2000"
80+
desc: Event created by $xBindlessImagesWaitExternalSemaphoreExp
81+
- name: INTEROP_SEMAPHORE_SIGNAL_EXP
82+
value: "0x2001"
83+
desc: Event created by $xBindlessImagesSignalExternalSemaphoreExp
7884
--- #--------------------------------------------------------------------------
7985
type: enum
8086
desc: "Event Status"

0 commit comments

Comments
 (0)