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

The Public Scalar API. More...

Enumerations

enum  vx_scalar_attribute_e { VX_SCALAR_TYPE = VX_ATTRIBUTE_BASE(VX_ID_KHRONOS, VX_TYPE_SCALAR) + 0x0 }
 The scalar attributes list. More...
 
enum  vx_scalar_operation_e {
  VX_SCALAR_OP_AND = VX_ENUM_BASE(VX_ID_KHRONOS, VX_ENUM_SCALAR_OPERATION) + 0x0 ,
  VX_SCALAR_OP_OR = VX_ENUM_BASE(VX_ID_KHRONOS, VX_ENUM_SCALAR_OPERATION) + 0x1 ,
  VX_SCALAR_OP_XOR = VX_ENUM_BASE(VX_ID_KHRONOS, VX_ENUM_SCALAR_OPERATION) + 0x2 ,
  VX_SCALAR_OP_NAND = VX_ENUM_BASE(VX_ID_KHRONOS, VX_ENUM_SCALAR_OPERATION) + 0x3 ,
  VX_SCALAR_OP_EQUAL = VX_ENUM_BASE(VX_ID_KHRONOS, VX_ENUM_SCALAR_OPERATION) + 0x4 ,
  VX_SCALAR_OP_NOTEQUAL = VX_ENUM_BASE(VX_ID_KHRONOS, VX_ENUM_SCALAR_OPERATION) + 0x5 ,
  VX_SCALAR_OP_LESS = VX_ENUM_BASE(VX_ID_KHRONOS, VX_ENUM_SCALAR_OPERATION) + 0x6 ,
  VX_SCALAR_OP_LESSEQ = VX_ENUM_BASE(VX_ID_KHRONOS, VX_ENUM_SCALAR_OPERATION) + 0x7 ,
  VX_SCALAR_OP_GREATER = VX_ENUM_BASE(VX_ID_KHRONOS, VX_ENUM_SCALAR_OPERATION) + 0x8 ,
  VX_SCALAR_OP_GREATEREQ = VX_ENUM_BASE(VX_ID_KHRONOS, VX_ENUM_SCALAR_OPERATION) + 0x9 ,
  VX_SCALAR_OP_ADD = VX_ENUM_BASE(VX_ID_KHRONOS, VX_ENUM_SCALAR_OPERATION) + 0xA ,
  VX_SCALAR_OP_SUBTRACT = VX_ENUM_BASE(VX_ID_KHRONOS, VX_ENUM_SCALAR_OPERATION) + 0xB ,
  VX_SCALAR_OP_MULTIPLY = VX_ENUM_BASE(VX_ID_KHRONOS, VX_ENUM_SCALAR_OPERATION) + 0xC ,
  VX_SCALAR_OP_DIVIDE = VX_ENUM_BASE(VX_ID_KHRONOS, VX_ENUM_SCALAR_OPERATION) + 0xD ,
  VX_SCALAR_OP_MODULUS = VX_ENUM_BASE(VX_ID_KHRONOS, VX_ENUM_SCALAR_OPERATION) + 0xE ,
  VX_SCALAR_OP_MIN = VX_ENUM_BASE(VX_ID_KHRONOS, VX_ENUM_SCALAR_OPERATION) + 0xF ,
  VX_SCALAR_OP_MAX = VX_ENUM_BASE(VX_ID_KHRONOS, VX_ENUM_SCALAR_OPERATION) + 0x10
}
 A type of operation in which both operands are scalars. More...
 

Functions

VX_API_ENTRY vx_scalar VX_API_CALL vxCreateScalar (vx_context context, vx_enum data_type, const void *ptr)
 Creates a reference to a scalar object. Also see ref sub_node_parameters.
 
VX_API_ENTRY vx_scalar VX_API_CALL vxCreateScalarWithSize (vx_context context, vx_enum data_type, const void *ptr, vx_size size)
 Creates a reference to a scalar object. Also see ref sub_node_parameters.
 
