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> 24 #include <../api/CPP/convolution.hpp> 28 #include "helper_functions.h" 44 using namespace cldnn;
48 std::cout << std::endl <<
"-- Chapter 6 --" << std::endl;
63 set_values(input_prim, get_simple_data<float>(input_prim));
64 set_values(weights, get_simple_data<float>(weights));
65 set_values(biases, get_simple_data<float>(biases));
70 data(
"conv_weights", weights),
71 data(
"conv_biases", biases),
95 std::vector<cldnn::instrumentation::profiling_info> profiling_table;
96 for (
auto& p : executed_primitives)
98 profiling_table.push_back({ p.first, p.second.get_profiling_info() });
102 for (
auto& p : profiling_table)
104 std::cout << p.name <<
":" << std::endl;
105 for (
auto& q : p.intervals)
107 std::cout <<
"\t" << q.name <<
": " << std::chrono::duration_cast<std::chrono::duration<double, std::chrono::milliseconds::period>>(q.value->value()).count()
108 <<
" milliseconds" << 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.
std::map< primitive_id, event > get_executed_primitives() const
Returns the list of event for the primitives that were executed in network.
void set_option(std::shared_ptr< const build_option > opt)
Adds or replace option to the options list.
Provides input data to topology.
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.
Executable network allocated from program.
const layout & get_layout() const
Associated layout.
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).
Performs forward spatial convolution with weight sharing. Also supports built-in Relu cldnn_activatio...