CoreFlow 1.0.0
A modern orchestration and execution runtime
Loading...
Searching...
No Matches
User Facing Convolution API

The Public Convolution API. More...

Typedefs

typedef struct Convolution * vx_convolution
 The Convolution Object. A user-defined convolution kernel of MxM elements.
 

Enumerations

enum  vx_convolution_attribute_e {
  VX_CONVOLUTION_ROWS = VX_ATTRIBUTE_BASE(VX_ID_KHRONOS, VX_TYPE_CONVOLUTION) + 0x0 ,
  VX_CONVOLUTION_COLUMNS = VX_ATTRIBUTE_BASE(VX_ID_KHRONOS, VX_TYPE_CONVOLUTION) + 0x1 ,
  VX_CONVOLUTION_SCALE = VX_ATTRIBUTE_BASE(VX_ID_KHRONOS, VX_TYPE_CONVOLUTION) + 0x2 ,
  VX_CONVOLUTION_SIZE = VX_ATTRIBUTE_BASE(VX_ID_KHRONOS, VX_TYPE_CONVOLUTION) + 0x3
}
 The convolution attributes. More...
 

Functions

VX_API_ENTRY vx_convolution VX_API_CALL vxCreateConvolution (vx_context context, vx_size columns, vx_size rows)
 Creates a reference to a convolution matrix object.
 
VX_API_ENTRY vx_convolution VX_API_CALL vxCreateVirtualConvolution (vx_graph graph, vx_size columns, vx_size rows)
 Creates an opaque reference to a convolution matrix object without direct user access.
 
VX_API_ENTRY vx_status VX_API_CALL vxReleaseConvolution (vx_convolution *conv)
 Releases the reference to a convolution matrix. The object may not be garbage collected until its total reference count is zero.
 
VX_API_ENTRY vx_status VX_API_CALL vxQueryConvolution (vx_convolution conv, vx_enum attribute, void *ptr, vx_size size)
 Queries an attribute on the convolution matrix object.
 
VX_API_ENTRY vx_status VX_API_CALL vxSetConvolutionAttribute (vx_convolution conv, vx_enum attribute, const void *ptr, vx_size size)
 Sets attributes on the convolution object.
 
VX_API_ENTRY vx_status VX_API_CALL vxCopyConvolutionCoefficients (vx_convolution conv, void *user_ptr, vx_enum usage, vx_enum user_mem_type)
 Allows the application to copy coefficients from/into a convolution object.
 

Detailed Description

The Public Convolution API.

Typedef Documentation

◆ vx_convolution

typedef struct Convolution* vx_convolution

#include <vx_types.h>

The Convolution Object. A user-defined convolution kernel of MxM elements.

Enumeration Type Documentation

◆ vx_convolution_attribute_e

#include <vx_types.h>

The convolution attributes.

Enumerator
VX_CONVOLUTION_ROWS 

The number of rows of the convolution matrix. Read-only. Use a vx_size parameter.

VX_CONVOLUTION_COLUMNS 

The number of columns of the convolution matrix. Read-only. Use a vx_size parameter.

VX_CONVOLUTION_SCALE 

The scale of the convolution matrix. Read-write. Use a vx_uint32 parameter. .

VX_CONVOLUTION_SIZE 

The total size of the convolution matrix in bytes. Read-only. Use a vx_size parameter.

Function Documentation

◆ vxCopyConvolutionCoefficients()

VX_API_ENTRY vx_status VX_API_CALL vxCopyConvolutionCoefficients ( vx_convolution conv,
void * user_ptr,
vx_enum usage,
vx_enum user_mem_type )

#include <vx_api.h>

Allows the application to copy coefficients from/into a convolution object.

Parameters
[in]convThe reference to the convolution object that is the source or the destination of the copy.
[in]user_ptrThe address of the memory location where to store the requested coefficient data if the copy was requested in read mode, or from where to get the coefficient data to store into the convolution object if the copy was requested in write mode. In the user memory, the convolution coefficient data is structured as a row-major 2D array with elements of the type corresponding to VX_TYPE_CONVOLUTION, with a number of rows corresponding to VX_CONVOLUTION_ROWS and a number of columns corresponding to VX_CONVOLUTION_COLUMNS. The accessible memory must be large enough to contain this 2D array: accessible memory in bytes >= sizeof(data_element) * rows * columns.
[in]usageThis declares the effect of the copy with regard to the convolution object using the vx_accessor_e enumeration. Only VX_READ_ONLY and VX_WRITE_ONLY are supported:
  • VX_READ_ONLY means that data are copied from the convolution object into the user memory.
  • VX_WRITE_ONLY means that data are copied into the convolution object from the user memory.
