CoreFlow 1.0.0
A modern orchestration and execution runtime
|
The OpenVX User Kernel Buffer Aliasing extension API. More...
Enumerations | |
enum | vx_buffer_aliasing_enum_e { VX_ENUM_BUFFER_ALIASING_TYPE = 0x1F } |
Extra enums. More... | |
enum | vx_buffer_aliasing_processing_type_e { VX_BUFFER_ALIASING_PROCESSING_TYPE_DENSE = ((( VX_ID_KHRONOS ) << 20) | ( VX_ENUM_BUFFER_ALIASING_TYPE << 12)) + 0x0 , VX_BUFFER_ALIASING_PROCESSING_TYPE_SPARSE = ((( VX_ID_KHRONOS ) << 20) | ( VX_ENUM_BUFFER_ALIASING_TYPE << 12)) + 0x1 } |
Type of processing the kernel will perform on the buffer. More... | |
Functions | |
VX_API_ENTRY vx_status VX_API_CALL | vxAliasParameterIndexHint (vx_kernel kernel, vx_uint32 parameter_index_a, vx_uint32 parameter_index_b, vx_enum processing_type) |
Notifies framework that the kernel supports buffer aliasing of specified parameters. | |
VX_API_ENTRY vx_bool VX_API_CALL | vxIsParameterAliased (vx_node node, vx_uint32 parameter_index_a, vx_uint32 parameter_index_b) |
Query framework if the specified parameters are aliased. | |
The OpenVX User Kernel Buffer Aliasing extension API.
#include <vx_khr_buffer_aliasing.h>
Extra enums.
Enumerator | |
---|---|
VX_ENUM_BUFFER_ALIASING_TYPE | Buffer aliasing type enumeration. |
#include <vx_khr_buffer_aliasing.h>
Type of processing the kernel will perform on the buffer.
Indicates what type of processing the kernel will perform on the buffer. The framework may use this information to arbitrate between requests. For example, if there are two or three conflicting requests for buffer aliasing, then the framework may choose to prioritize a request which gives a performance improvement as compared with one that only saves memory but otherwise doesn't give a performance improvement. For example, a kernel which performs sparse processing may need to first do a buffer copy before processing if the buffers are not aliased. However a kernel which performs dense processing will not need to do this. So priority of the alias request may be given to the kernel which performs sparse processing.
Enumerator | |
---|---|
VX_BUFFER_ALIASING_PROCESSING_TYPE_DENSE | Dense processing on the buffer that can be aliased. |
VX_BUFFER_ALIASING_PROCESSING_TYPE_SPARSE | Sparse processing on the buffer that can be aliased. |
VX_API_ENTRY vx_status VX_API_CALL vxAliasParameterIndexHint | ( | vx_kernel | kernel, |
vx_uint32 | parameter_index_a, | ||
vx_uint32 | parameter_index_b, | ||
vx_enum | processing_type ) |
#include <vx_khr_buffer_aliasing.h>
Notifies framework that the kernel supports buffer aliasing of specified parameters.
This is intended to be called from within the vx_publish_kernels_f callback, for applicable kernels in between the call to the vxAddUserKernel
function and the vxFinalizeKernel
function for the corresponding kernel.
If a kernel can not support buffer aliasing of its parameters (for in-place processing), then it should not call this function. However, if a kernel can support buffer aliasing of a pair of its parameters, then it may call this function with the appropriate parameter indices and priority value.
Note that calling this function does not guarantee that the buffers will ultimatly be aliased by the framework. The framework may consider this hint as part of performance or memory optimization logic along with other factors such as graph topology, other competing hints, and if the parameters are virtual objects or not.
[in] | kernel | Kernel reference |
[in] | parameter_index_a | Index of a kernel parameter to request for aliasing |
[in] | parameter_index_b | Index of another kernel paramter to request to alias with parameter_index_a |
[in] | processing_type | Indicate the type of processing on this buffer from the kernel (See vx_buffer_aliasing_processing_type_e ) |
vx_status_e
enumeration. VX_SUCCESS | No errors. |
VX_ERROR_INVALID_REFERENCE | kernel is not a valid reference |
VX_ERROR_INVALID_PARAMETERS | parameter_index_a or parameter_index_b is NOT a valid kernel parameter index |
VX_FAILURE | priority is not a supported enumeration value. |
VX_API_ENTRY vx_bool VX_API_CALL vxIsParameterAliased | ( | vx_node | node, |
vx_uint32 | parameter_index_a, | ||
vx_uint32 | parameter_index_b ) |
#include <vx_khr_buffer_aliasing.h>
Query framework if the specified parameters are aliased.
This is intended to be called from the vx_kernel_initialize_f or vx_kernel_f callback functions.
If a kernel has called the vxAliasParameterIndexHint function during the vx_publish_kernels_f callback, then vxIsParameterAliased is the function that can be called in the init or processing function to query if the framework was able to alias the buffers specified. Based on this information, the kernel may execute the kernel differently.
[in] | node | Node reference |
[in] | parameter_index_a | Index of a kernel parameter to query for aliasing |
[in] | parameter_index_b | Index of another kernel paramter to query to alias with parameter_index_a |
vx_bool
value. vx_true_e | The parameters are aliased. |
vx_false_e | The parameters are not aliased. |