VX_API_ENTRY vx_scalar VX_API_CALL vxCreateVirtualScalar (vx_graph graph, vx_enum data_type)
 Creates an opaque reference to a scalar object with no direct user access.
 
VX_API_ENTRY vx_status VX_API_CALL vxReleaseScalar (vx_scalar *scalar)
 Releases a reference to a scalar object. The object may not be garbage collected until its total reference count is zero.
 
VX_API_ENTRY vx_status VX_API_CALL vxQueryScalar (vx_scalar scalar, vx_enum attribute, void *ptr, vx_size size)
 Queries attributes from a scalar.
 
VX_API_ENTRY vx_status VX_API_CALL vxCopyScalar (vx_scalar scalar, void *user_ptr, vx_enum usage, vx_enum user_mem_type)
 Allows the application to copy from/into a scalar object.
 
VX_API_ENTRY vx_status VX_API_CALL vxCopyScalarWithSize (vx_scalar scalar, vx_size size, void *user_ptr, vx_enum usage, vx_enum user_mem_type)
 Allows the application to copy from/into a scalar object with size.
 

Detailed Description

The Public Scalar API.

Enumeration Type Documentation

◆ vx_scalar_attribute_e

#include <vx_types.h>

The scalar attributes list.

Enumerator
VX_SCALAR_TYPE 

Queries the type of atomic that is contained in the scalar. Read-only. Use a vx_enum parameter.

◆ vx_scalar_operation_e

#include <vx_types.h>

A type of operation in which both operands are scalars.

See also
User Facing Scalar API
Enumerator
VX_SCALAR_OP_AND 

logical and.

VX_SCALAR_OP_OR 

logical or.

VX_SCALAR_OP_XOR 

logical exclusive or.

VX_SCALAR_OP_NAND 

logical nand.

VX_SCALAR_OP_EQUAL 

comparison (equal).

VX_SCALAR_OP_NOTEQUAL 

comparison (not equal).

VX_SCALAR_OP_LESS 

comparison (less than).

VX_SCALAR_OP_LESSEQ 

comparison (less than or equal to).

VX_SCALAR_OP_GREATER 

comparison (greater than).

VX_SCALAR_OP_GREATEREQ 

comparison (greater than or equal to).

VX_SCALAR_OP_ADD 

arithmetic addition.

VX_SCALAR_OP_SUBTRACT 

arithmetic subtraction.

VX_SCALAR_OP_MULTIPLY 

arithmetic multiplication.

VX_SCALAR_OP_DIVIDE 

arithmetic division.

VX_SCALAR_OP_MODULUS 

arithmetic (modulo operator).

VX_SCALAR_OP_MIN 

minimum of two scalars.

VX_SCALAR_OP_MAX 

maximum of two scalars.

Function Documentation

◆ vxCopyScalar()

VX_API_ENTRY vx_status VX_API_CALL vxCopyScalar ( vx_scalar scalar,
void * user_ptr,
vx_enum usage,
vx_enum user_mem_type )

#include <vx_api.h>

Allows the application to copy from/into a scalar object.

Parameters
[in]scalarThe reference to the scalar object that is the source or the destination of the copy.
[in]user_ptrThe address of the memory location where to store the requested data if the copy was requested in read mode, or from where to get the data to store into the scalar object if the copy was requested in write mode. In the user memory, the scalar is a variable of the type corresponding to VX_SCALAR_TYPE. The accessible memory must be large enough to contain this variable.
[in]usageThis declares the effect of the copy with regard to the scalar 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 scalar object into the user memory.
  • VX_WRITE_ONLY means that data are copied into the scalar 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_REFERENCEscalar is not a valid vx_scalar reference.
VX_ERROR_INVALID_PARAMETERSAn other parameter is incorrect.

◆ vxCopyScalarWithSize()

VX_API_ENTRY vx_status VX_API_CALL vxCopyScalarWithSize ( vx_scalar scalar,
vx_size size,
void * user_ptr,
vx_enum usage,
vx_enum user_mem_type )

#include <vx_api.h>

Allows the application to copy from/into a scalar object with size.