[in]user_mem_typeA vx_memory_type_e enumeration that specifies the memory type of the memory referenced by the user_addr.
Returns
A vx_status_e enumeration.
Return values
VX_SUCCESSNo errors; any other value indicates failure.
VX_ERROR_INVALID_REFERENCEconv is not a valid vx_convolution reference.
VX_ERROR_INVALID_PARAMETERSAn other parameter is incorrect.

◆ vxCreateConvolution()

VX_API_ENTRY vx_convolution VX_API_CALL vxCreateConvolution ( vx_context context,
vx_size columns,
vx_size rows )

#include <vx_api.h>

Creates a reference to a convolution matrix object.

Parameters
[in]contextThe reference to the overall context.
[in]columnsThe columns dimension of the convolution. Must be odd and greater than or equal to 3 and less than the value returned from VX_CONTEXT_CONVOLUTION_MAX_DIMENSION.
[in]rowsThe rows dimension of the convolution. Must be odd and greater than or equal to 3 and less than the value returned from VX_CONTEXT_CONVOLUTION_MAX_DIMENSION.
Returns
A convolution reference vx_convolution. Any possible errors preventing a successful creation should be checked using vxGetStatus.

◆ vxCreateVirtualConvolution()

VX_API_ENTRY vx_convolution VX_API_CALL vxCreateVirtualConvolution ( vx_graph graph,
vx_size columns,
vx_size rows )

#include <vx_api.h>

Creates an opaque reference to a convolution matrix object without direct user access.

Parameters
[in]graphThe reference to the parent graph.
[in]columnsThe columns dimension of the convolution. Must be odd and greater than or equal to 3 and less than the value returned from VX_CONTEXT_CONVOLUTION_MAX_DIMENSION.
[in]rowsThe rows dimension of the convolution. Must be odd and greater than or equal to 3 and less than the value returned from VX_CONTEXT_CONVOLUTION_MAX_DIMENSION.
See also
vxCreateConvolution
Returns
A convolution reference vx_convolution. Any possible errors preventing a successful creation should be checked using vxGetStatus.

◆ vxQueryConvolution()

VX_API_ENTRY vx_status VX_API_CALL vxQueryConvolution ( vx_convolution conv,
vx_enum attribute,
void * ptr,
vx_size size )

#include <vx_api.h>

Queries an attribute on the convolution matrix object.

Parameters
[in]convThe convolution matrix object to set.
[in]attributeThe attribute to query. Use a vx_convolution_attribute_e enumeration.
[out]ptrThe location at which to store the resulting value.
[in]sizeThe size in bytes of the container to which ptr points.
Returns
A vx_status_e enumeration.
Return values
VX_SUCCESSNo errors; any other value indicates failure.
VX_ERROR_INVALID_REFERENCEconv is not a valid vx_convolution reference.

◆ vxReleaseConvolution()

VX_API_ENTRY vx_status VX_API_CALL vxReleaseConvolution ( vx_convolution * conv)

#include <vx_api.h>

Releases the reference to a convolution matrix. The object may not be garbage collected until its total reference count is zero.

Parameters
[in]convThe pointer to the convolution matrix to release.
Postcondition
After returning from this function the reference is zeroed.
Returns
A vx_status_e enumeration.
Return values
VX_SUCCESSNo errors; any other value indicates failure.
VX_ERROR_INVALID_REFERENCEconv is not a valid vx_convolution reference.

◆ vxSetConvolutionAttribute()

VX_API_ENTRY vx_status VX_API_CALL vxSetConvolutionAttribute ( vx_convolution conv,
vx_enum attribute,
const void * ptr,
vx_size size )

#include <vx_api.h>

Sets attributes on the convolution object.

Parameters
[in]convThe coordinates object to set.
[in]attributeThe attribute to modify. Use a vx_convolution_attribute_e enumeration.
[in]ptrThe pointer to the value to which to set the attribute.
[in]sizeThe size in bytes of the data pointed to by ptr.
Returns
A vx_status_e enumeration.
Return values
VX_SUCCESSNo errors; any other value indicates failure.
VX_ERROR_INVALID_REFERENCEconv is not a valid vx_convolution reference.