Skip to content

Commit acf9907

Browse files
authored
[UR] Add ur_usm_pool_buffer_desc_t extension (#17634)
Add extension to ur_usm_pool_desc_t structure chain that allows the user to specify a buffer and its size that should by used for pool creation in urUSMPoolCreate or urUSMPoolCreateEx function.
1 parent 8552343 commit acf9907

File tree

10 files changed

+138
-5
lines changed

10 files changed

+138
-5
lines changed

unified-runtime/include/ur_api.h

Lines changed: 26 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

unified-runtime/include/ur_print.h

Lines changed: 10 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

unified-runtime/include/ur_print.hpp

Lines changed: 52 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

unified-runtime/scripts/core/EXP-ASYNC-ALLOC.rst

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,10 @@ Async Allocation Functions
2323
Motivation
2424
--------------------------------------------------------------------------------
2525

26-
Asynchronous allocations can allow queues to allocate and free memory between
27-
UR command enqueues without forcing synchronization points in the asynchronous
26+
Asynchronous allocations can allow queues to allocate and free memory between
27+
UR command enqueues without forcing synchronization points in the asynchronous
2828
command DAG associated with a queue. Through the enqueue-ordering semantics,
29-
memory allocated within a pool can be reused so as to avoid expensive and
29+
memory allocated within a pool can be reused so as to avoid expensive and
3030
redundant calls into the OS, which can improve performance.
3131

3232
API
@@ -60,6 +60,7 @@ Types
6060
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
6161

6262
* ${x}_exp_async_usm_alloc_properties_t
63+
* ${x}_usm_pool_buffer_desc_t
6364

6465
Functions
6566
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -97,6 +98,9 @@ Changelog
9798
| 1.3 | Remove USMPoolSetThresholdExp |
9899
| | Replace with USMPoolSetInfoExp |
99100
+----------+----------------------------------------------------------+
101+
| 1.4 | Introduce usm_pool_buffer_desc_t to enable pool |
102+
| | creation from a USM memory object |
103+
+----------+----------------------------------------------------------+
100104

101105
Support
102106
--------------------------------------------------------------------------------
@@ -110,3 +114,4 @@ Contributors
110114

111115
* Hugh Delaney `hugh.delaney@codeplay.com <hugh.delaney@codeplay.com>`_
112116
* Sean Stirling `sean.stirling@codeplay.com <sean.stirling@codeplay.com>`_
117+
* Krzysztof Swiecicki `krzysztof.swiecicki@intel.com <krzysztof.swiecicki@intel.com>`_

unified-runtime/scripts/core/exp-async-alloc.yml

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ etors:
3737
- name: READ_ONLY_EXP
3838
value: "$X_BIT(2)"
3939
desc: |
40-
Performance hint asserting that all memory allocations from the
40+
Performance hint asserting that all memory allocations from the
4141
memory pool will only ever be read from within SYCL kernel functions
4242
4343
--- #--------------------------------------------------------------------------
@@ -114,6 +114,29 @@ members:
114114
name: flags
115115
desc: "[in] async alloc flags"
116116

117+
--- #--------------------------------------------------------------------------
118+
type: struct
119+
desc: "USM pool buffer descriptor type"
120+
details:
121+
- Used for pool creation from USM memory object. Specify these properties in
122+
$xUSMPoolCreate or $xUSMPoolCreateExp via $x_usm_pool_desc_t as part of a `pNext` chain.
123+
class: $xUSM
124+
name: $x_usm_pool_buffer_desc_t
125+
base: $x_base_desc_t
126+
members:
127+
- type: "void*"
128+
name: pMem
129+
desc: "[in] USM memory object"
130+
- type: "size_t"
131+
name: size
132+
desc: "[in] size of USM memory object"
133+
- type: "$x_usm_type_t"
134+
name: memType
135+
desc: "[in] type of USM memory object"
136+
- type: "$x_device_handle_t"
137+
name: device
138+
desc: "[in][optional] device associated with the USM memory object"
139+
117140
--- #--------------------------------------------------------------------------
118141
type: function
119142
desc: "Enqueue an async device allocation"
@@ -261,7 +284,7 @@ returns:
261284
- $X_RESULT_ERROR_INVALID_NULL_HANDLE
262285
- $X_RESULT_ERROR_INVALID_NULL_POINTER
263286
- $X_RESULT_ERROR_INVALID_EVENT_WAIT_LIST
264-
287+
265288
--- #--------------------------------------------------------------------------
266289
type: function
267290
desc: "Create USM memory pool with desired properties."

unified-runtime/scripts/core/registry.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -753,3 +753,6 @@ etors:
753753
- name: USM_ALLOC_LOCATION_DESC
754754
desc: $x_usm_alloc_location_desc_t
755755
value: '35'
756+
- name: USM_POOL_BUFFER_DESC
757+
desc: $x_usm_pool_buffer_desc_t
758+
value: '36'

unified-runtime/source/common/stype_map_helpers.def

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

unified-runtime/source/loader/loader.def.in

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

unified-runtime/source/loader/loader.map.in

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

unified-runtime/source/loader/ur_print.cpp

Lines changed: 9 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)