17 #include <../api/CPP/cldnn_defs.h> 18 #include <../api/CPP/engine.hpp> 19 #include <../api/CPP/input_layout.hpp> 20 #include <../api/CPP/memory.hpp> 21 #include <../api/CPP/data.hpp> 22 #include <../api/CPP/topology.hpp> 23 #include <../api/CPP/network.hpp> 26 #include "helper_functions.h" 38 using namespace cldnn;
44 std::cout << std::endl <<
"-- Chapter 4 --" << std::endl;
49 std::vector<cldnn::primitive_id> outputs_list(0);
51 for (
auto prim_id :
topology.get_primitive_ids())
52 outputs_list.push_back(prim_id);
60 set_values(input_prim, { -3.0f, -2.0f, 2.5f });
69 std::cout << it.first << std::endl;
70 auto mem_pointer = it.second.get_memory().pointer<
float>();
71 for (
auto i : mem_pointer)
73 std::cout << i <<
" ";
75 std::cout << std::endl;
Represents program build options list.
std::map< primitive_id, network_output > execute(const std::vector< event > &dependencies={}) const
Executes network and returns the list of network_output.
void set_input_data(const primitive_id &id, const memory &mem) const
Provides memory for input_layout primitives defined by user in source topology.
void set_option(std::shared_ptr< const build_option > opt)
Adds or replace option to the options list.
User selected list of program outputs.
Network topology to be defined by user.
static memory allocate(const engine &engine, const layout &layout)
Allocate memory on engine using specified layout.
static std::shared_ptr< const build_option > outputs(const std::vector< primitive_id > &outs)
User selected list of program outputs.
Executable network allocated from program.
Represents clDNN engine object.
Represents buffer with particular layout.