[GPU] Graph serialization for GPU #2 (#13986)

* moved serialization include path

* quiet onednn-gpu patching

* save and load kernels in _impls

* changed to use OPENVINO_ASSERT

* fix errata

* updated to follow OpenVINO naming convention

* updated error messages

* binary buffer by vector<uint8_t>

* partial_shape serialization

* removed object_type

* added a new storage class for primitive_type_string and id

* updated to throw an exception when _node is null in build_deps().

* removed redundant memory_pool clearing

* added a new net_id creator

* newline at eof

* updated CLDNN with GPU

* added cache blob descriptions

* updated output allocation logic  in serialization

* added ov::device::architecture in supported properties

* overrided save and load in data_inst and mutable_data_inst

* removed save and load functions in mutable_data

* baseline for serialization unit tests

* added serialization unit tests

* added serialization unit tests

* updated not to execute build_deps when deserialized

* make_data without namespace

* updated to use default layout c-tor

* updated get_unique_net_id()

* updated get_type_id() to a pure virtual method

* updated ov::caching_properties

* added [GPU] tags

* updated network c-tor

* updated unit tests
This commit is contained in:
Eddy Kim authored and GitHub committed 2022-11-22 12:43:50 +03:00
1 parent 97878dee34
commit 0b1e36600b
272 files changed
+2497 -1641

No files matched your search

