clDNN
cldnn::network Struct Reference

Executable network allocated from program. More...

#include <network.hpp>

Public Member Functions

 network (program const &program)
 Allocate network. More...
 
 network (const engine &engine, const topology &topology, const build_options &options=build_options())
 Constructs network object from implicitly created program object. This is a shorthand for network(program(engine, topology, options)) More...
 
 network (cldnn_network impl)
 Constructs network object from C API cldnn_network.
 
 network (const network &other)
 Copy construction.
 
networkoperator= (const network &other)
 Copy assignment.
 
 ~network ()
 Releases wrapped C API cldnn_network.
 
engine get_engine () const
 Returns engine by which network was built.
 
program get_program () const
 Returns network internal program.
 
void set_input_data (const primitive_id &id, const memory &mem) const
 Provides memory for input_layout primitives defined by user in source topology.
 
std::string get_primitive_info (const primitive_id &id) const
 
std::vector< primitive_idget_executed_primitive_ids () const
 Returns the list of executed primitives.
 
std::vector< primitive_idget_all_primitive_ids () const
 Returns the list of all primitives ids in network.
 
std::vector< primitive_idget_all_primitive_org_ids () const
 Returns the list of all primitives ids in network before graph optimization.
 
std::vector< primitive_idget_output_ids () const
 Returns the list of available network outputs.
 
network_output get_output (const primitive_id &output_id) const
 Returns network_output object for particular output. Can't be called before network execution.
 
memory get_output_memory (const primitive_id &output_id) const
 Returns memory object for particular output. Can be called before network execution.
 
event get_primitive_event (const primitive_id &output_id) const
 Returns event object for particular primitive. Can't be called before network execution.
 
std::map< primitive_id, eventget_executed_primitives () const
 Returns the list of event for the primitives that were executed in network.
 
std::map< primitive_id, primitive_idget_all_primitives () const
 Returns the list of primitive ids before and after graph optimization. More...
 
std::map< primitive_id, network_outputexecute (const std::vector< event > &dependencies={}) const
 Executes network and returns the list of network_output. More...
 
cldnn_network get () const
 Returns wrapped C API cldnn_network handler.
 

Friends

bool operator== (const network &lhs, const network &rhs)
 
bool operator!= (const network &lhs, const network &rhs)
 

Detailed Description

Executable network allocated from program.

Definition at line 59 of file network.hpp.

Constructor & Destructor Documentation

◆ network() [1/2]

cldnn::network::network ( program const &  program)
inline

Allocate network.

Parameters
programThe program object which contains compiled primitives this network should allocate memory for.

Definition at line 63 of file network.hpp.

◆ network() [2/2]

cldnn::network::network ( const engine engine,
const topology topology,
const build_options options = build_options() 
)
inline

Constructs network object from implicitly created program object. This is a shorthand for network(program(engine, topology, options))

Parameters
engine
topology
options

Definition at line 74 of file network.hpp.

Member Function Documentation

◆ execute()

std::map<primitive_id, network_output> cldnn::network::execute ( const std::vector< event > &  dependencies = {}) const
inline

Executes network and returns the list of network_output.

Parameters
dependenciesList of event objects to be waited before network execution.
Note
User should call set_input_data() for every input_layout defined in source topology before network execution.

Definition at line 246 of file network.hpp.

◆ get_all_primitives()

std::map<primitive_id, primitive_id> cldnn::network::get_all_primitives ( ) const
inline

Returns the list of primitive ids before and after graph optimization.

If primitive was not optimized, the old and actual id will be the same.
If primitive was optimized during graph optimization, the actual id will be "_optimized_".

Definition at line 230 of file network.hpp.


The documentation for this struct was generated from the following file: