Skip to content

Commit a427486

Browse files
authored
Fix DDI Handle EXT docs (#287)
Signed-off-by: Neil R. Spruit <[email protected]>
1 parent 48193b6 commit a427486

File tree

1 file changed

+19
-13
lines changed

1 file changed

+19
-13
lines changed

scripts/core/EXT_Driver_DDIHandles.rst

Lines changed: 19 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ from templates import helper as th
1010

1111
.. _ZE_extension_driver_ddi_handles:
1212

13-
==========================================
13+
=======================================================
1414
Driver Direct Device Interface (DDI) Handles Extension
15-
==========================================
15+
=======================================================
1616

1717
API
1818
----
@@ -32,21 +32,25 @@ See `ze*_ddi.h` for definitions of `ze_dditable_driver_t`, `zet_dditable_driver_
3232
`ze_handle_t` is defined in ze_ddi_common.h. To use it, include `ze_ddi_common.h`.
3333

3434
Handle Structures:
35-
~~~~~~~~~~~~~~~~~
35+
~~~~~~~~~~~~~~~~~~
3636

3737
/// @brief Handle with pointer to Dispatch Container allocated by the driver at the beginning of every L0 Core handle
38-
typedef struct _ze_handle_t
39-
{
40-
ze_dditable_driver_t *pCore; // [in] pointer to _ze_dditable_t_ object related to this handle
41-
zet_dditable_driver_t *pTools; // [in] pointer to _zet_dditable_t_ object related to this handle
42-
zes_dditable_driver_t *pSysman; // [in] pointer to _zes_dditable_t_ object related to this handle
43-
} ze_handle_t;
38+
39+
.. code-block:: c
40+
41+
typedef struct _ze_handle_t
42+
{
43+
ze_dditable_driver_t *pCore; // [in] pointer to _ze_dditable_t_ object related to this handle
44+
zet_dditable_driver_t *pTools; // [in] pointer to _zet_dditable_t_ object related to this handle
45+
zes_dditable_driver_t *pSysman; // [in] pointer to _zes_dditable_t_ object related to this handle
46+
} ze_handle_t;
4447
4548
DDI Handles Extension:
46-
~~~~~~~~~~~~~~~~~~~~~
49+
~~~~~~~~~~~~~~~~~~~~~~
4750

4851
Nowadays there are many possible scenarios of multiple Level Zero runtimes in the system (GPU + NPU, dGPU + iGPU on Windows, mainstream GPU + legacy GPU on Linux).
4952
Our current handling of multi runtime scenario in Loader has many issues:
53+
5054
- performance degradation
5155
- Level Zero API handles are stored in per-type maps, accessing these maps costs, especially in hot paths
5256
- putting and removing entries from map needs additional mutex to ensure thread-safety
@@ -62,12 +66,14 @@ Backward compatibility is covered as new loader will still support runtimes that
6266
Loader should verify the support based on extension property queried from zeDriverGetExtensionProperties.
6367

6468
Example Implementation of L0 Loader functions:
65-
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
69+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
70+
71+
.. code-block:: cpp
6672
67-
.. parsed-literal::
73+
///////////////////////////////////////////////////////////////////////////////
6874
ZE_APIEXPORT ze_result_t ZE_APICALL zeContextCreate(
6975
ze_driver_handle_t hDriver,
7076
const ze_context_desc_t *desc,
7177
ze_context_handle_t *phContext) {
7278
return hDriver->pCore->pContext->pfnCreate(hDriver, desc, phContext);
73-
}
79+
}

0 commit comments

Comments
 (0)