JeVois  1.20
JeVois Smart Embedded Machine Vision Toolkit
Share this page:
NetworkNPU.C File Reference
#include <jevois/DNN/NetworkNPU.H>
#include <jevois/Util/Utils.H>
#include <jevois/DNN/Utils.H>
#include <vsi_nn_version.h>
Include dependency graph for NetworkNPU.C:

Go to the source code of this file.

Macros

#define VNN_APP_DEBUG   (FALSE)
 
#define NEW_VXNODE(_node, _type, _in, _out, _uid)
 
#define NEW_VIRTUAL_TENSOR(_id, _attr, _dtype)
 
#define NEW_CONST_TENSOR(_id, _attr, _dtype, _ofst, _size)
 
#define NEW_NORM_TENSOR(_id, _attr, _dtype)
 
#define NEW_NORM_TENSOR_FROM_HANDLE(_id, _attr, _dtype)
 

Macro Definition Documentation

◆ NEW_CONST_TENSOR

#define NEW_CONST_TENSOR (   _id,
  _attr,
  _dtype,
  _ofst,
  _size 
)
Value:
do { \
data = load_data(fp, _ofst, _size); \
_attr.vtl = FALSE; \
_attr.is_const = TRUE; \
_attr.dtype.vx_type = _dtype; \
_id = vsi_nn_AddTensor(itsGraph, VSI_NN_TENSOR_ID_AUTO, & _attr, data); \
free(data); \
if (VSI_NN_TENSOR_ID_NA == _id) LFATAL("NEW_CONST_TENSOR failed"); \
} while(0)

Definition at line 48 of file NetworkNPU.C.

◆ NEW_NORM_TENSOR

#define NEW_NORM_TENSOR (   _id,
  _attr,
  _dtype 
)
Value:
do { \
_attr.vtl = FALSE; \
_attr.is_const = FALSE; \
_attr.dtype.vx_type = _dtype; \
_id = vsi_nn_AddTensor(itsGraph, VSI_NN_TENSOR_ID_AUTO, & _attr, NULL); \
if (VSI_NN_TENSOR_ID_NA == _id) LFATAL("NEW_NORM_TENSOR failed"); \
} while(0)

Definition at line 59 of file NetworkNPU.C.

◆ NEW_NORM_TENSOR_FROM_HANDLE

#define NEW_NORM_TENSOR_FROM_HANDLE (   _id,
  _attr,
  _dtype 
)
Value:
do { \
_attr.vtl = FALSE; \
_attr.is_const = FALSE; \
_attr.dtype.vx_type = _dtype; \
_id = vsi_nn_AddTensorFromHandle(itsGraph, VSI_NN_TENSOR_ID_AUTO, & _attr, NULL); \
if (VSI_NN_TENSOR_ID_NA == _id) LFATAL("NEW_NORM_TENSOR_FROM_HANDLE failed"); \
} while(0)

Definition at line 68 of file NetworkNPU.C.

◆ NEW_VIRTUAL_TENSOR

#define NEW_VIRTUAL_TENSOR (   _id,
  _attr,
  _dtype 
)
Value:
do { \
memset(_attr.size, 0, VSI_NN_MAX_DIM_NUM * sizeof(vsi_size_t)); \
_attr.dim_num = VSI_NN_DIM_AUTO; \
_attr.vtl = !VNN_APP_DEBUG; \
_attr.is_const = FALSE; \
_attr.dtype.vx_type = _dtype; \
_id = vsi_nn_AddTensor(itsGraph, VSI_NN_TENSOR_ID_AUTO, & _attr, NULL); \
if (VSI_NN_TENSOR_ID_NA == _id) LFATAL("NEW_VIRTUAL_TENSOR failed"); \
} while(0)

Definition at line 37 of file NetworkNPU.C.

◆ NEW_VXNODE

#define NEW_VXNODE (   _node,
  _type,
  _in,
  _out,
  _uid 
)
Value:
do { \
_node = vsi_nn_AddNode(itsGraph, _type, _in, _out, NULL); \
_node->uid = (uint32_t)_uid; \
if (NULL == _node) LFATAL("NEW_VXNODE failed"); \
} while(0)

Definition at line 31 of file NetworkNPU.C.

◆ VNN_APP_DEBUG

#define VNN_APP_DEBUG   (FALSE)

Definition at line 25 of file NetworkNPU.C.

LFATAL
#define LFATAL(msg)
Convenience macro for users to print out console or syslog messages, FATAL level.
VNN_APP_DEBUG
#define VNN_APP_DEBUG
Definition: NetworkNPU.C:25