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

The Internal Scalar API. More...

Namespaces

namespace  coreflow
 The internal representation of a vx_array.
 

Functions

 coreflow::Scalar::Scalar (vx_context context, vx_reference scope)
 Construct a new Scalar object.
 
 coreflow::Scalar::~Scalar ()
 Destroy the Scalar object.
 
static vx_scalar coreflow::Scalar::createScalar (vx_context context, vx_enum data_type, const void *ptr)
 Create a scalar object.
 
void * coreflow::Scalar::allocateScalarMemory (vx_size size)
 Allocate memory for scalar obj.
 
static vx_status coreflow::Scalar::scalarToHostMem (vx_scalar scalar, void *user_ptr)
 Get host memory from scalar obj.
 
static vx_status coreflow::Scalar::hostMemToScalar (vx_scalar scalar, void *user_ptr)
 Get scalar from host memory.
 
vx_status coreflow::Scalar::copy (void *user_ptr, vx_enum usage, vx_enum user_mem_type)
 Copy scalar value to/from user memory.
 
vx_status coreflow::Scalar::copy (vx_size size, void *user_ptr, vx_enum usage, vx_enum user_mem_type)
 Copy scalar value, given size, to/from user memory.
 
vx_status coreflow::Scalar::readValue (void *ptr)
 Read the scalar value.
 
vx_status coreflow::Scalar::writeValue (const void *ptr)
 Write the scalar value.
 
vx_enum coreflow::Scalar::dataType () const
 Get the data type of the scalar.
 
static void coreflow::Scalar::printScalarValue (vx_scalar scalar)
 Print scalar object.
 
void coreflow::Scalar::destruct () override final
 Function to destroy scalar obj.
 

Detailed Description

The Internal Scalar API.

Function Documentation

◆ allocateScalarMemory()

void * coreflow::Scalar::allocateScalarMemory ( vx_size size)

#include <vx_scalar.h>

Allocate memory for scalar obj.

Parameters
sizesize of bytes to alloc
Returns
void* pointer to allocated memory

◆ copy() [1/2]

vx_status coreflow::Scalar::copy ( void * user_ptr,
vx_enum usage,
vx_enum user_mem_type )

#include <vx_scalar.h>

Copy scalar value to/from user memory.

Parameters
user_ptrpointer to user memory
usageusage of the memory (read/write)
user_mem_typetype of memory (host, opencl, etc.)
Returns
vx_status VX_SUCCESS on success

◆ copy() [2/2]

vx_status coreflow::Scalar::copy ( vx_size size,
void * user_ptr,
vx_enum usage,
vx_enum user_mem_type )

#include <vx_scalar.h>

Copy scalar value, given size, to/from user memory.

Parameters
sizesize of the scalar data
user_ptrpointer to user memory
usageusage of the memory (read/write)
user_mem_typetype of memory (host, opencl, etc.)
Returns
vx_status VX_SUCCESS on success

◆ createScalar()

static vx_scalar coreflow::Scalar::createScalar ( vx_context context,
vx_enum data_type,
const void * ptr )
static

#include <vx_scalar.h>

Create a scalar object.

Parameters
contextThe context associated with this obj
data_typeThe data type of the scalar
ptrThe pointer to the scalar value
Returns
vx_scalar The scalar object

◆ dataType()

vx_enum coreflow::Scalar::dataType ( ) const

#include <vx_scalar.h>

Get the data type of the scalar.

Returns
vx_enum The data type of the scalar

◆ destruct()

void coreflow::Scalar::destruct ( )
finaloverridevirtual

#include <vx_scalar.h>

Function to destroy scalar obj.

Reimplemented from coreflow::Reference.

◆ hostMemToScalar()

static vx_status coreflow::Scalar::hostMemToScalar ( vx_scalar scalar,
void * user_ptr )
static

#include <vx_scalar.h>

Get scalar from host memory.

Parameters
scalarscalar obj
user_ptrpointer to user memory
Returns
vx_status VX_SUCCESS on success

◆ printScalarValue()

static void coreflow::Scalar::printScalarValue ( vx_scalar scalar)
static

#include <vx_scalar.h>

Print scalar object.

Parameters
scalarscalar obj

◆ readValue()

vx_status coreflow::Scalar::readValue ( void * ptr)

#include <vx_scalar.h>

Read the scalar value.

Parameters
ptrPointer to the memory location to read the value into
Returns
vx_status VX_SUCCESS on success, error code otherwise

◆ Scalar()

coreflow::Scalar::Scalar ( vx_context context,
vx_reference scope )

#include <vx_scalar.h>

Construct a new Scalar object.

Parameters
contextThe context associated with this obj
scopeThe parent ref of this obj

◆ scalarToHostMem()

static vx_status coreflow::Scalar::scalarToHostMem ( vx_scalar scalar,
void * user_ptr )
static

#include <vx_scalar.h>

Get host memory from scalar obj.

Parameters
scalarscalar obj
user_ptrpointer to user memory
Returns
vx_status VX_SUCCESS on success

◆ writeValue()

vx_status coreflow::Scalar::writeValue ( const void * ptr)

#include <vx_scalar.h>

Write the scalar value.

Parameters
ptrPointer to the memory location containing the value to write
Returns
vx_status VX_SUCCESS on success, error code otherwise

◆ ~Scalar()

coreflow::Scalar::~Scalar ( )

#include <vx_scalar.h>

Destroy the Scalar object.