@@ -6,13 +6,13 @@
#include "intel_gpu/graph/topology.hpp"
#include "intel_gpu/graph/program.hpp"
#include "intel_gpu/graph/serialization/binary_buffer.hpp"
#include "intel_gpu/runtime/compounds.hpp"
#include "intel_gpu/runtime/memory.hpp"
#include "intel_gpu/runtime/engine.hpp"
#include "intel_gpu/runtime/event.hpp"
#include "intel_gpu/runtime/stream.hpp"
#include "intel_gpu/runtime/lru_cache.hpp"
#include "serialization/binary_buffer.hpp"
#include <map>
#include <vector>
@@ -19,9 +19,8 @@ public:
void write(void const * data, std::streamsize size) {
auto const written_size = stream.rdbuf()->sputn(reinterpret_cast<const char*>(data), size);
if (written_size != size) {
throw std::runtime_error("Failed to write " + std::to_string(size) + " bytes to stream! Wrote " + std::to_string(written_size));
}
OPENVINO_ASSERT(written_size == size,
"[GPU] Failed to write " + std::to_string(size) + " bytes to stream! Wrote " + std::to_string(written_size));
}
void setKernlImplParams(void* impl_params) { _impl_params = impl_params; }
@@ -38,9 +37,8 @@ public:
void read(void* const data, std::streamsize size) {
auto const read_size = stream.rdbuf()->sgetn(reinterpret_cast<char*>(data), size);
if (read_size != size) {
throw std::runtime_error("Failed to read " + std::to_string(size) + " bytes from stream! Read " + std::to_string(read_size));
}
OPENVINO_ASSERT(read_size == size,
"[GPU] Failed to read " + std::to_string(size) + " bytes from stream! Read " + std::to_string(read_size));
}
void setKernlImplParams(void* impl_params) { _impl_params = impl_params; }
@@ -85,9 +83,14 @@ public:
} // namespace cldnn
#define BIND_BINARY_BUFFER_WITH_TYPE(cls_name, obj_type) \
#define ASSIGN_TYPE_NAME(cls_name) \
namespace cldnn { \
const object_type cls_name::type = obj_type; \
const std::string cls_name::type = #cls_name; \
}
#define BIND_BINARY_BUFFER_WITH_TYPE(cls_name) \
namespace cldnn { \
const std::string cls_name::type = #cls_name; \
BIND_TO_BUFFER(BinaryOutputBuffer, cls_name) \
BIND_TO_BUFFER(BinaryInputBuffer, cls_name) \
}
@@ -10,11 +10,10 @@
#include <functional>
#include "buffer.hpp"
#include "static_instance.hpp"
#include "object_types.hpp"
#define DECLARE_OBJECT_TYPE_SERIALIZATION \
static const object_type type; \
object_type get_type() const override { return type; }
static const std::string type; \
std::string get_type() const override { return type; }
#define BIND_TO_BUFFER(buffer, type) \
template <> \
@@ -25,26 +24,19 @@
const instance_creator<buffer, type>& bind_creator<buffer, type>::creator = \
static_instance<instance_creator<buffer, type>>::get_instance().instantiate();
// It's a defect, and was fixed in C++14
// https://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#2148
struct enum_class_hash {
template <typename T>
std::size_t operator()(T t) const { return static_cast<std::size_t>(t); }
};
namespace cldnn {
template <typename BufferType>
struct saver_storage {
using save_function = std::function<void(BufferType&, const void*)>;
using value_type = typename std::unordered_map<object_type, save_function, enum_class_hash>::value_type;
using value_type = typename std::unordered_map<std::string, save_function>::value_type;
static saver_storage<BufferType>& instance() {
static saver_storage<BufferType> instance;
return instance;
}
const save_function& get_save_function(const object_type& type) const {
const save_function& get_save_function(const std::string& type) const {
return map.at(type);
}
@@ -57,7 +49,7 @@ private:
saver_storage(const saver_storage&) = delete;
void operator=(const saver_storage&) = delete;
std::unordered_map<object_type, save_function, enum_class_hash> map;
std::unordered_map<std::string, save_function> map;
};
template <typename T>
@@ -67,14 +59,14 @@ struct void_deleter {
template <typename BufferType, typename FuncT>
struct loader_storage {
using value_type = typename std::unordered_map<object_type, FuncT, enum_class_hash>::value_type;
using value_type = typename std::unordered_map<std::string, FuncT>::value_type;
static loader_storage& instance() {
static loader_storage instance;
return instance;
}
const FuncT& get_load_function(const object_type& type) {
const FuncT& get_load_function(const std::string& type) {
return map.at(type);
}
@@ -87,7 +79,7 @@ private:
loader_storage(const loader_storage&) = delete;
void operator=(const loader_storage&) = delete;
std::unordered_map<object_type, FuncT, enum_class_hash> map;
std::unordered_map<std::string, FuncT> map;
};
template <typename BufferType>
@@ -12,6 +12,33 @@
#include "intel_gpu/runtime/layout.hpp"
namespace cldnn {
template <typename BufferType>
class Serializer<BufferType, ov::PartialShape, typename std::enable_if<std::is_base_of<OutputBuffer<BufferType>, BufferType>::value>::type> {
public:
static void save(BufferType& buffer, const ov::PartialShape& partial_shape) {
std::vector<ov::Dimension> dimensions(partial_shape);
buffer << dimensions.size();
for (const auto& dimension : dimensions) {
buffer << dimension.get_interval().get_min_val();
buffer << dimension.get_interval().get_max_val();
}
}
};
template <typename BufferType>
class Serializer<BufferType, ov::PartialShape, typename std::enable_if<std::is_base_of<InputBuffer<BufferType>, BufferType>::value>::type> {
public:
static void load(BufferType& buffer, ov::PartialShape& partial_shape) {
size_t num_dimensions;
buffer >> num_dimensions;
for (size_t i = 0; i < num_dimensions; i++) {
ov::Dimension::value_type min_val, max_val;
buffer >> min_val >> max_val;
partial_shape.push_back(ov::Dimension(min_val, max_val));
}
}
};
template <typename BufferType>
class Serializer<BufferType, cldnn::layout, typename std::enable_if<std::is_base_of<OutputBuffer<BufferType>, BufferType>::value>::type> {
public:
@@ -21,15 +48,7 @@ public:
buffer << _layout.data_padding.filling_value();
buffer << _layout.data_padding.lower_size().sizes();
buffer << _layout.data_padding.upper_size().sizes();
std::vector<cldnn::tensor::value_type> _sizes = _layout.get_tensor().sizes(_layout.format);
// Temp WA for bs_x_bsv16
if (_layout.format == cldnn::format::bs_x_bsv16) {
std::vector<cldnn::tensor::value_type> _tmp_sizes = _layout.get_tensor().sizes();
_sizes[0] = _tmp_sizes[0];
_sizes[1] = _tmp_sizes[1];
}
buffer << _sizes;
buffer << _layout.get_partial_shape();
}
};
@@ -50,15 +69,9 @@ public:
_layout.data_padding = cldnn::padding(_lower_size, _upper_size, _filling_value);
}
std::vector<cldnn::tensor::value_type> _sizes;
buffer >> _sizes;
// Temp WA for bs_x_bsv16
if (_layout.format == cldnn::format::bs_x_bsv16) {
_layout.set_tensor(tensor(_sizes));
} else {
_layout.set_tensor(tensor(_layout.format, _sizes));
}
ov::PartialShape partial_shape;
buffer >> partial_shape;
_layout.set_partial_shape(partial_shape);
}
};
@@ -12,7 +12,6 @@
#include "buffer.hpp"
#include "bind.hpp"
#include "helpers.hpp"
#include "object_types.hpp"
namespace cldnn {
@@ -21,7 +20,7 @@ class Serializer<BufferType, std::unique_ptr<T>, typename std::enable_if<std::is
public:
static void save(BufferType& buffer, const std::unique_ptr<T>& ptr) {
const auto& type = ptr->get_type();
buffer << cldnn::make_data(&type, sizeof(object_type));
buffer << type;
const auto save_func = saver_storage<BufferType>::instance().get_save_function(type);
save_func(buffer, ptr.get());
}
@@ -31,8 +30,8 @@ template <typename BufferType, typename T>
class Serializer<BufferType, std::unique_ptr<T>, typename std::enable_if<std::is_base_of<InputBuffer<BufferType>, BufferType>::value>::type> {
public:
static void load(BufferType& buffer, std::unique_ptr<T>& ptr, engine& engine) {
object_type type;
buffer >> cldnn::make_data(&type, sizeof(object_type));
std::string type;
buffer >> type;
const auto load_func = dif<BufferType>::instance().get_load_function(type);
std::unique_ptr<void, void_deleter<void>> result;
load_func(buffer, result, engine);
@@ -40,8 +39,8 @@ public:
}
static void load(BufferType& buffer, std::unique_ptr<T>& ptr) {
object_type type;
buffer >> cldnn::make_data(&type, sizeof(object_type));
std::string type;
buffer >> type;
const auto load_func = def<BufferType>::instance().get_load_function(type);
std::unique_ptr<void, void_deleter<void>> result;
load_func(buffer, result);
@@ -28,7 +28,6 @@ public:
CompiledModel(std::istream& networkModel, std::shared_ptr<InferenceEngine::RemoteContext> context, Config config);
void Export(std::ostream& networkModel) override;
bool isSerializable();
std::shared_ptr<ngraph::Function> GetExecGraphInfo() override;
InferenceEngine::IInferRequestInternal::Ptr CreateInferRequest() override;
InferenceEngine::IInferRequestInternal::Ptr CreateInferRequestImpl(InferenceEngine::InputsDataMap networkInputs,
@@ -47,6 +46,9 @@ public:
Config m_config;
InferenceEngine::ITaskExecutor::Ptr m_taskExecutor;
InferenceEngine::ITaskExecutor::Ptr m_waitExecutor;
private:
bool is_serializable();
};
} // namespace intel_gpu
@@ -213,6 +213,30 @@ struct primitive_info {
CLDNN_DEFINE_TYPE_ID(PType) \
CLDNN_DEFINE_TYPE_STRING(PType)
#define GPU_DEFINE_PRIMITIVE_TYPE_ID(PType) \
primitive_type_id PType::type_id() { \
static primitive_type_base<PType> instance; \
return &instance; \
} \
bool _##PType##_added_ = prim_map_storage::instance().set_type_id(#PType, PType::type_id());
struct prim_map_storage {
static prim_map_storage& instance() {
static prim_map_storage instance;
return instance;
}
const cldnn::primitive_type_id get_type_id(const std::string& type_string) const {
return map.at(type_string);
}
bool set_type_id(const std::string& type_string, const cldnn::primitive_type_id type_id) {
return map.insert({type_string, type_id}).second;
}
private:
std::unordered_map<std::string, cldnn::primitive_type_id> map;
};
/// @}
/// @}
} // namespace cldnn
@@ -10,10 +10,7 @@
#include <vector>
namespace cldnn {
primitive_type_id activation::type_id() {
static primitive_type_base<activation> instance;
return &instance;
}
GPU_DEFINE_PRIMITIVE_TYPE_ID(activation)
layout activation_inst::calc_output_layout(activation_node const& node, kernel_impl_params const& impl_param) {
assert(static_cast<bool>(impl_param.desc->output_data_type) == false &&
@@ -9,10 +9,7 @@
#include <string>
namespace cldnn {
primitive_type_id adaptive_pooling::type_id() {
static primitive_type_base<adaptive_pooling> instance;
return &instance;
}
GPU_DEFINE_PRIMITIVE_TYPE_ID(adaptive_pooling)
layout adaptive_pooling_inst::calc_output_layout(const adaptive_pooling_node& node, kernel_impl_params const& impl_param) {
const auto data_layout = impl_param.get_input_layout();
@@ -13,10 +13,7 @@
#include "topk_shape_inference.hpp"
namespace cldnn {
primitive_type_id arg_max_min::type_id() {
static primitive_type_base<arg_max_min> instance;
return &instance;
}
GPU_DEFINE_PRIMITIVE_TYPE_ID(arg_max_min)
layout arg_max_min_inst::calc_output_layout(arg_max_min_node const& node, kernel_impl_params const& impl_param) {
auto desc = impl_param.typed_desc<arg_max_min>();
+1 -5
View File
@@ -9,11 +9,7 @@
#include <data_inst.h>
namespace cldnn {
primitive_type_id assign::type_id() {
static primitive_type_base<assign> instance;
return &instance;
}
GPU_DEFINE_PRIMITIVE_TYPE_ID(assign)
assign_inst::typed_primitive_inst(network& network, const assign_node& node) :
parent{network, node, false},
@@ -10,10 +10,7 @@
#include <string>
namespace cldnn {
primitive_type_id average_unpooling::type_id() {
static primitive_type_base<average_unpooling> instance;
return &instance;
}
GPU_DEFINE_PRIMITIVE_TYPE_ID(average_unpooling)
layout average_unpooling_inst::calc_output_layout(average_unpooling_node const& node, kernel_impl_params const& impl_param) {
assert(static_cast<bool>(impl_param.desc->output_data_type) == false &&
@@ -12,10 +12,7 @@
#include <vector>
namespace cldnn {
primitive_type_id cldnn::batch_to_space::type_id() {
static primitive_type_base<batch_to_space> instance;
return &instance;
}
GPU_DEFINE_PRIMITIVE_TYPE_ID(batch_to_space)
layout batch_to_space_inst::calc_output_layout(batch_to_space_node const& node, kernel_impl_params const& impl_param) {
auto desc = impl_param.typed_desc<batch_to_space>();
@@ -12,10 +12,7 @@
#include <string>
namespace cldnn {
primitive_type_id binary_convolution::type_id() {
static primitive_type_base<binary_convolution> instance;
return &instance;
}
GPU_DEFINE_PRIMITIVE_TYPE_ID(binary_convolution)
layout binary_convolution_inst::calc_output_layout(binary_convolution_node const& node, kernel_impl_params const& impl_param) {
auto desc = impl_param.typed_desc<binary_convolution>();
+1 -4
View File
@@ -12,10 +12,7 @@
#include <algorithm>
namespace cldnn {
primitive_type_id border::type_id() {
static primitive_type_base<border> instance;
return &instance;
}
GPU_DEFINE_PRIMITIVE_TYPE_ID(border)
layout border_inst::calc_output_layout(border_node const& node, kernel_impl_params const& impl_param) {
assert(static_cast<bool>(impl_param.desc->output_data_type) == false &&
@@ -13,10 +13,7 @@
#include <set>
namespace cldnn {
primitive_type_id broadcast::type_id() {
static primitive_type_base<broadcast> instance;
return &instance;
}
GPU_DEFINE_PRIMITIVE_TYPE_ID(broadcast)
layout broadcast_inst::calc_output_layout(broadcast_node const& node, kernel_impl_params const& impl_param) {
assert(static_cast<bool>(impl_param.desc->output_data_type) == false &&
@@ -11,11 +11,7 @@
#include "to_string_utils.h"
namespace cldnn {
primitive_type_id bucketize::type_id() {
static primitive_type_base<bucketize> instance;
return &instance;
}
GPU_DEFINE_PRIMITIVE_TYPE_ID(bucketize)
layout bucketize_inst::calc_output_layout(const bucketize_node& node, kernel_impl_params const& impl_param) {
auto input_layout = impl_param.get_input_layout();
@@ -12,10 +12,7 @@
#include <list>
namespace cldnn {
primitive_type_id concatenation::type_id() {
static primitive_type_base<concatenation> instance;
return &instance;
}
GPU_DEFINE_PRIMITIVE_TYPE_ID(concatenation)
layout concatenation_inst::calc_output_layout(concatenation_node const& node, kernel_impl_params const& impl_param) {
auto desc = impl_param.typed_desc<concatenation>();
@@ -10,10 +10,8 @@
#include <string>
namespace cldnn {
primitive_type_id condition::type_id() {
static primitive_type_base<condition> instance;
return &instance;
}
GPU_DEFINE_PRIMITIVE_TYPE_ID(condition)
/*
Calc_output_layout method is called only when output layout is invalidated.
It means, that it is called when:
@@ -10,10 +10,7 @@
#include <string>
namespace cldnn {
primitive_type_id convert_color::type_id() {
static primitive_type_base<convert_color> instance;
return &instance;
}
GPU_DEFINE_PRIMITIVE_TYPE_ID(convert_color)
layout convert_color_inst::calc_output_layout(convert_color_node const& node, kernel_impl_params const& impl_param) {
auto desc = impl_param.typed_desc<convert_color>();
@@ -15,10 +15,7 @@
using namespace ov::intel_gpu;
namespace cldnn {
primitive_type_id convolution::type_id() {
static primitive_type_base<convolution> instance;
return &instance;
}
GPU_DEFINE_PRIMITIVE_TYPE_ID(convolution)
layout convolution_inst::calc_output_layout(convolution_node const& node, kernel_impl_params const& impl_param) {
auto desc = impl_param.typed_desc<convolution>();
+1 -4
View File
@@ -14,10 +14,7 @@
#include "split_shape_inference.hpp"
namespace cldnn {
primitive_type_id crop::type_id() {
static primitive_type_base<crop> instance;
return &instance;
}
GPU_DEFINE_PRIMITIVE_TYPE_ID(crop)
layout crop_inst::calc_output_layout(crop_node const& node, kernel_impl_params const& impl_param) {
assert(static_cast<bool>(impl_param.desc->output_data_type) == false &&
@@ -8,10 +8,7 @@
#include <string>
namespace cldnn {
primitive_type_id ctc_greedy_decoder::type_id() {
static primitive_type_base<ctc_greedy_decoder> instance;
return &instance;
}
GPU_DEFINE_PRIMITIVE_TYPE_ID(ctc_greedy_decoder)
layout ctc_greedy_decoder_inst::calc_output_layout(ctc_greedy_decoder_node const& node, kernel_impl_params const& impl_param) {
auto input_node_layout = impl_param.get_input_layout();
+1 -5
View File
@@ -11,11 +11,7 @@
#include "to_string_utils.h"
namespace cldnn {
primitive_type_id ctc_loss::type_id() {
static primitive_type_base<ctc_loss> instance;
return &instance;
}
GPU_DEFINE_PRIMITIVE_TYPE_ID(ctc_loss)
layout ctc_loss_inst::calc_output_layout(const ctc_loss_node& node, const kernel_impl_params& impl_param) {
auto input_layout = impl_param.get_input_layout();
+1 -4
View File
@@ -10,10 +10,7 @@
#include <string>
namespace cldnn {
primitive_type_id cum_sum::type_id() {
static primitive_type_base<cum_sum> instance;
return &instance;
}
GPU_DEFINE_PRIMITIVE_TYPE_ID(cum_sum)
layout cum_sum_inst::calc_output_layout(cum_sum_node const& node, kernel_impl_params const& impl_param) {
return impl_param.get_input_layout();
@@ -10,11 +10,7 @@
#include <string>
namespace cldnn {
primitive_type_id custom_gpu_primitive::type_id() {
static primitive_type_base<custom_gpu_primitive> instance;
return &instance;
}
GPU_DEFINE_PRIMITIVE_TYPE_ID(custom_gpu_primitive)
std::string custom_gpu_primitive_inst::to_string(custom_gpu_primitive_node const& node) {
auto desc = node.get_primitive();
+45 -4
View File
@@ -13,10 +13,7 @@
#include <algorithm>
namespace cldnn {
primitive_type_id data::type_id() {
static primitive_type_base<data> instance;
return &instance;
}
GPU_DEFINE_PRIMITIVE_TYPE_ID(data)
namespace {
memory::ptr attach_or_copy_data(network& network, memory::ptr mem) {
@@ -56,4 +53,48 @@ std::string data_inst::to_string(data_node const& node) {
data_inst::typed_primitive_inst(network& network, data_node const& node)
: parent(network, node, attach_or_copy_data(network, node.get_attached_memory_ptr())) {}
// Cache blob format:
// [ kernel_impl_params ]
// [ output memory information ]
// [ data stored in memory ]
void data_inst::save(cldnn::BinaryOutputBuffer& ob) const {
parent::save(ob);
ob << _outputs[0]->get_layout();
const auto _allocation_type = _outputs[0]->get_allocation_type();
ob << make_data(&_allocation_type, sizeof(_allocation_type));
size_t data_size = _outputs[0]->size();
ob << make_data(&data_size, sizeof(size_t));
if (_allocation_type == allocation_type::usm_host || _allocation_type == allocation_type::usm_shared) {
ob << make_data(_outputs[0]->buffer_ptr(), data_size);
} else {
mem_lock<char, mem_lock_type::read> lock{_outputs[0], get_node().get_program().get_stream()};
ob << make_data(lock.data(), data_size);
}
}
void data_inst::load(BinaryInputBuffer& ib) {
parent::load(ib);
layout output_layout = layout();
ib >> output_layout;
allocation_type _allocation_type;
ib >> make_data(&_allocation_type, sizeof(_allocation_type));
size_t data_size;
ib >> make_data(&data_size, sizeof(size_t));
_outputs[0] = get_network().get_memory_pool().get_memory(output_layout, _allocation_type, false);
if (_allocation_type == allocation_type::usm_host || _allocation_type == allocation_type::usm_shared) {
ib >> make_data(_outputs[0]->buffer_ptr(), data_size);
} else {
std::vector<uint8_t> _buf;
_buf.resize(data_size);
ib >> make_data(_buf.data(), data_size);
_outputs[0]->copy_from(get_network().get_stream(), _buf.data());
}
}
} // namespace cldnn
@@ -13,10 +13,7 @@
using namespace ov::intel_gpu;
namespace cldnn {
primitive_type_id deconvolution::type_id() {
static primitive_type_base<deconvolution> instance;
return &instance;
}
GPU_DEFINE_PRIMITIVE_TYPE_ID(deconvolution)
layout deconvolution_inst::calc_output_layout(deconvolution_node const& node, kernel_impl_params const& impl_param) {
assert(static_cast<bool>(impl_param.desc->output_data_type) == false &&
@@ -10,10 +10,7 @@
#include <string>
namespace cldnn {
primitive_type_id deformable_conv::type_id() {
static primitive_type_base<deformable_conv> instance;
return &instance;
}
GPU_DEFINE_PRIMITIVE_TYPE_ID(deformable_conv)
layout deformable_conv_inst::calc_output_layout(deformable_conv_node const& node, kernel_impl_params const& impl_param) {
auto desc = impl_param.typed_desc<deformable_conv>();
@@ -56,10 +53,7 @@ std::string deformable_conv_inst::to_string(deformable_conv_node const& node) {
deformable_conv_inst::typed_primitive_inst(network& network, deformable_conv_node const& node) : parent(network, node) {
}
primitive_type_id deformable_interp::type_id() {
static primitive_type_base<deformable_interp> instance;
return &instance;
}
GPU_DEFINE_PRIMITIVE_TYPE_ID(deformable_interp)
layout deformable_interp_inst::calc_output_layout(deformable_interp_node const& node, kernel_impl_params const& impl_param) {
auto desc = node.get_primitive();
@@ -10,10 +10,7 @@
#include <string>
namespace cldnn {
primitive_type_id depth_to_space::type_id() {
static primitive_type_base<depth_to_space> instance;
return &instance;
}
GPU_DEFINE_PRIMITIVE_TYPE_ID(depth_to_space)
layout depth_to_space_inst::calc_output_layout(depth_to_space_node const& node, kernel_impl_params const& impl_param) {
auto desc = impl_param.typed_desc<depth_to_space>();
@@ -4,16 +4,13 @@
#include "detection_output_inst.h"
#include "primitive_type_base.h"
#include "intel_gpu/graph/serialization/string_serializer.hpp"
#include "intel_gpu/runtime/error_handler.hpp"
#include "json_object.h"
#include <string>
#include "serialization/string_serializer.hpp"
namespace cldnn {
primitive_type_id detection_output::type_id() {
static primitive_type_base<detection_output> instance;
return &instance;
}
GPU_DEFINE_PRIMITIVE_TYPE_ID(detection_output)
layout detection_output_inst::calc_output_layout(detection_output_node const& node, kernel_impl_params const& impl_param) {
assert(static_cast<bool>(impl_param.desc->output_data_type) == false &&
@@ -189,7 +186,7 @@ void detection_output_inst::save(cldnn::BinaryOutputBuffer& ob) const {
ob << argument->input[0];
ob << argument->input[1];
ob << argument->input[2];
ob << cldnn::make_data(&argument->output_padding, sizeof(argument->output_padding));
ob << make_data(&argument->output_padding, sizeof(argument->output_padding));
ob << argument->num_classes;
ob << argument->keep_top_k;
ob << argument->share_location;
@@ -197,7 +194,7 @@ void detection_output_inst::save(cldnn::BinaryOutputBuffer& ob) const {
ob << argument->nms_threshold;
ob << argument->top_k;
ob << argument->eta;
ob << cldnn::make_data(&argument->code_type, sizeof(argument->code_type));
ob << make_data(&argument->code_type, sizeof(argument->code_type));
ob << argument->variance_encoded_in_target;
ob << argument->confidence_threshold;
ob << argument->prior_info_size;
@@ -242,7 +239,7 @@ void detection_output_inst::load(cldnn::BinaryInputBuffer& ib) {
ib >> input_location;
ib >> input_confidence;
ib >> input_prior_box;
ib >> cldnn::make_data(&output_padding, sizeof(output_padding));
ib >> make_data(&output_padding, sizeof(output_padding));
ib >> num_classes;
ib >> keep_top_k;
ib >> share_location;
@@ -250,7 +247,7 @@ void detection_output_inst::load(cldnn::BinaryInputBuffer& ib) {
ib >> nms_threshold;
ib >> top_k;
ib >> eta;
ib >> cldnn::make_data(&code_type, sizeof(code_type));
ib >> make_data(&code_type, sizeof(code_type));
ib >> variance_encoded_in_target;
ib >> confidence_threshold;
ib >> prior_info_size;
+1 -5
View File
@@ -8,11 +8,7 @@
#include "json_object.h"
namespace cldnn {
primitive_type_id dft::type_id() {
static primitive_type_base<dft> instance;
return &instance;
}
GPU_DEFINE_PRIMITIVE_TYPE_ID(dft)
layout dft_inst::calc_output_layout(const dft_node& node, const kernel_impl_params& impl_param) {
const auto primitive = impl_param.typed_desc<dft>();
+1 -4
View File
@@ -12,10 +12,7 @@
#include <algorithm>
namespace cldnn {
primitive_type_id eltwise::type_id() {
static primitive_type_base<eltwise> instance;
return &instance;
}
GPU_DEFINE_PRIMITIVE_TYPE_ID(eltwise)
layout eltwise_inst::calc_output_layout(eltwise_node const& node, kernel_impl_params const& impl_param) {
size_t primary_input_idx = 0;
@@ -10,10 +10,7 @@
#include <string>
namespace cldnn {
primitive_type_id embedding_bag::type_id() {
static primitive_type_base<embedding_bag> instance;
return &instance;
}
GPU_DEFINE_PRIMITIVE_TYPE_ID(embedding_bag)
layout embedding_bag_inst::calc_output_layout(embedding_bag_node const& node, kernel_impl_params const& impl_param) {
auto desc = impl_param.typed_desc<embedding_bag>();
@@ -10,10 +10,7 @@
#include "primitive_type_base.h"
namespace cldnn {
primitive_type_id experimental_detectron_detection_output::type_id() {
static primitive_type_base<experimental_detectron_detection_output> instance;
return &instance;
}
GPU_DEFINE_PRIMITIVE_TYPE_ID(experimental_detectron_detection_output)
layout experimental_detectron_detection_output_inst::calc_output_layout(
const experimental_detectron_detection_output_node& node, kernel_impl_params const& impl_param) {
@@ -9,10 +9,7 @@
#include <string>
namespace cldnn {
primitive_type_id experimental_detectron_generate_proposals_single_image::type_id() {
static primitive_type_base<experimental_detectron_generate_proposals_single_image> instance;
return &instance;
}
GPU_DEFINE_PRIMITIVE_TYPE_ID(experimental_detectron_generate_proposals_single_image)
layout experimental_detectron_generate_proposals_single_image_inst::calc_output_layout(
const experimental_detectron_generate_proposals_single_image_node& node, kernel_impl_params const& impl_param) {
@@ -8,11 +8,7 @@
#include "json_object.h"
namespace cldnn {
primitive_type_id experimental_detectron_prior_grid_generator::type_id() {
static primitive_type_base<experimental_detectron_prior_grid_generator> instance;
return &instance;
}
GPU_DEFINE_PRIMITIVE_TYPE_ID(experimental_detectron_prior_grid_generator)
layout experimental_detectron_prior_grid_generator_inst::calc_output_layout(
const experimental_detectron_prior_grid_generator_node& node, kernel_impl_params const& impl_param) {
@@ -9,10 +9,7 @@
#include <string>
namespace cldnn {
primitive_type_id experimental_detectron_roi_feature_extractor::type_id() {
static primitive_type_base<experimental_detectron_roi_feature_extractor> instance;
return &instance;
}
GPU_DEFINE_PRIMITIVE_TYPE_ID(experimental_detectron_roi_feature_extractor)
size_t experimental_detectron_roi_feature_extractor_inst::inputs_memory_count() const {
return parent::inputs_memory_count() - 1;
@@ -9,11 +9,7 @@
#include <data_inst.h>
namespace cldnn {
primitive_type_id experimental_detectron_topk_rois::type_id() {
static primitive_type_base<experimental_detectron_topk_rois> instance;
return &instance;
}
GPU_DEFINE_PRIMITIVE_TYPE_ID(experimental_detectron_topk_rois)
experimental_detectron_topk_rois_inst::typed_primitive_inst(network& network, experimental_detectron_topk_rois_node const &node)
: parent(network, node) {
@@ -10,10 +10,7 @@
#include <string>
namespace cldnn {
primitive_type_id extract_image_patches::type_id() {
static primitive_type_base<extract_image_patches> instance;
return &instance;
}
GPU_DEFINE_PRIMITIVE_TYPE_ID(extract_image_patches)
layout extract_image_patches_inst::calc_output_layout(extract_image_patches_node const& node, kernel_impl_params const& impl_param) {
auto desc = impl_param.typed_desc<extract_image_patches>();
+1 -5
View File
@@ -10,11 +10,7 @@
#include "primitive_type_base.h"
namespace cldnn {
primitive_type_id eye::type_id() {
static primitive_type_base<eye> instance;
return &instance;
}
GPU_DEFINE_PRIMITIVE_TYPE_ID(eye)
eye_inst::typed_primitive_inst(network& network, eye_node const& node) : parent(network, node) {}
@@ -14,10 +14,7 @@
#include "matmul_shape_inference.hpp"
namespace cldnn {
primitive_type_id fully_connected::type_id() {
static primitive_type_base<fully_connected> instance;
return &instance;
}
GPU_DEFINE_PRIMITIVE_TYPE_ID(fully_connected)
namespace {
bool is_batch_after_spatial(const std::string order) {
+1 -4
View File
@@ -12,10 +12,7 @@
#include "gather_shape_inference.hpp"
namespace cldnn {
primitive_type_id gather::type_id() {
static primitive_type_base<gather> instance;
return &instance;
}
GPU_DEFINE_PRIMITIVE_TYPE_ID(gather)
layout gather_inst::calc_output_layout(gather_node const& node, kernel_impl_params const& impl_param) {
auto desc = impl_param.typed_desc<gather>();
@@ -11,10 +11,7 @@
#include <string>
namespace cldnn {
primitive_type_id gather_elements::type_id() {
static primitive_type_base<gather_elements> instance;
return &instance;
}
GPU_DEFINE_PRIMITIVE_TYPE_ID(gather_elements)
layout gather_elements_inst::calc_output_layout(gather_elements_node const& node, kernel_impl_params const& impl_param) {
auto op = impl_param.typed_desc<gather_elements>();
@@ -10,10 +10,7 @@
#include <string>
namespace cldnn {
primitive_type_id gather_nd::type_id() {
static primitive_type_base<gather_nd> instance;
return &instance;
}
GPU_DEFINE_PRIMITIVE_TYPE_ID(gather_nd)
layout gather_nd_inst::calc_output_layout(gather_nd_node const& node, kernel_impl_params const& impl_param) {
auto op = impl_param.typed_desc<gather_nd>();
@@ -11,10 +11,7 @@
#include <algorithm>
namespace cldnn {
primitive_type_id gather_tree::type_id() {
static primitive_type_base<gather_tree> instance;
return &instance;
}
GPU_DEFINE_PRIMITIVE_TYPE_ID(gather_tree)
layout gather_tree_inst::calc_output_layout(gather_tree_node const& node, kernel_impl_params const& impl_param) {
assert(static_cast<bool>(impl_param.desc->output_data_type) == false &&
+1 -4
View File
@@ -14,10 +14,7 @@
#include "matmul_shape_inference.hpp"
namespace cldnn {
primitive_type_id gemm::type_id() {
static primitive_type_base<gemm> instance;
return &instance;
}
GPU_DEFINE_PRIMITIVE_TYPE_ID(gemm)
layout gemm_inst::calc_output_layout(gemm_node const& node, kernel_impl_params const& impl_param) {
auto prim = impl_param.typed_desc<gemm>();
@@ -9,10 +9,7 @@
#include <string>
namespace cldnn {
primitive_type_id generate_proposals::type_id() {
static primitive_type_base<generate_proposals> instance;
return &instance;
}
GPU_DEFINE_PRIMITIVE_TYPE_ID(generate_proposals)
layout generate_proposals_inst::calc_output_layout(const generate_proposals_node& node, kernel_impl_params const& impl_param) {
const layout data_layout = impl_param.get_input_layout();
@@ -13,11 +13,7 @@
#include <memory>
namespace cldnn {
primitive_type_id generic_layer::type_id() {
static primitive_type_base<generic_layer> instance;
return &instance;
}
GPU_DEFINE_PRIMITIVE_TYPE_ID(generic_layer)
generic_layer_node::typed_program_node(const std::shared_ptr<generic_layer> prim, program& prog)
: parent(prim, prog) {
@@ -1,198 +0,0 @@
// Copyright (C) 2018-2022 Intel Corporation
// SPDX-License-Identifier: Apache-2.0
//
///////////////////////////////////////////////////////////////////////////////////////////////////
#include "primitive_inst.h"
#include "generic_layer.hpp"
#include "intel_gpu/primitives/activation.hpp"
#include "intel_gpu/primitives/adaptive_pooling.hpp"
#include "intel_gpu/primitives/arg_max_min.hpp"
#include "intel_gpu/primitives/assign.hpp"
#include "intel_gpu/primitives/average_unpooling.hpp"
#include "intel_gpu/primitives/batch_to_space.hpp"
#include "intel_gpu/primitives/binary_convolution.hpp"
#include "intel_gpu/primitives/border.hpp"
#include "intel_gpu/primitives/broadcast.hpp"
#include "intel_gpu/primitives/bucketize.hpp"
#include "intel_gpu/primitives/concatenation.hpp"
#include "intel_gpu/primitives/condition.hpp"
#include "intel_gpu/primitives/convert_color.hpp"
#include "intel_gpu/primitives/convolution.hpp"
#include "intel_gpu/primitives/crop.hpp"
#include "intel_gpu/primitives/ctc_greedy_decoder.hpp"
#include "intel_gpu/primitives/ctc_loss.hpp"
#include "intel_gpu/primitives/cum_sum.hpp"
#include "intel_gpu/primitives/custom_gpu_primitive.hpp"
#include "intel_gpu/primitives/data.hpp"
#include "intel_gpu/primitives/deconvolution.hpp"
#include "intel_gpu/primitives/depth_to_space.hpp"
#include "intel_gpu/primitives/detection_output.hpp"
#include "intel_gpu/primitives/dft.hpp"
#include "intel_gpu/primitives/eltwise.hpp"
#include "intel_gpu/primitives/embedding_bag.hpp"
#include "intel_gpu/primitives/experimental_detectron_detection_output.hpp"
#include "intel_gpu/primitives/experimental_detectron_generate_proposals_single_image.hpp"
#include "intel_gpu/primitives/experimental_detectron_prior_grid_generator.hpp"
#include "intel_gpu/primitives/experimental_detectron_roi_feature_extractor.hpp"
#include "intel_gpu/primitives/experimental_detectron_topk_rois.hpp"
#include "intel_gpu/primitives/extract_image_patches.hpp"
#include "intel_gpu/primitives/eye.hpp"
#include "intel_gpu/primitives/fully_connected.hpp"
#include "intel_gpu/primitives/gather_elements.hpp"
#include "intel_gpu/primitives/gather_nd.hpp"
#include "intel_gpu/primitives/gather_tree.hpp"
#include "intel_gpu/primitives/gather.hpp"
#include "intel_gpu/primitives/gemm.hpp"
#include "intel_gpu/primitives/generate_proposals.hpp"
#include "intel_gpu/primitives/grn.hpp"
#include "intel_gpu/primitives/grn.hpp"
#include "intel_gpu/primitives/input_layout.hpp"
#include "intel_gpu/primitives/loop.hpp"
#include "intel_gpu/primitives/lrn.hpp"
#include "intel_gpu/primitives/lstm_dynamic_input.hpp"
#include "intel_gpu/primitives/lstm_dynamic_timeloop.hpp"
#include "intel_gpu/primitives/lstm_dynamic.hpp"
#include "intel_gpu/primitives/lstm.hpp"
#include "intel_gpu/primitives/multiclass_nms.hpp"
#include "intel_gpu/primitives/mutable_data.hpp"
#include "intel_gpu/primitives/mvn.hpp"
#include "intel_gpu/primitives/non_max_suppression.hpp"
#include "intel_gpu/primitives/non_zero.hpp"
#include "intel_gpu/primitives/normalize.hpp"
#include "intel_gpu/primitives/one_hot.hpp"
#include "intel_gpu/primitives/permute.hpp"
#include "intel_gpu/primitives/pooling.hpp"
#include "intel_gpu/primitives/prior_box.hpp"
#include "intel_gpu/primitives/proposal.hpp"
#include "intel_gpu/primitives/pyramid_roi_align.hpp"
#include "intel_gpu/primitives/quantize.hpp"
#include "intel_gpu/primitives/random_uniform.hpp"
#include "intel_gpu/primitives/range.hpp"
#include "intel_gpu/primitives/read_value.hpp"
#include "intel_gpu/primitives/reduce.hpp"
#include "intel_gpu/primitives/region_yolo.hpp"
#include "intel_gpu/primitives/reorder.hpp"
#include "intel_gpu/primitives/reorg_yolo.hpp"
#include "intel_gpu/primitives/resample.hpp"
#include "intel_gpu/primitives/reshape.hpp"
#include "intel_gpu/primitives/reverse_sequence.hpp"
#include "intel_gpu/primitives/reverse.hpp"
#include "intel_gpu/primitives/roi_align.hpp"
#include "intel_gpu/primitives/roi_pooling.hpp"
#include "intel_gpu/primitives/roll.hpp"
#include "intel_gpu/primitives/scatter_elements_update.hpp"
#include "intel_gpu/primitives/scatter_nd_update.hpp"
#include "intel_gpu/primitives/scatter_update.hpp"
#include "intel_gpu/primitives/select.hpp"
#include "intel_gpu/primitives/shape_of.hpp"
#include "intel_gpu/primitives/shuffle_channels.hpp"
#include "intel_gpu/primitives/slice.hpp"
#include "intel_gpu/primitives/softmax.hpp"
#include "intel_gpu/primitives/space_to_batch.hpp"
#include "intel_gpu/primitives/space_to_depth.hpp"
#include "intel_gpu/primitives/split.hpp"
#include "intel_gpu/primitives/strided_slice.hpp"
#include "intel_gpu/primitives/tile.hpp"
cldnn::primitive_type_id cldnn::get_type_id(std::string type_str) {
static std::unordered_map<std::string, primitive_type_id> primitive_inst_types = {
{"activation", cldnn::activation::type_id()},
{"adaptive_pooling", cldnn::adaptive_pooling::type_id()},
{"arg_max_min", cldnn::arg_max_min::type_id()},
{"assign", cldnn::assign::type_id()},
{"average_unpooling", cldnn::average_unpooling::type_id()},
{"binary_convolution", cldnn::binary_convolution::type_id()},
{"border", cldnn::border::type_id()},
{"broadcast", cldnn::broadcast::type_id()},
{"bucketize", cldnn::bucketize::type_id()},
{"batch_to_space", cldnn::batch_to_space::type_id()},
{"space_to_batch", cldnn::space_to_batch::type_id()},
{"concatenation", cldnn::concatenation::type_id()},
{"condition", cldnn::condition::type_id()},
{"convert_color", cldnn::convert_color::type_id()},
{"convolution", cldnn::convolution::type_id()},
{"count_nonzero", cldnn::count_nonzero::type_id()},
{"crop", cldnn::crop::type_id()},
{"ctc_greedy_decoder", cldnn::ctc_greedy_decoder::type_id()},
{"ctc_loss", cldnn::ctc_loss::type_id()},
{"cum_sum", cldnn::cum_sum::type_id()},
{"custom_gpu_primitive", cldnn::custom_gpu_primitive::type_id()},
{"data", cldnn::data::type_id()},
{"deconvolution", cldnn::deconvolution::type_id()},
{"deformable_conv", cldnn::deformable_conv::type_id()},
{"deformable_interp", cldnn::deformable_interp::type_id()},
{"depth_to_space", cldnn::depth_to_space::type_id()},
{"detection_output", cldnn::detection_output::type_id()},
{"dft", cldnn::dft::type_id()},
{"eltwise", cldnn::eltwise::type_id()},
{"embedding_bag", cldnn::embedding_bag::type_id()},
{"experimental_detectron_detection_output", cldnn::experimental_detectron_detection_output::type_id()},
{"experimental_detectron_generate_proposals_single_image", cldnn::experimental_detectron_generate_proposals_single_image::type_id()},
{"experimental_detectron_prior_grid_generator", cldnn::experimental_detectron_prior_grid_generator::type_id()},
{"experimental_detectron_roi_feature_extractor", cldnn::experimental_detectron_roi_feature_extractor::type_id()},
{"experimental_detectron_topk_rois", cldnn::experimental_detectron_topk_rois::type_id()},
{"extract_image_patches", cldnn::extract_image_patches::type_id()},
{"eye", cldnn::eye::type_id()},
{"fully_connected", cldnn::fully_connected::type_id()},
{"gather", cldnn::gather::type_id()},
{"gather_elements", cldnn::gather_elements::type_id()},
{"gather_nd", cldnn::gather_nd::type_id()},
{"gather_nonzero", cldnn::gather_nonzero::type_id()},
{"gather_tree", cldnn::gather_tree::type_id()},
{"gemm", cldnn::gemm::type_id()},
{"generate_proposals", cldnn::generate_proposals::type_id()},
{"generic_layer", cldnn::generic_layer::type_id()},
{"grn", cldnn::grn::type_id()},
{"input_layout", cldnn::input_layout::type_id()},
{"loop", cldnn::loop::type_id()},
{"lrn", cldnn::lrn::type_id()},
{"lstm", cldnn::lstm::type_id()},
{"lstm_dynamic", cldnn::lstm_dynamic::type_id()},
{"lstm_dynamic_input", cldnn::lstm_dynamic_input::type_id()},
{"lstm_dynamic_timeloop", cldnn::lstm_dynamic_timeloop::type_id()},
{"lstm_elt", cldnn::lstm_elt::type_id()},
{"lstm_gemm", cldnn::lstm_gemm::type_id()},
{"multiclass_nms", cldnn::multiclass_nms::type_id()},
{"mutable_data", cldnn::mutable_data::type_id()},
{"mvn", cldnn::mvn::type_id()},
{"non_max_suppression", cldnn::non_max_suppression::type_id()},
{"normalize", cldnn::normalize::type_id()},
{"one_hot", cldnn::one_hot::type_id()},
{"permute", cldnn::permute::type_id()},
{"pooling", cldnn::pooling::type_id()},
{"prior_box", cldnn::prior_box::type_id()},
{"proposal", cldnn::proposal::type_id()},
{"pyramid_roi_align", cldnn::pyramid_roi_align::type_id()},
{"quantize", cldnn::quantize::type_id()},
{"random_uniform", cldnn::random_uniform::type_id()},
{"range", cldnn::range::type_id()},
{"read_value", cldnn::read_value::type_id()},
{"reduce", cldnn::reduce::type_id()},
{"region_yolo", cldnn::region_yolo::type_id()},
{"reorder", cldnn::reorder::type_id()},
{"reorg_yolo", cldnn::reorg_yolo::type_id()},
{"resample", cldnn::resample::type_id()},
{"reshape", cldnn::reshape::type_id()},
{"reverse", cldnn::reverse::type_id()},
{"reverse_sequence", cldnn::reverse_sequence::type_id()},
{"roi_align", cldnn::roi_align::type_id()},
{"roi_pooling", cldnn::roi_pooling::type_id()},
{"roll", cldnn::roll::type_id()},
{"scatter_elements_update", cldnn::scatter_elements_update::type_id()},
{"scatter_nd_update", cldnn::scatter_nd_update::type_id()},
{"scatter_update", cldnn::scatter_update::type_id()},
{"select", cldnn::select::type_id()},
{"shape_of", cldnn::shape_of::type_id()},
{"shuffle_channels", cldnn::shuffle_channels::type_id()},
{"slice", cldnn::slice::type_id()},
{"softmax", cldnn::softmax::type_id()},
{"space_to_depth", cldnn::space_to_depth::type_id()},
{"split", cldnn::split::type_id()},
{"strided_slice", cldnn::strided_slice::type_id()},
{"tile", cldnn::tile::type_id()},
};
return primitive_inst_types[type_str];
}
@@ -9,11 +9,7 @@
#include "primitive_type_base.h"
namespace cldnn {
primitive_type_id grid_sample::type_id() {
static primitive_type_base<grid_sample> instance;
return &instance;
}
GPU_DEFINE_PRIMITIVE_TYPE_ID(grid_sample)
layout grid_sample_inst::calc_output_layout(const grid_sample_node& node, const kernel_impl_params& impl_param) {
const auto data_layout = impl_param.get_input_layout();
+1 -4
View File
@@ -8,10 +8,7 @@
#include <string>
namespace cldnn {
primitive_type_id grn::type_id() {
static primitive_type_base<grn> instance;
return &instance;
}
GPU_DEFINE_PRIMITIVE_TYPE_ID(grn)
layout grn_inst::calc_output_layout(grn_node const& node, kernel_impl_params const& impl_param) {
auto input_node_layout = impl_param.get_non_padded_input_layout();
@@ -13,6 +13,8 @@ namespace cldnn {
namespace common {
struct condition_impl : typed_primitive_impl<condition> {
DECLARE_OBJECT_TYPE_SERIALIZATION
std::unique_ptr<primitive_impl> clone() const override {
return make_unique<condition_impl>(*this);
}
@@ -135,3 +137,5 @@ attach_condition_common::attach_condition_common() {
} // namespace detail
} // namespace common
} // namespace cldnn
ASSIGN_TYPE_NAME(cldnn::common::condition_impl)
@@ -14,6 +14,8 @@
namespace cldnn {
namespace common {
struct loop_impl : typed_primitive_impl<loop> {
DECLARE_OBJECT_TYPE_SERIALIZATION
std::unique_ptr<primitive_impl> clone() const override {
return make_unique<loop_impl>(*this);
}
@@ -210,3 +212,5 @@ attach_loop_common::attach_loop_common() {
} // namespace common
} // namespace cldnn
ASSIGN_TYPE_NAME(cldnn::common::loop_impl)
@@ -8,7 +8,7 @@
#include "input_layout_inst.h"
#include "impls/implementation_map.hpp"
#include "register.hpp"
#include "serialization/binary_buffer.hpp"
#include "intel_gpu/graph/serialization/binary_buffer.hpp"
#include <vector>
namespace cldnn {
@@ -77,4 +77,4 @@ attach_prior_box_common::attach_prior_box_common() {
} // namespace common
} // namespace cldnn
BIND_BINARY_BUFFER_WITH_TYPE(cldnn::common::wait_for_events_impl, cldnn::object_type::WAIT_FOR_EVENTS_IMPL)
BIND_BINARY_BUFFER_WITH_TYPE(cldnn::common::wait_for_events_impl)
@@ -56,4 +56,4 @@ attach_assign_impl::attach_assign_impl() {
} // namespace cpu
} // namespace cldnn
BIND_BINARY_BUFFER_WITH_TYPE(cldnn::cpu::assign_impl, cldnn::object_type::ASSIGN_IMPL)
BIND_BINARY_BUFFER_WITH_TYPE(cldnn::cpu::assign_impl)
@@ -874,4 +874,4 @@ attach_detection_output_impl::attach_detection_output_impl() {
} // namespace cpu
} // namespace cldnn
BIND_BINARY_BUFFER_WITH_TYPE(cldnn::cpu::detection_output_impl, cldnn::object_type::DETECTION_OUTPUT_IMPL_CPU)
BIND_BINARY_BUFFER_WITH_TYPE(cldnn::cpu::detection_output_impl)
@@ -435,4 +435,4 @@ attach_non_max_suppression_impl::attach_non_max_suppression_impl() {
} // namespace cpu
} // namespace cldnn
BIND_BINARY_BUFFER_WITH_TYPE(cldnn::cpu::non_max_suppression_impl, cldnn::object_type::NON_MAX_SUPPRESSION_IMPL_CPU)
BIND_BINARY_BUFFER_WITH_TYPE(cldnn::cpu::non_max_suppression_impl)
@@ -461,4 +461,4 @@ attach_proposal_impl::attach_proposal_impl() {
} // namespace cpu
} // namespace cldnn
BIND_BINARY_BUFFER_WITH_TYPE(cldnn::cpu::proposal_impl, cldnn::object_type::PROPOSAL_IMPL_CPU)
BIND_BINARY_BUFFER_WITH_TYPE(cldnn::cpu::proposal_impl)
@@ -56,4 +56,4 @@ attach_read_value_impl::attach_read_value_impl() {
} // namespace cpu
} // namespace cldnn
BIND_BINARY_BUFFER_WITH_TYPE(cldnn::cpu::read_value_impl, cldnn::object_type::READ_VALUE_IMPL)
BIND_BINARY_BUFFER_WITH_TYPE(cldnn::cpu::read_value_impl)
@@ -156,4 +156,4 @@ attach_activation_impl::attach_activation_impl() {
} // namespace ocl
} // namespace cldnn
BIND_BINARY_BUFFER_WITH_TYPE(cldnn::ocl::activation_impl, cldnn::object_type::ACTIVATION_IMPL)
BIND_BINARY_BUFFER_WITH_TYPE(cldnn::ocl::activation_impl)
@@ -92,4 +92,4 @@ attach_adaptive_pooling_impl::attach_adaptive_pooling_impl() {
} // namespace ocl
} // namespace cldnn
BIND_BINARY_BUFFER_WITH_TYPE(cldnn::ocl::adaptive_pooling_impl, cldnn::object_type::ADAPTIVE_POOLING_IMPL)
BIND_BINARY_BUFFER_WITH_TYPE(cldnn::ocl::adaptive_pooling_impl)
@@ -126,4 +126,4 @@ attach_arg_max_min_impl::attach_arg_max_min_impl() {
} // namespace ocl
} // namespace cldnn
BIND_BINARY_BUFFER_WITH_TYPE(cldnn::ocl::arg_max_min_impl, cldnn::object_type::ARG_MAX_MIN_IMPL)
BIND_BINARY_BUFFER_WITH_TYPE(cldnn::ocl::arg_max_min_impl)
@@ -69,4 +69,4 @@ attach_average_unpooling_impl::attach_average_unpooling_impl() {
} // namespace ocl
} // namespace cldnn
BIND_BINARY_BUFFER_WITH_TYPE(cldnn::ocl::average_unpooling_impl, cldnn::object_type::AVERAGE_UNPOOLING_IMPL)
BIND_BINARY_BUFFER_WITH_TYPE(cldnn::ocl::average_unpooling_impl)
@@ -68,4 +68,4 @@ attach_batch_to_space_impl::attach_batch_to_space_impl() {
} // namespace ocl
} // namespace cldnn
BIND_BINARY_BUFFER_WITH_TYPE(cldnn::ocl::batch_to_space_impl, cldnn::object_type::BATCH_TO_SPACE_IMPL)
BIND_BINARY_BUFFER_WITH_TYPE(cldnn::ocl::batch_to_space_impl)
@@ -154,4 +154,4 @@ attach_binary_convolution_impl::attach_binary_convolution_impl() {
} // namespace ocl
} // namespace cldnn
BIND_BINARY_BUFFER_WITH_TYPE(cldnn::ocl::binary_convolution_impl, cldnn::object_type::BINARY_CONVOLUTION_IMPL)
BIND_BINARY_BUFFER_WITH_TYPE(cldnn::ocl::binary_convolution_impl)
@@ -166,4 +166,4 @@ attach_border_impl::attach_border_impl() {
} // namespace ocl
} // namespace cldnn
BIND_BINARY_BUFFER_WITH_TYPE(cldnn::ocl::border_impl, cldnn::object_type::BORDER_IMPL)
BIND_BINARY_BUFFER_WITH_TYPE(cldnn::ocl::border_impl)
@@ -168,4 +168,4 @@ attach_broadcast_impl::attach_broadcast_impl() {
} // namespace ocl
} // namespace cldnn
BIND_BINARY_BUFFER_WITH_TYPE(cldnn::ocl::broadcast_impl, cldnn::object_type::BROADCAST_IMPL)
BIND_BINARY_BUFFER_WITH_TYPE(cldnn::ocl::broadcast_impl)
@@ -70,4 +70,4 @@ attach_bucketize_impl::attach_bucketize_impl() {
} // namespace ocl
} // namespace cldnn
BIND_BINARY_BUFFER_WITH_TYPE(cldnn::ocl::bucketize_impl, cldnn::object_type::BUCKETIZE_IMPL)
BIND_BINARY_BUFFER_WITH_TYPE(cldnn::ocl::bucketize_impl)
@@ -201,4 +201,4 @@ attach_concatenation_impl::attach_concatenation_impl() {
} // namespace ocl
} // namespace cldnn
BIND_BINARY_BUFFER_WITH_TYPE(cldnn::ocl::concatenation_impl, cldnn::object_type::CONCATENATION_IMPL)
BIND_BINARY_BUFFER_WITH_TYPE(cldnn::ocl::concatenation_impl)
@@ -70,4 +70,4 @@ attach_convert_color_impl::attach_convert_color_impl() {
} // namespace ocl
} // namespace cldnn
BIND_BINARY_BUFFER_WITH_TYPE(cldnn::ocl::convert_color_impl, cldnn::object_type::CONVERT_COLOR_IMPL)
BIND_BINARY_BUFFER_WITH_TYPE(cldnn::ocl::convert_color_impl)
@@ -281,4 +281,4 @@ attach_convolution_impl::attach_convolution_impl() {
} // namespace ocl
} // namespace cldnn
BIND_BINARY_BUFFER_WITH_TYPE(cldnn::ocl::convolution_impl, cldnn::object_type::CONVOLUTION_IMPL)
BIND_BINARY_BUFFER_WITH_TYPE(cldnn::ocl::convolution_impl)
@@ -157,4 +157,4 @@ attach_crop_impl::attach_crop_impl() {
} // namespace ocl
} // namespace cldnn
BIND_BINARY_BUFFER_WITH_TYPE(cldnn::ocl::crop_impl, cldnn::object_type::CROP_IMPL)
BIND_BINARY_BUFFER_WITH_TYPE(cldnn::ocl::crop_impl)
@@ -62,4 +62,4 @@ attach_ctc_greedy_decoder_impl::attach_ctc_greedy_decoder_impl() {
} // namespace ocl
} // namespace cldnn
BIND_BINARY_BUFFER_WITH_TYPE(cldnn::ocl::ctc_greedy_decoder_impl, cldnn::object_type::CTC_GREEDY_DECODER_IMPL)
BIND_BINARY_BUFFER_WITH_TYPE(cldnn::ocl::ctc_greedy_decoder_impl)
@@ -57,4 +57,4 @@ attach_ctc_loss_impl::attach_ctc_loss_impl() {
} // namespace ocl
} // namespace cldnn
BIND_BINARY_BUFFER_WITH_TYPE(cldnn::ocl::ctc_loss_impl, cldnn::object_type::CTC_LOSS_IMPL)
BIND_BINARY_BUFFER_WITH_TYPE(cldnn::ocl::ctc_loss_impl)
@@ -96,4 +96,4 @@ attach_cum_sum_impl::attach_cum_sum_impl() {
} // namespace ocl
} // namespace cldnn
BIND_BINARY_BUFFER_WITH_TYPE(cldnn::ocl::cum_sum_impl, cldnn::object_type::CUM_SUM_IMPL)
BIND_BINARY_BUFFER_WITH_TYPE(cldnn::ocl::cum_sum_impl)
@@ -78,13 +78,17 @@ struct custom_gpu_primitive_impl : typed_primitive_impl<custom_gpu_primitive> {
args.inputs.push_back(dep->output_memory_ptr());
}
args.outputs = { instance.output_memory_ptr() };
return stream.enqueue_kernel(*_kernels.front(), cl_kernel.get()->params, args, events, instance.node->is_output());
return stream.enqueue_kernel(*_kernels.front(), cl_kernel.get()->params, args, events, instance.is_output());
}
std::vector<std::string> get_kernel_ids() override {
std::vector<std::string> get_kernel_ids() const override {
return {_kernel_id};
}
std::vector<kernel::ptr> get_kernels() const override {
return _kernels;
}
void save(BinaryOutputBuffer& ob) const override {
ob << *cl_kernel;
ob << _kernel_id;
@@ -258,4 +262,4 @@ attach_custom_gpu_primitive_impl::attach_custom_gpu_primitive_impl() {
} // namespace ocl
} // namespace cldnn
BIND_BINARY_BUFFER_WITH_TYPE(cldnn::ocl::custom_gpu_primitive_impl, cldnn::object_type::CUSTOM_GPU_PRIMITIVE_IMPL)
BIND_BINARY_BUFFER_WITH_TYPE(cldnn::ocl::custom_gpu_primitive_impl)
@@ -167,4 +167,4 @@ attach_deconvolution_impl::attach_deconvolution_impl() {
} // namespace ocl
} // namespace cldnn
BIND_BINARY_BUFFER_WITH_TYPE(cldnn::ocl::deconvolution_impl, cldnn::object_type::DECONVOLUTION_IMPL)
BIND_BINARY_BUFFER_WITH_TYPE(cldnn::ocl::deconvolution_impl)
@@ -192,5 +192,5 @@ attach_deformable_interp_impl::attach_deformable_interp_impl() {
} // namespace ocl
} // namespace cldnn
BIND_BINARY_BUFFER_WITH_TYPE(cldnn::ocl::deformable_conv_impl, cldnn::object_type::DEFORMABLE_CONV_IMPL)
BIND_BINARY_BUFFER_WITH_TYPE(cldnn::ocl::deformable_interp_impl, cldnn::object_type::DEFORMABLE_INTERP_IMPL)
BIND_BINARY_BUFFER_WITH_TYPE(cldnn::ocl::deformable_conv_impl)
BIND_BINARY_BUFFER_WITH_TYPE(cldnn::ocl::deformable_interp_impl)
@@ -64,4 +64,4 @@ attach_depth_to_space_impl::attach_depth_to_space_impl() {
} // namespace ocl
} // namespace cldnn
BIND_BINARY_BUFFER_WITH_TYPE(cldnn::ocl::depth_to_space_impl, cldnn::object_type::DEPTH_TO_SPACE_IMPL)
BIND_BINARY_BUFFER_WITH_TYPE(cldnn::ocl::depth_to_space_impl)
@@ -92,4 +92,4 @@ attach_detection_output_impl::attach_detection_output_impl() {
} // namespace ocl
} // namespace cldnn
BIND_BINARY_BUFFER_WITH_TYPE(cldnn::ocl::detection_output_impl, cldnn::object_type::DETECTION_OUTPUT_IMPL_OCL)
BIND_BINARY_BUFFER_WITH_TYPE(cldnn::ocl::detection_output_impl)
@@ -105,4 +105,4 @@ attach_dft_impl::attach_dft_impl() {
} // namespace ocl
} // namespace cldnn
BIND_BINARY_BUFFER_WITH_TYPE(cldnn::ocl::dft_impl, cldnn::object_type::DFT_IMPL)
BIND_BINARY_BUFFER_WITH_TYPE(cldnn::ocl::dft_impl)
@@ -278,4 +278,4 @@ attach_eltwise_impl::attach_eltwise_impl() {
} // namespace ocl
} // namespace cldnn
BIND_BINARY_BUFFER_WITH_TYPE(cldnn::ocl::eltwise_impl, cldnn::object_type::ELTWISE_IMPL)
BIND_BINARY_BUFFER_WITH_TYPE(cldnn::ocl::eltwise_impl)
@@ -69,4 +69,4 @@ attach_embedding_bag_impl::attach_embedding_bag_impl() {
} // namespace ocl
} // namespace cldnn
BIND_BINARY_BUFFER_WITH_TYPE(cldnn::ocl::embedding_bag_impl, cldnn::object_type::EMBEDDING_BAG_IMPL)
BIND_BINARY_BUFFER_WITH_TYPE(cldnn::ocl::embedding_bag_impl)
@@ -77,5 +77,4 @@ attach_experimental_detectron_detection_output_impl::attach_experimental_detectr
} // namespace ocl
} // namespace cldnn
BIND_BINARY_BUFFER_WITH_TYPE(cldnn::ocl::experimental_detectron_detection_output_impl,
cldnn::object_type::ACTIVATION_IMPL)
BIND_BINARY_BUFFER_WITH_TYPE(cldnn::ocl::experimental_detectron_detection_output_impl)
@@ -83,5 +83,4 @@ attach_experimental_detectron_generate_proposals_single_image_impl::attach_exper
} // namespace ocl
} // namespace cldnn
BIND_BINARY_BUFFER_WITH_TYPE(cldnn::ocl::experimental_detectron_generate_proposals_single_image_impl,
cldnn::object_type::EXPERIMENTAL_DETECTRON_GENERATE_PROPOSALS_SINGLE_IMAGE_IMPL)
BIND_BINARY_BUFFER_WITH_TYPE(cldnn::ocl::experimental_detectron_generate_proposals_single_image_impl)
@@ -64,5 +64,4 @@ attach_experimental_detectron_prior_grid_generator_impl::attach_experimental_det
} // namespace ocl
} // namespace cldnn
BIND_BINARY_BUFFER_WITH_TYPE(cldnn::ocl::experimental_detectron_prior_grid_generator_impl,
cldnn::object_type::EXPERIMENTAL_DETECTRON_PRIOR_GRID_GENERATOR_IMPL)
BIND_BINARY_BUFFER_WITH_TYPE(cldnn::ocl::experimental_detectron_prior_grid_generator_impl)
@@ -82,5 +82,4 @@ attach_experimental_detectron_roi_feature_extractor_impl::attach_experimental_de
} // namespace ocl
} // namespace cldnn
BIND_BINARY_BUFFER_WITH_TYPE(cldnn::ocl::experimental_detectron_roi_feature_extractor_impl,
cldnn::object_type::EXPERIMENTAL_DETECTRON_ROI_FEATURE_EXTRACTOR_IMPL)
BIND_BINARY_BUFFER_WITH_TYPE(cldnn::ocl::experimental_detectron_roi_feature_extractor_impl)
@@ -58,5 +58,4 @@ attach_experimental_detectron_topk_rois_impl::attach_experimental_detectron_topk
} // namespace ocl
} // namespace cldnn
BIND_BINARY_BUFFER_WITH_TYPE(cldnn::ocl::experimental_detectron_topk_rois_impl,
cldnn::object_type::EXPERIMENTAL_DETECTRON_TOPK_ROIS_IMPL)
BIND_BINARY_BUFFER_WITH_TYPE(cldnn::ocl::experimental_detectron_topk_rois_impl)
@@ -57,4 +57,4 @@ attach_extract_image_patches_impl::attach_extract_image_patches_impl() {
} // namespace ocl
} // namespace cldnn
BIND_BINARY_BUFFER_WITH_TYPE(cldnn::ocl::extract_image_patches_impl, cldnn::object_type::EXTRACT_IMAGE_PATCHES_IMPL)
BIND_BINARY_BUFFER_WITH_TYPE(cldnn::ocl::extract_image_patches_impl)
@@ -74,4 +74,4 @@ attach_eye_impl::attach_eye_impl() {
} // namespace ocl
} // namespace cldnn
BIND_BINARY_BUFFER_WITH_TYPE(cldnn::ocl::eye_impl, cldnn::object_type::EYE_IMPL)
BIND_BINARY_BUFFER_WITH_TYPE(cldnn::ocl::eye_impl)
Loaded 100 of 272 files, more files were not shown because too many files have changed in this diff. Show more