clDNN
Network Execution
Collaboration diagram for Network Execution:

Classes

struct  cldnn_profiling_interval
 Profiling information for an executed network primitive. More...
 
struct  cldnn_tuning_config
 Tuning config. More...
 
struct  cldnn_build_option
 Represents network build option. More...
 
struct  cldnn_network_output
 Output information for executed cldnn_network. More...
 

Typedefs

typedef struct cldnn_event_impl * cldnn_event
 Event object.
 
typedef struct cldnn_network_impl * cldnn_network
 Executable network allocated from cldnn_program.
 
typedef void(* cldnn_event_handler) (void *)
 user-defined event handler callback.
 

Enumerations

enum  cldnn_build_option_type {
  cldnn_build_option_fusing, cldnn_build_option_optimize_data, cldnn_build_option_debug, cldnn_build_option_outputs,
  cldnn_build_option_tuning_config, cldnn_build_option_graph_dumps_dir
}
 Network build option types. More...
 
enum  cldnn_tuning_mode_type { cldnn_tuning_disabled, cldnn_tuning_use_cache, cldnn_tuning_tune_and_cache }
 Tuning modes. More...
 

Functions

CLDNN_API cldnn_event cldnn_create_user_event (cldnn_engine engine, cldnn_status *status)
 Creates an event which can be set by user.
 
CLDNN_API int32_t cldnn_is_user_event (cldnn_event event, cldnn_status *status)
 Checks if an event was created by user.
 
CLDNN_API void cldnn_retain_event (cldnn_event event, cldnn_status *status)
 Increment reference counter for the event object.
 
CLDNN_API void cldnn_release_event (cldnn_event event, cldnn_status *status)
 Decrement reference counter for the event object. Deletes object when counter becomes zero.
 
CLDNN_API void cldnn_wait_for_event (cldnn_event event, cldnn_status *status)
 Waits for event completion or error.
 
CLDNN_API void cldnn_set_event (cldnn_event event, cldnn_status *status)
 Set event status to completed.
 
CLDNN_API void cldnn_add_event_handler (cldnn_event event, cldnn_event_handler handler, void *param, cldnn_status *status)
 Register call back to be called on event completion. More...
 
CLDNN_API void cldnn_get_event_profiling_info (cldnn_event event, cldnn_profiling_interval *profiling, size_t size, size_t *size_ret, cldnn_status *status)
 Returns the profiling information for an network primitive associated with event. More...
 
CLDNN_API cldnn_network cldnn_build_network (cldnn_engine engine, cldnn_topology topology, cldnn_build_option *options, size_t options_num, cldnn_status *status)
 Builds and allocates executable network based on user-defined topology by specified engine. This is a shorthand for cldnn_build_program and cldnn_allocate_network. More...
 
CLDNN_API cldnn_network cldnn_allocate_network (cldnn_program program, cldnn_status *status)
 Allocates memory for a new network which will be able to execute specified program. More...
 
CLDNN_API void cldnn_retain_network (cldnn_network network, cldnn_status *status)
 Increment reference counter for the network object.
 
CLDNN_API void cldnn_release_network (cldnn_network network, cldnn_status *status)
 Decrement reference counter for the network object. Deletes object when counter becomes zero.
 
CLDNN_API void cldnn_set_network_input (cldnn_network network, cldnn_primitive_id id, cldnn_memory mem, cldnn_status *status)
 Provides user input data to the network (for input_layout primitives). More...
 
CLDNN_API void cldnn_get_primitive_info (cldnn_network network, cldnn_primitive_id id, char *info, size_t size, size_t *size_ret, cldnn_status *status)
 Returns information about particular primitive. More...
 
CLDNN_API cldnn_engine cldnn_get_network_engine (cldnn_network network, cldnn_status *status)
 Returns engine associated with the network.
 
CLDNN_API cldnn_program cldnn_get_network_program (cldnn_network network, cldnn_status *status)
 Returns program associated with the network.
 
CLDNN_API void cldnn_get_network_output_names (cldnn_network network, char *names, size_t size, size_t *size_ret, cldnn_status *status)
 Returns names of network outputs. More...
 
CLDNN_API void cldnn_get_network_executed_primitive_names (cldnn_network network, char *names, size_t size, size_t *size_ret, cldnn_status *status)
 Returns names of executed primitives. More...
 
CLDNN_API void cldnn_get_network_all_primitive_names (cldnn_network network, char *names, size_t size, size_t *size_ret, cldnn_status *status)
 Returns names of all primitives in network. More...
 
CLDNN_API void cldnn_get_network_all_primitive_org_names (cldnn_network network, char *names, size_t size, size_t *size_ret, cldnn_status *status)
 Returns names of all primitives in network before graph optimization. More...
 
