CoreFlow 1.0.0
A modern orchestration and execution runtime
|
The internal Tensor API. More...
Namespaces | |
namespace | coreflow |
The internal representation of a vx_array. | |
Enumerations | |
enum | vx_tensor_attribute_ext_e { VX_TENSOR_STRIDE = VX_ATTRIBUTE_BASE(VX_ID_KHRONOS, VX_TYPE_TENSOR) + 0x4 , VX_TENSOR_TOTAL_SIZE = VX_ATTRIBUTE_BASE(VX_ID_KHRONOS, VX_TYPE_TENSOR) + 0x5 } |
addtitional tensor attributes. More... | |
Functions | |
coreflow::Tensor::Tensor (vx_context context, vx_reference reference) | |
Construct a new Tensor object. | |
coreflow::Tensor::~Tensor () | |
Destroy the Tensor object. | |
static vx_tensor | coreflow::Tensor::createTensor (vx_context context, vx_size number_of_dims, const vx_size *dims, vx_enum data_type, vx_int8 fixed_point_position) |
Create a tensor object. | |
static vx_bool | coreflow::Tensor::isValidTensor (vx_tensor tensor) |
Used to validate the vx_tensor types. | |
void * | coreflow::Tensor::allocateTensorMemory () |
Allocate tensor memory. | |
void | coreflow::Tensor::initTensor (const vx_size *dimensions, vx_size number_of_dimensions, vx_enum data_type, vx_int8 fixed_point_position) |
Used to initialize the tensor data structure with the correct. | |
static vx_int32 | coreflow::Tensor::checkSizes (vx_size *dimensions, const vx_size *view_start, const vx_size *view_end, vx_size number_of_dimensions) |
Check tensor sizes. | |
static vx_size | coreflow::Tensor::computePatchSize (const vx_size *view_start, const vx_size *view_end, vx_size number_of_dimensions) |
Compute patch size. | |
static void | coreflow::Tensor::computePositionsFromIndex (vx_size index, const vx_size *start, const vx_size *end, const vx_size *tensor_stride, const vx_size *patch_stride, vx_size number_of_dimensions, vx_size *tensor_pos, vx_size *patch_pos) |
Compute positions from index. | |
const vx_size * | coreflow::Tensor::dims () const |
Get the dimensions of the tensor. | |
vx_size | coreflow::Tensor::numDims () const |
Get the number of dimensions in the tensor. | |
vx_enum | coreflow::Tensor::dataType () const |
Get the data type of the tensor. | |
vx_int8 | coreflow::Tensor::fixedPointPosition () const |
Get the fixed point position of the tensor. | |
const vx_size * | coreflow::Tensor::strides () const |
Get the strides of the tensor. | |
vx_size | coreflow::Tensor::size () const |
Get the size of the tensor in bytes. | |
vx_status | coreflow::Tensor::copyPatch (vx_size number_of_dimensions, const vx_size *view_start, const vx_size *view_end, const vx_size *user_stride, void *user_ptr, vx_enum usage, vx_enum user_memory_type) |
Copy a patch of the tensor to/from user memory. | |
vx_status | coreflow::Tensor::mapPatch (vx_size number_of_dimensions, const vx_size *view_start, const vx_size *view_end, vx_map_id *map_id, vx_size *stride, void **ptr, vx_enum usage, vx_enum mem_type) |
Map a patch of the tensor to user memory. | |
vx_status | coreflow::Tensor::unmapPatch (vx_map_id map_id) |
Unmap a patch of the tensor. | |
void | coreflow::Tensor::destruct () override final |
Function to destroy tensor obj. | |
The internal Tensor API.
#include <vx_corevx_ext.h>
addtitional tensor attributes.
Enumerator | |
---|---|
VX_TENSOR_STRIDE | tensor strides in each dimension. |
VX_TENSOR_TOTAL_SIZE | tensor total size in bytes. |
void * coreflow::Tensor::allocateTensorMemory | ( | ) |
|
static |
#include <vx_tensor.h>
Check tensor sizes.
dimensions | dimensions |
view_start | view start |
view_end | view end |
number_of_dimensions | number of dimensions |
|
static |
#include <vx_tensor.h>
Compute patch size.
view_start | view start |
view_end | view end |
number_of_dimensions | number of dimensions |
|
static |
#include <vx_tensor.h>
Compute positions from index.
index | index |
start | view start |
end | view end |
tensor_stride | tensor stride |
patch_stride | patch stride |
number_of_dimensions | number of dimensions |
tensor_pos | tensor position |
patch_pos | patch position |
vx_status coreflow::Tensor::copyPatch | ( | vx_size | number_of_dimensions, |
const vx_size * | view_start, | ||
const vx_size * | view_end, | ||
const vx_size * | user_stride, | ||
void * | user_ptr, | ||
vx_enum | usage, | ||
vx_enum | user_memory_type ) |
#include <vx_tensor.h>
Copy a patch of the tensor to/from user memory.
number_of_dimensions | The number of dimensions in the patch |
view_start | The start indices of the patch |
view_end | The end indices of the patch |
user_stride | The stride in user memory |
user_ptr | The pointer to user memory |
usage | The usage of the memory (read/write) |
user_memory_type | The type of user memory (host, opencl, etc.) |
|
static |
#include <vx_tensor.h>
Create a tensor object.
context | The context associated with this obj |
number_of_dims | The number of dimensions of the tensor |
dims | The dimensions of the tensor |
data_type | The data type of the tensor |
fixed_point_position | The fixed point position of the tensor |
vx_enum coreflow::Tensor::dataType | ( | ) | const |
|
finaloverridevirtual |
const vx_size * coreflow::Tensor::dims | ( | ) | const |
#include <vx_tensor.h>
Get the dimensions of the tensor.
vx_int8 coreflow::Tensor::fixedPointPosition | ( | ) | const |
#include <vx_tensor.h>
Get the fixed point position of the tensor.
void coreflow::Tensor::initTensor | ( | const vx_size * | dimensions, |
vx_size | number_of_dimensions, | ||
vx_enum | data_type, | ||
vx_int8 | fixed_point_position ) |
#include <vx_tensor.h>
Used to initialize the tensor data structure with the correct.
[in] | dimensions | arr of dimensions of tensor. |
[in] | number_of_dimensions | number of tensor dimensions. |
[in] | data_type | data type of tensor. |
[in] | fixed_point_position | fixed point position of tensor. |
#include <vx_tensor.h>
Used to validate the vx_tensor types.
[in] | tensor | The vx_tensor to validate. |
vx_status coreflow::Tensor::mapPatch | ( | vx_size | number_of_dimensions, |
const vx_size * | view_start, | ||
const vx_size * | view_end, | ||
vx_map_id * | map_id, | ||
vx_size * | stride, | ||
void ** | ptr, | ||
vx_enum | usage, | ||
vx_enum | mem_type ) |
#include <vx_tensor.h>
Map a patch of the tensor to user memory.
number_of_dimensions | The number of dimensions in the patch |
view_start | The start indices of the patch |
view_end | The end indices of the patch |
map_id | The map ID for the patch |
stride | The stride in the patch |
ptr | The pointer to the mapped memory |
usage | The usage of the memory (read/write) |
mem_type | The type of memory (host, device, etc.) |
vx_size coreflow::Tensor::numDims | ( | ) | const |
#include <vx_tensor.h>
Get the number of dimensions in the tensor.
vx_size coreflow::Tensor::size | ( | ) | const |
#include <vx_tensor.h>
Get the size of the tensor in bytes.
const vx_size * coreflow::Tensor::strides | ( | ) | const |
#include <vx_tensor.h>
Get the strides of the tensor.
coreflow::Tensor::Tensor | ( | vx_context | context, |
vx_reference | reference ) |
#include <vx_tensor.h>
Construct a new Tensor object.
context | The context associated with this obj |
reference | The parent ref of this obj |
#include <vx_tensor.h>
Unmap a patch of the tensor.
map_id | The map ID for the patch |
coreflow::Tensor::~Tensor | ( | ) |
#include <vx_tensor.h>
Destroy the Tensor object.