Introduction
In this chapter we will learn how to add a new Convolution kernel into clDNN kernel selector.
Please take a look in the files: "convolution_kernel_tutorial.cpp" "convolution_kernel_tutorial.h" "convolution_tutorial.cl"
#include <../api/CPP/cldnn_defs.h>
#include <../api/CPP/engine.hpp>
#include <../api/CPP/input_layout.hpp>
#include <../api/CPP/memory.hpp>
#include <../api/CPP/data.hpp>
#include <../api/CPP/topology.hpp>
#include <../api/CPP/network.hpp>
#include <../api/CPP/convolution.hpp>
#include <iostream>
#include <chrono>
#include "helper_functions.h"
{
std::cout << std::endl << "-- Chapter 6 --" << std::endl;
set_values(input_prim, get_simple_data<float>(input_prim));
set_values(weights, get_simple_data<float>(weights));
set_values(biases, get_simple_data<float>(biases));
data(
"conv_weights", weights),
data(
"conv_biases", biases),
"conv",
"conv_input",
{ "conv_weights" },
{ "conv_biases" })
);
std::vector<cldnn::instrumentation::profiling_info> profiling_table;
for (auto& p : executed_primitives)
{
profiling_table.push_back({ p.first, p.second.get_profiling_info() });
}
for (auto& p : profiling_table)
{
std::cout << p.name << ":" << std::endl;
for (auto& q : p.intervals)
{
std::cout << "\t" << q.name << ": " << std::chrono::duration_cast<std::chrono::duration<double, std::chrono::milliseconds::period>>(q.value->value()).count()
<< " milliseconds" << std::endl;
}
}
}