CLDNN_API void cldnn_execute_network (cldnn_network network, cldnn_event *dependencies, size_t deps_num, cldnn_status *status)
 Executes network. More...
 
CLDNN_API cldnn_network_output cldnn_get_network_output (cldnn_network network, const char *name, cldnn_status *status)
 Returns executed network output information. More...
 
CLDNN_API cldnn_memory cldnn_get_network_output_memory (cldnn_network network, const char *name, cldnn_status *status)
 Returns memory corresponding to output with name. More...
 
CLDNN_API cldnn_event cldnn_get_network_output_event (cldnn_network network, const char *name, cldnn_status *status)
 Returns event corresponding to output with name. More...
 

Detailed Description


Class Documentation

◆ cldnn_profiling_interval

struct cldnn_profiling_interval

Profiling information for an executed network primitive.

Every cldnn_event associated with cldnn_network_output. can contain one or more profiling information intervals.

Definition at line 171 of file cldnn.h.

Class Members
const char * name Profiling interval name.
uint64_t nanoseconds

◆ cldnn_tuning_config

struct cldnn_tuning_config

Tuning config.

Definition at line 197 of file cldnn.h.

Class Members
const char * cache_file_path A path to the tuning cache file.
const int32_t mode cldnn_tuning_mode_type.

◆ cldnn_build_option

struct cldnn_build_option

Represents network build option.

Definition at line 204 of file cldnn.h.

Class Members
const void * data option parameter - e.g list of outputs.
int32_t type cldnn_build_option_type.

◆ cldnn_network_output

struct cldnn_network_output

Output information for executed cldnn_network.

User should wait for event before accessing the memory.

Definition at line 212 of file cldnn.h.

Class Members
cldnn_event event Event to be waited.
cldnn_memory memory

Output memory. User should wait for the event before access this field.

Enumeration Type Documentation

◆ cldnn_build_option_type

Network build option types.

Enumerator
cldnn_build_option_fusing 

Allow primitives fusing during network build.

cldnn_build_option_optimize_data 

Enable implicit reordering for user input.

cldnn_build_option_debug 

Enable debug mode.

cldnn_build_option_outputs 

User selected list of network outputs.

cldnn_build_option_tuning_config 

Tuning config.

cldnn_build_option_graph_dumps_dir 

Specifies a directory to which stages of network compilation should be dumped.

Definition at line 178 of file cldnn.h.

◆ cldnn_tuning_mode_type

Tuning modes.

Enumerator
cldnn_tuning_disabled 

Tuning is disabled.

cldnn_tuning_use_cache 

Tuning using the cached data (no on-line tuning for non-existing data).

cldnn_tuning_tune_and_cache 

Tuning using the cached data if exist, tune and update cache otherwise.

Definition at line 189 of file cldnn.h.

Function Documentation

◆ cldnn_add_event_handler()

CLDNN_API void cldnn_add_event_handler ( cldnn_event  event,
cldnn_event_handler  handler,
void *  param,
cldnn_status status 
)

Register call back to be called on event completion.

Parameters
[in]handlerPointer to cldnn_event_handler call-back function.
[in]paramuser-defined value to be passed to the call back function.

◆ cldnn_allocate_network()

CLDNN_API cldnn_network cldnn_allocate_network ( cldnn_program  program,
cldnn_status status 
)

Allocates memory for a new network which will be able to execute specified program.

Parameters
[in]programThe program object which holds binaries compiled from some topology and engine. Multiple network objects can share the same program.

◆ cldnn_build_network()

CLDNN_API cldnn_network cldnn_build_network ( cldnn_engine  engine,
cldnn_topology  topology,
cldnn_build_option options,
size_t  options_num,
cldnn_status status 
)

Builds and allocates executable network based on user-defined topology by specified engine. This is a shorthand for cldnn_build_program and cldnn_allocate_network.

Parameters
[in]engineThe engine which will be used to build the metwork.
[in]topologyThe user-defined topology on which the network will be based.
[in]optionsThe pointer of array of cldnn_build_option which define network build options.
[in]options_numNumber of elements in the options array.

◆ cldnn_execute_network()

CLDNN_API void cldnn_execute_network ( cldnn_network  network,
cldnn_event dependencies,
size_t  deps_num,
cldnn_status status 
)

Executes network.

User should call cldnn_set_network_input() for every input_layout defined in tho source topology. Function returns immediately, even if dependencies are not set yet. dependencies Pointer to an array of cldnn_events to be waited for network execution.

Parameters
deps_numNumber of elements in the dependencies array.

◆ cldnn_get_event_profiling_info()

CLDNN_API void cldnn_get_event_profiling_info ( cldnn_event  event,
cldnn_profiling_interval profiling,
size_t  size,
size_t *  size_ret,
cldnn_status status 
)

Returns the profiling information for an network primitive associated with event.

