diff --git a/sycl/doc/extensions/LevelZeroBackend/LevelZeroBackend.md b/sycl/doc/extensions/LevelZeroBackend/LevelZeroBackend.md index 60cc4fbe9890c..4370f7d422f46 100755 --- a/sycl/doc/extensions/LevelZeroBackend/LevelZeroBackend.md +++ b/sycl/doc/extensions/LevelZeroBackend/LevelZeroBackend.md @@ -139,9 +139,54 @@ Applications must make sure that the Level-Zero handles themselves aren't used s Practically speaking, and taking into account that SYCL runtime takes ownership of the Level-Zero handles, the application should not attempt further direct use of those handles. +## 5 Level-Zero additional functionality + +### 5.1 Device Information Descriptors +The Level Zero backend provides the following device information descriptors +that an application can use to query information about a Level Zero device. +Applications use these queries via the `device::get_backend_info<>()` member +function as shown in the example below (which illustrates the `free_memory` +query): + +``` C++ +sycl::queue Queue; +auto Device = Queue.get_device(); + +size_t freeMemory = + Device.get_backend_info(); +``` + +New descriptors added as part of this specification are described in the table below and in the subsequent synopsis. + +| Descriptor | Description | +| ---------- | ----------- | +| `sycl::ext::oneapi::level_zero::info::device::free_memory` | Returns the number of bytes of free memory for the device. | + + +``` C++ +namespace sycl{ +namespace ext { +namespace oneapi{ +namespace level_zero { +namespace info { +namespace device { + +struct free_memory { + using return_type = size_t; +}; + +} // namespace device; +} // namespace info +} // namespace level_zero +} // namespace oneapi +} // namespace ext +} // namespace sycl +``` + ## Revision History |Rev|Date|Author|Changes| |-------------|:------------|:------------|:------------| |1|2021-01-26|Sergey Maslov|Initial public working draft |2|2021-02-22|Sergey Maslov|Introduced explicit ownership for context +|3|2021-04-13|James Brodman|Free Memory Query