JeVois  1.22
JeVois Smart Embedded Machine Vision Toolkit
Share this page:
Loading...
Searching...
No Matches
NetworkNPU.C File Reference
#include <jevois/DNN/NetworkNPU.H>
#include <jevois/Util/Utils.H>
#include <jevois/DNN/Utils.H>
#include <jevois/Core/DynamicLoader.H>
#include <jevois/Debug/Timer.H>
#include <vsi_nn_version.h>
#include <filesystem>
Include dependency graph for NetworkNPU.C:

Go to the source code of this file.

Classes

struct  vsi_nn_preprocess_map_element_t
 
struct  vsi_nn_postprocess_map_element_t
 

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)
 

Typedefs

typedef uint32_t vsi_size_t
 
typedef int32_t vsi_ssize_t
 

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)
#define LFATAL(msg)
Convenience macro for users to print out console or syslog messages, FATAL level.
Definition Log.H:230

Definition at line 51 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 62 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 71 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)
#define VNN_APP_DEBUG
Definition NetworkNPU.C:28
uint32_t vsi_size_t
Definition NetworkNPU.C:94

Definition at line 40 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 34 of file NetworkNPU.C.

◆ VNN_APP_DEBUG

#define VNN_APP_DEBUG   (FALSE)

Definition at line 28 of file NetworkNPU.C.

Typedef Documentation

◆ vsi_size_t

typedef uint32_t vsi_size_t

Definition at line 94 of file NetworkNPU.C.

◆ vsi_ssize_t

typedef int32_t vsi_ssize_t

Definition at line 95 of file NetworkNPU.C.