Parameters
[in]scalarThe reference to the scalar object that is the source or the destination of the copy.
[in]sizeThe size in bytes of the container to which user_ptr points.
[in]user_ptrThe address of the memory location where to store the requested data if the copy was requested in read mode, or from where to get the data to store into the scalar object if the copy was requested in write mode. In the user memory, the scalar is a variable of the type corresponding to VX_SCALAR_TYPE. The accessible memory must be large enough to contain this variable.
[in]usageThis declares the effect of the copy with regard to the scalar 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 scalar object into the user memory.
  • VX_WRITE_ONLY means that data are copied into the scalar 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_ERROR_INVALID_REFERENCEThe scalar reference is not actually a scalar reference.
VX_ERROR_INVALID_PARAMETERSAn other parameter is incorrect.

◆ vxCreateScalar()

VX_API_ENTRY vx_scalar VX_API_CALL vxCreateScalar ( vx_context context,
vx_enum data_type,
const void * ptr )

#include <vx_api.h>

Creates a reference to a scalar object. Also see ref sub_node_parameters.

Parameters
[in]contextThe reference to the system context.
[in]data_typeThe type of data to hold. Must be greater than VX_TYPE_INVALID and less than or equal to VX_TYPE_VENDOR_STRUCT_END. Or must be a vx_enum returned from vxRegisterUserStruct.
[in]ptrThe pointer to the initial value of the scalar or NULL. If NULL, the initial value of the scalar, if any, is implementation dependent.
Returns
A scalar reference vx_scalar. Any possible errors preventing a successful creation should be checked using vxGetStatus.
Examples
optical_flow.cpp.

◆ vxCreateScalarWithSize()

VX_API_ENTRY vx_scalar VX_API_CALL vxCreateScalarWithSize ( vx_context context,
vx_enum data_type,
const void * ptr,
vx_size size )

#include <vx_api.h>

Creates a reference to a scalar object. Also see ref sub_node_parameters.

Parameters
[in]contextThe reference to the system context.
[in]data_typeThe type of data to hold. Must be greater than VX_TYPE_INVALID and less than or equal to VX_TYPE_VENDOR_STRUCT_END. Or must be a vx_enum returned from vxRegisterUserStruct.
[in]ptrThe pointer to the initial value of the scalar.
[in]sizeSize of data at ptr in bytes.
Returns
A scalar reference vx_scalar. Any possible errors preventing a successful creation should be checked using vxGetStatus.

◆ vxCreateVirtualScalar()

VX_API_ENTRY vx_scalar VX_API_CALL vxCreateVirtualScalar ( vx_graph graph,
vx_enum data_type )

#include <vx_api.h>

Creates an opaque reference to a scalar object with no direct user access.

Parameters
[in]graphThe reference to the parent graph.
[in]data_typeThe type of data to hold. Must be greater than VX_TYPE_INVALID and less than or equal to VX_TYPE_VENDOR_STRUCT_END. Or must be a vx_enum returned from vxRegisterUserStruct.
See also
vxCreateScalar
Returns
A scalar reference vx_scalar. Any possible errors preventing a successful creation should be checked using vxGetStatus.

◆ vxQueryScalar()

VX_API_ENTRY vx_status VX_API_CALL vxQueryScalar ( vx_scalar scalar,
vx_enum attribute,
void * ptr,
vx_size size )

#include <vx_api.h>

Queries attributes from a scalar.

Parameters
[in]scalarThe scalar object.
[in]attributeThe enumeration to query. Use a vx_scalar_attribute_e enumeration.
[out]ptrThe location at which to store the resulting value.
[in]sizeThe size 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_REFERENCEscalar is not a valid vx_scalar reference.

◆ vxReleaseScalar()

VX_API_ENTRY vx_status VX_API_CALL vxReleaseScalar ( vx_scalar * scalar)

#include <vx_api.h>

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

Parameters
[in]scalarThe pointer to the scalar 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_REFERENCEscalar is not a valid vx_scalar reference.
Examples
optical_flow.cpp.