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> 27 #include "helper_functions.h" 38 using namespace cldnn;
43 std::cout << std::endl <<
"-- Chapter 5 --" << std::endl;
53 set_values(input_prim, { -3.0f, -2.0f, 2.5f });
62 std::cout <<
"optimized " << it.first << std::endl;
63 auto mem_pointer = it.second.get_memory().pointer<
float>();
64 for (
auto i : mem_pointer)
66 std::cout << i <<
" ";
68 std::cout << std::endl;
72 std::vector<cldnn::instrumentation::profiling_info> profiling_table;
75 profiling_table.push_back({ p.first, p.second.get_event().get_profiling_info() });
79 for (
auto& p : profiling_table)
81 std::cout << p.name <<
":" << std::endl;
82 for (
auto& q : p.intervals)
84 std::cout <<
"\t" << q.name <<
": " << std::chrono::duration_cast<std::chrono::duration<double, std::chrono::nanoseconds::period>>(q.value->value()).count()
85 <<
" nanoseconds" << 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.
static std::shared_ptr< const build_option > optimize_data(bool enable=false)
Enable implicit reordering for user inputs (default: false).