You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: scripts/core/EXT_EXP_BindlessImages.rst
+105-1Lines changed: 105 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -47,10 +47,17 @@ In this extension, we propose the following additions:
47
47
* Provide a new image descriptor and flags for Bindless images.
48
48
* Support for creation of images on linearly allocated memory backed by USM.
49
49
* Extension API to create an image handle from pitched memory
50
+
* Create Bindless sampled images
50
51
51
52
A "Bindless image" can be created by passing ${x}_image_bindless_exp_desc_t to pNext member of
52
53
${x}_image_desc_t and set the flags value as ${X}_IMAGE_BINDLESS_EXP_FLAG_BINDLESS
53
54
55
+
A "Bindless sampled image" can be created by passing ${x}_image_bindless_exp_desc_t to pNext member of
56
+
${x}_image_desc_t and setting the flags to a combination of ${X}_IMAGE_BINDLESS_EXP_FLAG_BINDLESS and ${X}_IMAGE_BINDLESS_EXP_FLAG_SAMPLED_IMAGE
57
+
When image view is created from bindless sampled image, sampling modes can be redefined by passing sampler descriptor in pNext field of ${x}_image_bindless_exp_desc_t struct.
58
+
Image view created from bindless sampled image without setting ${X}_IMAGE_BINDLESS_EXP_FLAG_SAMPLED_IMAGE is an unsampled image.
59
+
Sampled image view can be created from bindless unsampled image by setting ${X}_IMAGE_BINDLESS_EXP_FLAG_SAMPLED_IMAGE and passing sampler descriptor in pNext field of ${x}_image_bindless_exp_desc_t struct.
60
+
54
61
This extension is complimentary to and may be used in conjunction with the `ZE_extension_image_view <https://spec.oneapi.io/level-zero/latest/core/EXT_ImageView.html#image-view-extension>`_ extension
55
62
56
63
Programming example with Bindless images
@@ -178,4 +185,101 @@ Programming example with pitched memory usage
178
185
179
186
// Once all operations on the image are complete we need destroy image handle and free memory
180
187
${x}ImageDestroy(hImage);
181
-
${x}MemFree(hContext, pitchedPtr);
188
+
${x}MemFree(hContext, pitchedPtr);
189
+
190
+
Programming example with Bindless sampled images
191
+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
192
+
193
+
.. parsed-literal::
194
+
195
+
// 2D image dimensions
196
+
size_t imageWidth = 1024;
197
+
size_t imageHeight = 1024;
198
+
199
+
// Single-precision float image format with one channel
Copy file name to clipboardExpand all lines: scripts/core/EXT_Exp_ImageView.rst
+6-1Lines changed: 6 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,6 +6,11 @@ from templates import helper as th
6
6
x=tags['$x']
7
7
X=x.upper()
8
8
%>
9
+
10
+
<%!
11
+
from parse_specs import _version_compare_gequal
12
+
%>
13
+
9
14
:orphan:
10
15
11
16
.. _ZE_experimental_image_view:
@@ -14,7 +19,7 @@ from templates import helper as th
14
19
Image View Extension
15
20
=========================
16
21
17
-
%if ver >= 1.5:
22
+
%if _version_compare_gequal(ver, "1.5"):
18
23
This experimental extension is deprecated and replaced by the :ref:`${th.subt(namespace, tags, X)}_extension_image_view <${th.subt(namespace, tags, X)}_extension_image_view>` standard extension.
Copy file name to clipboardExpand all lines: scripts/core/EXT_Exp_ImageViewPlanar.rst
+6-1Lines changed: 6 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,6 +6,11 @@ from templates import helper as th
6
6
x=tags['$x']
7
7
X=x.upper()
8
8
%>
9
+
10
+
<%!
11
+
from parse_specs import _version_compare_gequal
12
+
%>
13
+
9
14
:orphan:
10
15
11
16
.. _ZE_experimental_image_view_planar:
@@ -14,7 +19,7 @@ from templates import helper as th
14
19
Image View Planar Extension
15
20
=============================
16
21
17
-
%if ver >= 1.5:
22
+
%if _version_compare_gequal(ver, "1.5"):
18
23
This experimental extension is deprecated and replaced by the :ref:`${th.subt(namespace, tags, X)}_extension_image_view_planar <${th.subt(namespace, tags, X)}_extension_image_view_planar>` standard extension.
Copy file name to clipboardExpand all lines: scripts/core/PROG.rst
+23-18Lines changed: 23 additions & 18 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,6 +4,11 @@
4
4
x=tags['$x']
5
5
X=x.upper()
6
6
%>
7
+
8
+
<%!
9
+
from parse_specs import _version_compare_less, _version_compare_gequal
10
+
%>
11
+
7
12
.. _core-programming-guide:
8
13
9
14
========================
@@ -47,7 +52,7 @@ The following diagram illustrates the relationship between the driver, device an
47
52
48
53
.. image:: ../images/core_device.png
49
54
50
-
%if ver >= 1.7:
55
+
%if _version_compare_gequal(ver, "1.7"):
51
56
Level Zero device model hierarchy is composed of **Root Devices** and **Sub-Devices**: A root-device may contain two or more sub-devices and a sub-device shall belong to a single root-device.
52
57
A root-device may not contain a single sub-device, as that would be the same root-device. A root device may also be a device with no sub-devices.
53
58
@@ -620,10 +625,10 @@ External memory handles may be imported from other APIs, or exported for use in
620
625
Importing and exporting external memory is an optional feature.
621
626
Devices may describe the types of external memory handles they support using ${x}DeviceGetExternalMemoryProperties.
622
627
623
-
%if ver >= 1.5:
628
+
%if _version_compare_gequal(ver, "1.5"):
624
629
Importing and exporting external memory is supported for device and host memory allocations and images.
625
630
%endif
626
-
%if ver < 1.5:
631
+
%if _version_compare_less(ver, "1.5"):
627
632
Importing and exporting external memory is supported for device memory allocations and images.
628
633
%endif
629
634
@@ -1104,10 +1109,10 @@ A kernel timestamp event is a special type of event that records device timestam
@@ -1766,7 +1771,7 @@ The values are specific to system configuration; e.g., the number of devices and
1766
1771
The values are specific to the order in which devices are reported by the driver; i.e., the first device maps to ordinal 0, the second device to ordinal 1, and so forth.
1767
1772
If the affinity mask is not set, then all devices and sub-devices are reported; as is the default behavior.
1768
1773
1769
-
%if ver >= 1.7:
1774
+
%if _version_compare_gequal(ver, "1.7"):
1770
1775
The affinity mask masks the devices as defined by value set in the ${X}_FLAT_DEVICE_HIERARCHY environment variable, i.e., a Level Zero driver shall read
1771
1776
first ${X}_FLAT_DEVICE_HIERARCHY to determine the device handles to be used by the application and then interpret the values passed in ${X}_AFFINITY_MASK
1772
1777
based on the device model selected.
@@ -1776,7 +1781,7 @@ The order of the devices reported by the ${x}DeviceGet is implementation-specifi
1776
1781
1777
1782
The order of the devices reported by the ${x}DeviceGet can be forced to be consistent by setting the ${X}_ENABLE_PCI_ID_DEVICE_ORDER environment variable.
1778
1783
1779
-
%if ver < 1.7:
1784
+
%if _version_compare_less(ver, "1.7"):
1780
1785
The following examples demonstrate proper usage for a system configuration of two devices, each with four sub-devices:
1781
1786
1782
1787
- `0, 1`: all devices and sub-devices are reported (same as default)
@@ -1788,7 +1793,7 @@ The following examples demonstrate proper usage for a system configuration of tw
1788
1793
1789
1794
%endif
1790
1795
1791
-
%if ver >= 1.7:
1796
+
%if _version_compare_gequal(ver, "1.7"):
1792
1797
The following examples demonstrate proper usage for a system configuration composed of two physical devices, each of which can be further
1793
1798
sub-divided into four smaller devices. For the purpose of these examples, we will refer to the two physical devices as `parent devices`
1794
1799
and to the smaller sub-devices as `tiles`.
@@ -2125,10 +2130,10 @@ such as multiple levels of indirection, there are two methods available:
2125
2130
2126
2131
+ If the driver is unable to make all allocations resident, then the call to ${x}CommandQueueExecuteCommandLists will return ${X}_RESULT_ERROR_OUT_OF_DEVICE_MEMORY
2127
2132
2128
-
%if ver >= 1.6:
2133
+
%if _version_compare_gequal(ver, "1.6"):
2129
2134
2. Explicit ${x}ContextMakeMemoryResident APIs are included for the application to dynamically change residency as needed.
2130
2135
%endif
2131
-
%if ver < 1.6:
2136
+
%if _version_compare_less(ver, "1.6"):
2132
2137
2. Explicit ${x}ContextMakeMemoryResident APIs are included for the application to dynamically change residency as needed. (Windows-only)
2133
2138
%endif
2134
2139
@@ -2283,18 +2288,18 @@ The following code examples demonstrate how to use the memory IPC APIs:
2283
2288
${x}MemCloseIpcHandle(hContext, dptr);
2284
2289
2285
2290
2286
-
%if ver >= 1.6:
2291
+
%if _version_compare_gequal(ver, "1.6"):
2287
2292
5. Finally, return the IPC handle to the driver with ${x}MemPutIpcHandle and
2288
2293
free the device pointer in the sending process. If ${x}MemPutIpcHandle is not called,
2289
2294
any actions performed by that call are eventually done by ${x}MemFree.
2290
2295
%endif
2291
-
%if ver < 1.6:
2296
+
%if _version_compare_less(ver, "1.6"):
2292
2297
5. Finally, free the device pointer in the sending process:
2293
2298
%endif
2294
2299
2295
2300
.. parsed-literal::
2296
2301
2297
-
%if ver >= 1.6:
2302
+
%if _version_compare_gequal(ver, "1.6"):
2298
2303
${x}MemPutIpcHandle(hContext, hIpc);
2299
2304
%endif
2300
2305
${x}MemFree(hContext, dptr);
@@ -2384,19 +2389,19 @@ Note, there is no guaranteed address equivalence for the values of ``hEvent`` in
2384
2389
${x}EventDestroy(hEvent);
2385
2390
${x}EventPoolCloseIpcHandle(&hEventPool);
2386
2391
2387
-
%if ver >= 1.6:
2392
+
%if _version_compare_gequal(ver, "1.6"):
2388
2393
5. Finally, return the IPC handle to the driver with ${x}EventPoolPutIpcHandle and
2389
2394
free the event pool in the sending process. If ${x}EventPoolPutIpcHandle is not called,
2390
2395
any actions performed by that call are eventually done by ${x}EventPoolDestroy.
2391
2396
%endif
2392
-
%if ver < 1.6:
2397
+
%if _version_compare_less(ver, "1.6"):
2393
2398
5. Finally, free the event pool handle in the sending process:
0 commit comments