Skip to content

dnn

Dnn (deep neural network) module.
More...


Modules

  binary
  decomposer
  device
  param
  prof
  tensor

Data Structures

struct   morapi_DnnForwardArg
struct   morapi_DnnForward
struct   morapi_DnnRoutineCB
struct   morapi_DnnRoutine
struct   morapi_DnnLayerCB
struct   morapi_DnnLayer
struct   morapi_DnnNet
struct   morapi_Dnn

Macros

#define  MORAPI_INSTALL_DNN_ROUTINE(ENV, LAYER, ROUTINE, CB)
#define  MORAPI_INSTALL_DNN_LAYER(ENV, LAYER, CB)

Enumerations

enum   morapi_DnnReduce
enum   morapi_DnnResizeMode { MORAPI_DNN_RESIZE_MODE_BILINEAR, MORAPI_DNN_RESIZE_MODE_NEAREST }
enum   morapi_DnnRoundMode
enum   morapi_DnnChannel { MORAPI_DNN_CHANNEL_NONE, MORAPI_DNN_CHANNEL_FIRST, MORAPI_DNN_CHANNEL_LAST }
enum   morapi_DnnRoutineLimit { MORAPI_DNN_ROUTINE_LIMIT_NONE, MORAPI_DNN_ROUTINE_LIMIT_TO_PARENT_SCHEMA, MORAPI_DNN_ROUTINE_LIMIT_TO_SCHEMA, MORAPI_DNN_ROUTINE_LIMIT_TO_SPECIFIED }
enum   morapi_DnnLayerState {
  MORAPI_DNN_LAYER_STATE_NONE, MORAPI_DNN_LAYER_STATE_INITIALIZED, MORAPI_DNN_LAYER_STATE_PARSED, MORAPI_DNN_LAYER_STATE_ROUTINIZED,
  MORAPI_DNN_LAYER_STATE_DEPLOYED, MORAPI_DNN_LAYER_STATE_PRECOMPILED, MORAPI_DNN_LAYER_STATE_COMPILED
}
enum   morapi_DnnState { MORAPI_DNN_STATE_NONE, MORAPI_DNN_STATE_INITIALIZED, MORAPI_DNN_STATE_PARSED, MORAPI_DNN_STATE_COMPILED }

Functions

morapi_Result  morapi_Dnn_static_calcTopNIndices (morapi_Int32 *o_indices, morapi_Int32 i_num_indices, morapi_Float32 *i_scores, morapi_Int32 i_num_scores)
const morapi_Char morapi_Dnn_static_getVersion (void)
const morapi_Char morapi_Dnn_static_getDir (morapi_Env *env)
morapi_Int32  morapi_Dnn_static_getPluginNum (morapi_Env *env)
const morapi_Char **  morapi_Dnn_static_getPluginNames (morapi_Env *env)
const morapi_Char morapi_Dnn_static_getPluginDescription (morapi_Env *env, const morapi_Char *i_plugin_name)


Detailed Description

Dnn (deep neural network) module.

The fast, small, easy, portable and secure NN inference engine.


Macro Definition Documentation


MORAPI_INSTALL_DNN_ROUTINE

#define MORAPI_INSTALL_DNN_ROUTINE( ENV,
                                    LAYER,
                                    ROUTINE,
                                    CB)

Installs callback functions for a dnn routine.

Parameters

  • ENV : environment.
  • LAYER : layer type for the routine ("conv2", "add", "madd", ...).
  • ROUTINE : routine descriptor ("cpu", "cpu:qint8", "cpu/avx", ...).
  • CB : structure for callback functions (DnnRoutineConv2Cpu, DnnRoutineAddCpuQint8, DnnRoutineMaddCpuAvx, ...).


MORAPI_INSTALL_DNN_LAYER

#define MORAPI_INSTALL_DNN_LAYER( ENV,
                                  LAYER,
                                  CB)

Installs callback functions for a dnn layer.

Parameters

  • ENV : environment.
  • LAYER : layer type ("conv2", "add", "madd", ...).
  • CB : structure for callback functions (DnnLayerConv2, DnnLayerAdd, DnnLayerMadd, ...).