Parameters
[in]profilingPointer to the array of cldnn_profiling_interval where information to be stored.
[in]sizeNumber of elements in the array of cldnn_profiling_interval.
[out]size_retNumber of elements required to store profiling information.

◆ cldnn_get_network_all_primitive_names()

CLDNN_API void cldnn_get_network_all_primitive_names ( cldnn_network  network,
char *  names,
size_t  size,
size_t *  size_ret,
cldnn_status status 
)

Returns names of all primitives in network.

Function fills user provided buffer by primitive names. Each name is followed by '\0'. Empty name "\0\0" means end of data.

Parameters
[in]namesPointer to user-allocated buffer to store names.
[in]sizeSize (in chars) of the buffer.
[out]size_retRequired size (in chars) to store result.

◆ cldnn_get_network_all_primitive_org_names()

CLDNN_API void cldnn_get_network_all_primitive_org_names ( cldnn_network  network,
char *  names,
size_t  size,
size_t *  size_ret,
cldnn_status status 
)

Returns names of all primitives in network before graph optimization.

Function fills user provided buffer by primitive names. Each name is followed by '\0'. Empty name "\0\0" means end of data.

Parameters
[in]namesPointer to user-allocated buffer to store names.
[in]sizeSize (in chars) of the buffer.
[out]size_retRequired size (in chars) to store result.

◆ cldnn_get_network_executed_primitive_names()

CLDNN_API void cldnn_get_network_executed_primitive_names ( cldnn_network  network,
char *  names,
size_t  size,
size_t *  size_ret,
cldnn_status status 
)

Returns names of executed primitives.

Function fills user provided buffer by primitive names. Each name is followed by '\0'. Empty name "\0\0" means end of data.

Parameters
[in]namesPointer to user-allocated buffer to store names.
[in]sizeSize (in chars) of the buffer.
[out]size_retRequired size (in chars) to store result.

◆ cldnn_get_network_output()

CLDNN_API cldnn_network_output cldnn_get_network_output ( cldnn_network  network,
const char *  name,
cldnn_status status 
)

Returns executed network output information.

User should call this function after cldnn_execute_network() to get result of network execution.

Parameters
nameOutput name to get the result.
Returns
cldnn_network_output structure with the output information. To work with the result of this function, user should first wait for cldnn_network_output::event before getting an access to cldnn_network_output::memory.

◆ cldnn_get_network_output_event()

CLDNN_API cldnn_event cldnn_get_network_output_event ( cldnn_network  network,
const char *  name,
cldnn_status status 
)

Returns event corresponding to output with name.

User can call this function even before calling cldnn_execute_network(), but then content of memory is uninitialized.

Parameters
nameOutput name to get the result.
Returns
cldnn_event structure with the output information.

◆ cldnn_get_network_output_memory()

CLDNN_API cldnn_memory cldnn_get_network_output_memory ( cldnn_network  network,
const char *  name,
cldnn_status status 
)

Returns memory corresponding to output with name.

User can call this function even before calling cldnn_execute_network(), but then content of memory is uninitialized.

Parameters
nameOutput name to get the result.
Returns
cldnn_memory structure with the output information.

◆ cldnn_get_network_output_names()

CLDNN_API void cldnn_get_network_output_names ( cldnn_network  network,
char *  names,
size_t  size,
size_t *  size_ret,
cldnn_status status 
)

Returns names of network outputs.

Function fills user provided buffer by primitive names. Each name is followed by '\0'. Empty name "\0\0" means end of data.

Parameters
[in]namesPointer to user-allocated buffer to store names.
[in]sizeSize (in chars) of the buffer.
[out]size_retRequired size (in chars) to store result.

◆ cldnn_get_primitive_info()

CLDNN_API void cldnn_get_primitive_info ( cldnn_network  network,
cldnn_primitive_id  id,
char *  info,
size_t  size,
size_t *  size_ret,
cldnn_status status 
)

Returns information about particular primitive.

Function fills user provided buffer by primitive description.

Parameters
[in]idPrimitive id of input_layout primitive defined in topology.
[in]infoPointer to user-allocated buffer to store names.
[in]sizeSize (in chars) of the buffer.
[out]size_retRequired size (in chars) to store result.
Returns
pointer to array of chars with detailed information about particular primitive.

◆ cldnn_set_network_input()

CLDNN_API void cldnn_set_network_input ( cldnn_network  network,
cldnn_primitive_id  id,
cldnn_memory  mem,
cldnn_status status 
)

Provides user input data to the network (for input_layout primitives).

Parameters
[in]idPrimitive id of input_layout primitive defined in topology.
[in]memMemory object with user data which layout matches the input_layout defined in topology.

User should set the input data for every input_layout primitive defined in topology by calling this function before call to cldnn_execute_network().