|
| 1 | +# |
| 2 | +# Copyright (C) 2026 Intel Corporation |
| 3 | +# |
| 4 | +# SPDX-License-Identifier: MIT |
| 5 | +# |
| 6 | +# See YaML.md for syntax definition |
| 7 | +# |
| 8 | +--- #-------------------------------------------------------------------------- |
| 9 | +type: header |
| 10 | +desc: "Intel $OneApi Level-Zero APIs for Append Host Function" |
| 11 | +version: "1.17" |
| 12 | +--- #-------------------------------------------------------------------------- |
| 13 | +type: callback |
| 14 | +desc: "Host Function callback type" |
| 15 | +version: "1.17" |
| 16 | +convention: $X_CALLBACK_CONV |
| 17 | +returntype: void |
| 18 | +name: $x_host_function_callback_t |
| 19 | +params: |
| 20 | + - type: void* |
| 21 | + name: pUserData |
| 22 | + desc: "[in][optional] user data pointer" |
| 23 | +--- #-------------------------------------------------------------------------- |
| 24 | +type: function |
| 25 | +desc: "Appends a host function call into a command list." |
| 26 | +version: "1.17" |
| 27 | +class: $xCommandList |
| 28 | +name: AppendHostFunction |
| 29 | +details: |
| 30 | + - "The application must ensure the events are accessible by the device on which the command list was created." |
| 31 | + - "The host function will be executed on the host when the command list reaches this point during execution." |
| 32 | + - "The host function callback must be of type $x_host_function_callback_t." |
| 33 | + - "The host function must **not** call any Level Zero API functions." |
| 34 | + - "The host function may access USM shared and USM host allocations." |
| 35 | + - "The runtime invokes the host function asynchronously to API calls." |
| 36 | + - "Device may wait for preceding commands to finish before invoking the callback (i.e. callbacks may introduce implicit synchronization point on the device)." |
| 37 | + - "Device will wait for all phWaitEvents to be signaled before executing the host function." |
| 38 | + - "The application must **not** call this function from simultaneous threads with the same command list handle." |
| 39 | +params: |
| 40 | + - type: $x_command_list_handle_t |
| 41 | + name: hCommandList |
| 42 | + desc: "[in] handle of the command list" |
| 43 | + - type: $x_host_function_callback_t |
| 44 | + name: pfnHostFunction |
| 45 | + desc: "[in] host function to call, expected to be lightweight and non-blocking" |
| 46 | + - type: void* |
| 47 | + name: pUserData |
| 48 | + desc: "[in][optional] user specific data that would be passed to function; neither the runtime nor the device will dereference it" |
| 49 | + - type: "const void*" |
| 50 | + name: pNext |
| 51 | + desc: "[in][optional] additional extensions passed to the function" |
| 52 | + - type: $x_event_handle_t |
| 53 | + name: hSignalEvent |
| 54 | + desc: "[in][optional] handle of the event to signal on completion" |
| 55 | + - type: uint32_t |
| 56 | + name: numWaitEvents |
| 57 | + desc: "[in][optional] count of phWaitEvents; must be 0 if `nullptr == phWaitEvents`" |
| 58 | + - type: "$x_event_handle_t*" |
| 59 | + name: phWaitEvents |
| 60 | + desc: "[in][optional][range(0, numWaitEvents)] handle of the events to wait on before launching" |
| 61 | +returns: |
| 62 | + - $X_RESULT_ERROR_INVALID_SYNCHRONIZATION_OBJECT |
| 63 | + - $X_RESULT_ERROR_INVALID_SIZE: |
| 64 | + - "`(nullptr == phWaitEvents) && (0 < numWaitEvents)`" |
| 65 | + - $X_RESULT_ERROR_UNSUPPORTED_FEATURE: |
| 66 | + - "an extension passed via pNext is not supported" |
0 commit comments