SHL 2.2.x
Loading...
Searching...
No Matches

Functions

struct csinn_session__attribute__ ((weak))
 Import binary model. More...
 
struct csinn_sessioncsinn_alloc_session ()
 Allocate a session. More...
 
void csinn_free_session (struct csinn_session *sess)
 Release a session. More...
 
void csinn_session_init (struct csinn_session *sess)
 Initialize session. More...
 
void csinn_session_deinit (struct csinn_session *sess)
 Uninitialize session. More...
 
int csinn_session_setup (struct csinn_session *sess)
 Setup function. More...
 
int csinn_session_run (struct csinn_session *sess)
 Run function. More...
 
int csinn_load_binary_model (struct csinn_session *sess)
 Load binary model. More...
 

Detailed Description

Function Documentation

◆ __attribute__()

struct csinn_session * __attribute__ ( (weak)  )

Import binary model.

Returns
Load the completed session structure when successful.

For the interface of hhb model, it is a further encapsulation of csinn_load_binary_model, defined as a weak function, and can be covered by a user-defined function with the same name.

◆ csinn_alloc_session()

struct csinn_session * csinn_alloc_session ( )

Allocate a session.

Returns
Point to the newly allocated session csinn_session*

This interface only allocates memory space. Initialization is performed by csinn_session_init complete. Each session refers to an instance of a model.

◆ csinn_free_session()

void csinn_free_session ( struct csinn_session session)

Release a session.

Parameters
[in]sessionThe session to be released

◆ csinn_session_init()

void csinn_session_init ( struct csinn_session session)

Initialize session.

Parameters
[in,out]sessionThe session to be initialized

Board specific initialization can be done in the interface, such as calling some initialization function interfaces of NPU.

◆ csinn_session_deinit()

void csinn_session_deinit ( struct csinn_session session)

Uninitialize session.

Parameters
[in,out]sessionThe session to be uninitialized

◆ csinn_session_setup()

int csinn_session_setup ( struct csinn_session session)

Setup function.

Parameters
[in]sessionThe session to be processed
Returns
The return value is greater than 0 on success

Build the interface of the graph when executing according to the graph. For example, you can call the compilation interface in the NPU driver here.

◆ csinn_session_run()

int csinn_session_run ( struct csinn_session session)

Run function.

Parameters
[in]sessionThe session to be executed
Returns
The return value is greater than 0 on success

When executing according to the graph, actually implement the interface of the graph.

◆ csinn_load_binary_model()

int csinn_load_binary_model ( struct csinn_session session)

Load binary model.

Parameters
[in]sessionThe session to be executed
Returns
The return value is greater than 0 on success

There is no need to call csinn_session_setup when model binary execution is adopted.