@@ -139,9 +139,54 @@ Applications must make sure that the Level-Zero handles themselves aren't used s
139
139
Practically speaking, and taking into account that SYCL runtime takes ownership of the Level-Zero handles,
140
140
the application should not attempt further direct use of those handles.
141
141
142
+ ## 5 Level-Zero additional functionality
143
+
144
+ ### 5.1 Device Information Descriptors
145
+ The Level Zero backend provides the following device information descriptors
146
+ that an application can use to query information about a Level Zero device.
147
+ Applications use these queries via the ` device::get_backend_info<>() ` member
148
+ function as shown in the example below (which illustrates the ` free_memory `
149
+ query):
150
+
151
+ ``` C++
152
+ sycl::queue Queue;
153
+ auto Device = Queue.get_device();
154
+
155
+ size_t freeMemory =
156
+ Device.get_backend_info<sycl::ext::oneapi::level_zero::info::device::free_memory>();
157
+ ```
158
+
159
+ New descriptors added as part of this specification are described in the table below and in the subsequent synopsis.
160
+
161
+ | Descriptor | Description |
162
+ | ---------- | ----------- |
163
+ | ` sycl::ext::oneapi::level_zero::info::device::free_memory ` | Returns the number of bytes of free memory for the device. |
164
+
165
+
166
+ ``` C++
167
+ namespace sycl {
168
+ namespace ext {
169
+ namespace oneapi{
170
+ namespace level_zero {
171
+ namespace info {
172
+ namespace device {
173
+
174
+ struct free_memory {
175
+ using return_type = size_t;
176
+ };
177
+
178
+ } // namespace device;
179
+ } // namespace info
180
+ } // namespace level_zero
181
+ } // namespace oneapi
182
+ } // namespace ext
183
+ } // namespace sycl
184
+ ```
185
+
142
186
## Revision History
143
187
|Rev|Date|Author|Changes|
144
188
|-------------|:------------|:------------|:------------|
145
189
|1|2021-01-26|Sergey Maslov|Initial public working draft
146
190
|2|2021-02-22|Sergey Maslov|Introduced explicit ownership for context
191
+ |3|2021-04-13|James Brodman|Free Memory Query
147
192
0 commit comments