Enumeration Type Documentation


morapi_DnnReduce

enum morapi_DnnReduce

Reduce mode.


morapi_DnnResizeMode

enum morapi_DnnResizeMode

Resize mode.

Enumerator
MORAPI_DNN_RESIZE_MODE_BILINEAR 

bilinear.

MORAPI_DNN_RESIZE_MODE_NEAREST 

nearest.


morapi_DnnRoundMode

enum morapi_DnnRoundMode

Round mode.


morapi_DnnChannel

enum morapi_DnnChannel

Enumeration of channel-positions.

Enumerator
MORAPI_DNN_CHANNEL_NONE 

No channel.

MORAPI_DNN_CHANNEL_FIRST 

Channel-first.

MORAPI_DNN_CHANNEL_LAST 

Channel-last.


morapi_DnnRoutineLimit

enum morapi_DnnRoutineLimit

Limitation for routine selection.

Enumerator
MORAPI_DNN_ROUTINE_LIMIT_NONE 

None.

MORAPI_DNN_ROUTINE_LIMIT_TO_PARENT_SCHEMA 

Limit to parent schema.

MORAPI_DNN_ROUTINE_LIMIT_TO_SCHEMA 

Limit to schema.

MORAPI_DNN_ROUTINE_LIMIT_TO_SPECIFIED 

Limit to specified descriptor.


morapi_DnnLayerState

enum morapi_DnnLayerState

State of dnn layer.

Enumerator
MORAPI_DNN_LAYER_STATE_NONE 

None.

MORAPI_DNN_LAYER_STATE_INITIALIZED 

Initialized.

MORAPI_DNN_LAYER_STATE_PARSED 

Parsed.

MORAPI_DNN_LAYER_STATE_ROUTINIZED 

Routinized.

MORAPI_DNN_LAYER_STATE_DEPLOYED 

Deployed.

MORAPI_DNN_LAYER_STATE_PRECOMPILED 

Precompiled.

MORAPI_DNN_LAYER_STATE_COMPILED 

Compiled.


morapi_DnnState

enum morapi_DnnState

State of dnn.

See also

morapi_Dnn_initialize(), morapi_Dnn_parse(), morapi_Dnn_compile(), morapi_Dnn_recycle()

image

Enumerator
MORAPI_DNN_STATE_NONE 

None.

MORAPI_DNN_STATE_INITIALIZED 

Initialized.

MORAPI_DNN_STATE_PARSED 

Parsed.

MORAPI_DNN_STATE_COMPILED 

Compiled.


Function Documentation


morapi_Dnn_static_calcTopNIndices()

morapi_Result morapi_Dnn_static_calcTopNIndices (morapi_Int32 * o_indices,
                                                 morapi_Int32 i_num_indices,
                                                 morapi_Float32 * i_scores,
                                                 morapi_Int32 i_num_scores)

Calculates top-N indices.

Parameters

  • o_indices : output indices
  • i_num_indices : N count
  • i_scores : input scores
  • i_num_scores : input score count


morapi_Dnn_static_getVersion()

const morapi_Char* morapi_Dnn_static_getVersion (void )

Gets the module version.


test_dnn_api.c.


morapi_Dnn_static_getDir()

const morapi_Char* morapi_Dnn_static_getDir (morapi_Env * env)

Gets the dnn directory.

Parameters

  • env : environment


morapi_Dnn_static_getPluginNum()

morapi_Int32 morapi_Dnn_static_getPluginNum (morapi_Env * env)

Gets the number of plugins.

Parameters

  • env : environment


morapi_Dnn_static_getPluginNames()

const morapi_Char** morapi_Dnn_static_getPluginNames (morapi_Env * env)

Gets plugin names.

Parameters

  • env : environment


morapi_Dnn_static_getPluginDescription()

const morapi_Char* morapi_Dnn_static_getPluginDescription (morapi_Env * env,
                                                           const morapi_Char * i_plugin_name)

Gets a plugin description.

Parameters

  • env : environment
  • i_plugin_name : plugin name