From 0b1e36600b549cf5a8ff9c32159bd544c1fa3dae Mon Sep 17 00:00:00 2001 From: Eddy Kim Date: Tue, 22 Nov 2022 18:43:50 +0900 Subject: [PATCH] [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 * 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 --- .../include/intel_gpu/graph/network.hpp | 2 +- .../graph}/serialization/binary_buffer.hpp | 19 +- .../intel_gpu/graph}/serialization/bind.hpp | 24 +- .../intel_gpu/graph}/serialization/buffer.hpp | 0 .../cl_kernel_data_serializer.hpp | 0 .../graph}/serialization/helpers.hpp | 0 .../serialization/layout_serializer.hpp | 49 ++- .../graph}/serialization/map_serializer.hpp | 0 .../serialization/polymorphic_serializer.hpp | 11 +- .../graph}/serialization/serializer.hpp | 0 .../graph}/serialization/set_serializer.hpp | 0 .../graph}/serialization/static_instance.hpp | 0 .../serialization/string_serializer.hpp | 0 .../serialization/vector_serializer.hpp | 0 .../intel_gpu/plugin/compiled_model.hpp | 4 +- .../intel_gpu/primitives/primitive.hpp | 24 ++ .../intel_gpu/src/graph/activation.cpp | 5 +- .../intel_gpu/src/graph/adaptive_pooling.cpp | 5 +- .../intel_gpu/src/graph/arg_max_min.cpp | 5 +- src/plugins/intel_gpu/src/graph/assign.cpp | 6 +- .../intel_gpu/src/graph/average_unpooling.cpp | 5 +- .../intel_gpu/src/graph/batch_to_space.cpp | 5 +- .../src/graph/binary_convolution.cpp | 5 +- src/plugins/intel_gpu/src/graph/border.cpp | 5 +- src/plugins/intel_gpu/src/graph/broadcast.cpp | 5 +- src/plugins/intel_gpu/src/graph/bucketize.cpp | 6 +- .../intel_gpu/src/graph/concatenation.cpp | 5 +- src/plugins/intel_gpu/src/graph/condition.cpp | 6 +- .../intel_gpu/src/graph/convert_color.cpp | 5 +- .../intel_gpu/src/graph/convolution.cpp | 5 +- src/plugins/intel_gpu/src/graph/crop.cpp | 5 +- .../src/graph/ctc_greedy_decoder.cpp | 5 +- src/plugins/intel_gpu/src/graph/ctc_loss.cpp | 6 +- src/plugins/intel_gpu/src/graph/cum_sum.cpp | 5 +- .../src/graph/custom_gpu_primitive.cpp | 6 +- src/plugins/intel_gpu/src/graph/data.cpp | 49 ++- .../intel_gpu/src/graph/deconvolution.cpp | 5 +- .../src/graph/deformable_convolution.cpp | 10 +- .../intel_gpu/src/graph/depth_to_space.cpp | 5 +- .../intel_gpu/src/graph/detection_output.cpp | 15 +- src/plugins/intel_gpu/src/graph/dft.cpp | 6 +- src/plugins/intel_gpu/src/graph/eltwise.cpp | 5 +- .../intel_gpu/src/graph/embedding_bag.cpp | 5 +- ...xperimental_detectron_detection_output.cpp | 5 +- ...tectron_generate_proposal_single_image.cpp | 5 +- ...imental_detectron_prior_grid_generator.cpp | 6 +- ...mental_detectron_roi_feature_extractor.cpp | 5 +- .../experimental_detectron_topk_rois.cpp | 6 +- .../src/graph/extract_image_patches.cpp | 5 +- src/plugins/intel_gpu/src/graph/eye.cpp | 6 +- .../intel_gpu/src/graph/fully_connected.cpp | 5 +- src/plugins/intel_gpu/src/graph/gather.cpp | 5 +- .../intel_gpu/src/graph/gather_elements.cpp | 5 +- src/plugins/intel_gpu/src/graph/gather_nd.cpp | 5 +- .../intel_gpu/src/graph/gather_tree.cpp | 5 +- src/plugins/intel_gpu/src/graph/gemm.cpp | 5 +- .../src/graph/generate_proposals.cpp | 5 +- .../intel_gpu/src/graph/generic_layer.cpp | 6 +- .../intel_gpu/src/graph/get_type_id.cpp | 198 ----------- .../intel_gpu/src/graph/grid_sample.cpp | 6 +- src/plugins/intel_gpu/src/graph/grn.cpp | 5 +- .../src/graph/impls/common/condition.cpp | 4 + .../intel_gpu/src/graph/impls/common/loop.cpp | 4 + .../graph/impls/common/wait_for_events.cpp | 4 +- .../intel_gpu/src/graph/impls/cpu/assign.cpp | 2 +- .../src/graph/impls/cpu/detection_output.cpp | 2 +- .../graph/impls/cpu/non_max_suppression.cpp | 2 +- .../src/graph/impls/cpu/proposal.cpp | 2 +- .../src/graph/impls/cpu/read_value.cpp | 2 +- .../src/graph/impls/ocl/activation.cpp | 2 +- .../src/graph/impls/ocl/adaptive_pooling.cpp | 2 +- .../src/graph/impls/ocl/arg_max_min.cpp | 2 +- .../src/graph/impls/ocl/average_unpooling.cpp | 2 +- .../src/graph/impls/ocl/batch_to_space.cpp | 2 +- .../graph/impls/ocl/binary_convolution.cpp | 2 +- .../intel_gpu/src/graph/impls/ocl/border.cpp | 2 +- .../src/graph/impls/ocl/broadcast.cpp | 2 +- .../src/graph/impls/ocl/bucketize.cpp | 2 +- .../src/graph/impls/ocl/concatenation.cpp | 2 +- .../src/graph/impls/ocl/convert_color.cpp | 2 +- .../src/graph/impls/ocl/convolution.cpp | 2 +- .../intel_gpu/src/graph/impls/ocl/crop.cpp | 2 +- .../graph/impls/ocl/ctc_greedy_decoder.cpp | 2 +- .../src/graph/impls/ocl/ctc_loss.cpp | 2 +- .../intel_gpu/src/graph/impls/ocl/cum_sum.cpp | 2 +- .../src/graph/impls/ocl/custom_primitive.cpp | 10 +- .../src/graph/impls/ocl/deconvolution.cpp | 2 +- .../impls/ocl/deformable_convolution.cpp | 4 +- .../src/graph/impls/ocl/depth_to_space.cpp | 2 +- .../src/graph/impls/ocl/detection_output.cpp | 2 +- .../intel_gpu/src/graph/impls/ocl/dft.cpp | 2 +- .../intel_gpu/src/graph/impls/ocl/eltwise.cpp | 2 +- .../src/graph/impls/ocl/embedding_bag.cpp | 2 +- ...xperimental_detectron_detection_output.cpp | 3 +- ...ectron_generate_proposals_single_image.cpp | 3 +- ...imental_detectron_prior_grid_generator.cpp | 3 +- ...mental_detectron_roi_feature_extractor.cpp | 3 +- .../ocl/experimental_detectron_topk_rois.cpp | 3 +- .../graph/impls/ocl/extract_image_patches.cpp | 2 +- .../intel_gpu/src/graph/impls/ocl/eye.cpp | 2 +- .../src/graph/impls/ocl/fully_connected.cpp | 2 +- .../intel_gpu/src/graph/impls/ocl/gather.cpp | 2 +- .../src/graph/impls/ocl/gather_elements.cpp | 2 +- .../src/graph/impls/ocl/gather_nd.cpp | 2 +- .../src/graph/impls/ocl/gather_tree.cpp | 2 +- .../intel_gpu/src/graph/impls/ocl/gemm.cpp | 2 +- .../graph/impls/ocl/generate_proposals.cpp | 2 +- .../src/graph/impls/ocl/generic_layer.cpp | 4 +- .../src/graph/impls/ocl/grid_sample.cpp | 2 +- .../intel_gpu/src/graph/impls/ocl/grn.cpp | 2 +- .../intel_gpu/src/graph/impls/ocl/lrn.cpp | 2 +- .../graph/impls/ocl/lstm_dynamic_input.cpp | 2 +- .../graph/impls/ocl/lstm_dynamic_timeloop.cpp | 2 +- .../src/graph/impls/ocl/lstm_elt.cpp | 2 +- .../src/graph/impls/ocl/lstm_gemm.cpp | 2 +- .../src/graph/impls/ocl/matrix_nms.cpp | 4 + .../src/graph/impls/ocl/multiclass_nms.cpp | 2 +- .../src/graph/impls/ocl/mutable_data.cpp | 2 +- .../intel_gpu/src/graph/impls/ocl/mvn.cpp | 2 +- .../graph/impls/ocl/non_max_suppression.cpp | 2 +- .../src/graph/impls/ocl/non_zero.cpp | 4 +- .../src/graph/impls/ocl/normalize.cpp | 2 +- .../intel_gpu/src/graph/impls/ocl/one_hot.cpp | 2 +- .../intel_gpu/src/graph/impls/ocl/permute.cpp | 2 +- .../intel_gpu/src/graph/impls/ocl/pooling.cpp | 2 +- .../src/graph/impls/ocl/primitive_base.hpp | 22 +- .../src/graph/impls/ocl/prior_box.cpp | 2 +- .../src/graph/impls/ocl/pyramid_roi_align.cpp | 2 +- .../src/graph/impls/ocl/quantize.cpp | 2 +- .../src/graph/impls/ocl/random_uniform.cpp | 2 +- .../intel_gpu/src/graph/impls/ocl/range.cpp | 2 +- .../intel_gpu/src/graph/impls/ocl/reduce.cpp | 2 +- .../src/graph/impls/ocl/region_yolo.cpp | 2 +- .../intel_gpu/src/graph/impls/ocl/reorder.cpp | 2 +- .../src/graph/impls/ocl/reorg_yolo.cpp | 2 +- .../src/graph/impls/ocl/resample.cpp | 2 +- .../intel_gpu/src/graph/impls/ocl/reshape.cpp | 2 +- .../intel_gpu/src/graph/impls/ocl/reverse.cpp | 2 +- .../src/graph/impls/ocl/reverse_sequence.cpp | 2 +- .../src/graph/impls/ocl/roi_align.cpp | 2 +- .../src/graph/impls/ocl/roi_pooling.cpp | 2 +- .../intel_gpu/src/graph/impls/ocl/roll.cpp | 2 +- .../impls/ocl/scatter_elements_update.cpp | 3 +- .../src/graph/impls/ocl/scatter_nd_update.cpp | 2 +- .../src/graph/impls/ocl/scatter_update.cpp | 2 +- .../intel_gpu/src/graph/impls/ocl/select.cpp | 2 +- .../src/graph/impls/ocl/shape_of.cpp | 2 +- .../src/graph/impls/ocl/shuffle_channels.cpp | 2 +- .../intel_gpu/src/graph/impls/ocl/slice.cpp | 2 +- .../intel_gpu/src/graph/impls/ocl/softmax.cpp | 2 +- .../src/graph/impls/ocl/space_to_batch.cpp | 2 +- .../src/graph/impls/ocl/space_to_depth.cpp | 2 +- .../src/graph/impls/ocl/strided_slice.cpp | 2 +- .../intel_gpu/src/graph/impls/ocl/tile.cpp | 2 +- .../impls/onednn/concatenation_onednn.cpp | 2 +- .../graph/impls/onednn/convolution_onednn.cpp | 2 +- .../impls/onednn/deconvolution_onednn.cpp | 2 +- .../impls/onednn/fully_connected_onednn.cpp | 2 +- .../src/graph/impls/onednn/gemm_onednn.cpp | 2 +- .../src/graph/impls/onednn/pooling_onednn.cpp | 2 +- .../impls/onednn/primitive_onednn_base.h | 6 +- .../graph/impls/onednn/reduction_onednn.cpp | 2 +- .../src/graph/impls/onednn/reorder_onednn.cpp | 2 +- .../intel_gpu/src/graph/include/data_inst.h | 2 + .../graph/include/kernel_selector_helper.h | 2 +- .../src/graph/include/mutable_data_inst.h | 5 +- .../src/graph/include/primitive_inst.h | 22 +- .../include/serialization/object_types.hpp | 120 ------- .../intel_gpu/src/graph/input_layout.cpp | 5 +- .../src/graph/kernel_selector_helper.cpp | 6 +- src/plugins/intel_gpu/src/graph/loop.cpp | 5 +- src/plugins/intel_gpu/src/graph/lrn.cpp | 5 +- src/plugins/intel_gpu/src/graph/lstm.cpp | 5 +- .../intel_gpu/src/graph/lstm_dynamic.cpp | 5 +- .../src/graph/lstm_dynamic_input.cpp | 5 +- .../src/graph/lstm_dynamic_timeloop.cpp | 5 +- src/plugins/intel_gpu/src/graph/lstm_elt.cpp | 5 +- src/plugins/intel_gpu/src/graph/lstm_gemm.cpp | 5 +- .../intel_gpu/src/graph/matrix_nms.cpp | 5 +- .../intel_gpu/src/graph/multiclass_nms.cpp | 5 +- .../intel_gpu/src/graph/mutable_data.cpp | 37 +- src/plugins/intel_gpu/src/graph/mvn.cpp | 5 +- src/plugins/intel_gpu/src/graph/network.cpp | 56 +-- .../src/graph/non_max_suppression.cpp | 5 +- src/plugins/intel_gpu/src/graph/non_zero.cpp | 10 +- src/plugins/intel_gpu/src/graph/normalize.cpp | 5 +- src/plugins/intel_gpu/src/graph/one_hot.cpp | 5 +- src/plugins/intel_gpu/src/graph/permute.cpp | 6 +- src/plugins/intel_gpu/src/graph/pooling.cpp | 5 +- .../intel_gpu/src/graph/primitive_inst.cpp | 322 +++++++++--------- src/plugins/intel_gpu/src/graph/prior_box.cpp | 5 +- src/plugins/intel_gpu/src/graph/program.cpp | 3 +- src/plugins/intel_gpu/src/graph/proposal.cpp | 5 +- .../intel_gpu/src/graph/pyramid_roi_align.cpp | 5 +- src/plugins/intel_gpu/src/graph/quantize.cpp | 5 +- .../intel_gpu/src/graph/random_uniform.cpp | 6 +- src/plugins/intel_gpu/src/graph/range.cpp | 5 +- .../intel_gpu/src/graph/read_value.cpp | 6 +- src/plugins/intel_gpu/src/graph/reduce.cpp | 5 +- .../intel_gpu/src/graph/region_yolo.cpp | 5 +- src/plugins/intel_gpu/src/graph/reorder.cpp | 9 +- .../intel_gpu/src/graph/reorg_yolo.cpp | 5 +- src/plugins/intel_gpu/src/graph/resample.cpp | 5 +- src/plugins/intel_gpu/src/graph/reshape.cpp | 6 +- src/plugins/intel_gpu/src/graph/reverse.cpp | 5 +- .../intel_gpu/src/graph/reverse_sequence.cpp | 5 +- src/plugins/intel_gpu/src/graph/roi_align.cpp | 6 +- .../intel_gpu/src/graph/roi_pooling.cpp | 5 +- src/plugins/intel_gpu/src/graph/roll.cpp | 6 +- .../src/graph/scatter_elements_update.cpp | 5 +- .../intel_gpu/src/graph/scatter_nd_update.cpp | 6 +- .../intel_gpu/src/graph/scatter_update.cpp | 5 +- src/plugins/intel_gpu/src/graph/select.cpp | 5 +- src/plugins/intel_gpu/src/graph/shape_of.cpp | 5 +- .../intel_gpu/src/graph/shuffle_channels.cpp | 5 +- src/plugins/intel_gpu/src/graph/slice.cpp | 6 +- src/plugins/intel_gpu/src/graph/softmax.cpp | 5 +- .../intel_gpu/src/graph/space_to_batch.cpp | 5 +- .../intel_gpu/src/graph/space_to_depth.cpp | 5 +- src/plugins/intel_gpu/src/graph/split.cpp | 5 +- .../intel_gpu/src/graph/strided_slice.cpp | 5 +- src/plugins/intel_gpu/src/graph/tile.cpp | 5 +- .../intel_gpu/src/plugin/compiled_model.cpp | 12 +- src/plugins/intel_gpu/src/plugin/graph.cpp | 15 +- src/plugins/intel_gpu/src/plugin/plugin.cpp | 17 + .../intel_gpu/src/runtime/CMakeLists.txt | 3 +- .../intel_gpu/src/runtime/kernels_cache.cpp | 26 +- .../intel_gpu/src/runtime/kernels_cache.hpp | 3 +- .../test_cases/activation_simple_gpu_test.cpp | 65 +++- .../adaptive_avg_pooling_gpu_test.cpp | 64 +++- .../adaptive_max_pooling_gpu_test.cpp | 68 +++- .../test_cases/add_reorders_gpu_test.cpp | 45 ++- .../tests/test_cases/arg_max_gpu_test.cpp | 76 ++++- .../test_cases/average_unpooling_gpu_test.cpp | 36 +- .../test_cases/batch_to_space_gpu_test.cpp | 38 ++- .../binary_convolution_gpu_test.cpp | 130 ++++--- .../tests/test_cases/border_gpu_test.cpp | 57 +++- .../tests/test_cases/broadcast_gpu_test.cpp | 30 +- .../tests/test_cases/bucketize_gpu_test.cpp | 41 ++- .../tests/test_cases/cl_mem_input_test.cpp | 41 ++- .../tests/test_cases/command_queue_test.cpp | 37 +- .../test_cases/concatenation_gpu_test.cpp | 168 +++++---- .../test_cases/convert_color_gpu_test.cpp | 41 ++- .../tests/test_cases/convolution_gpu_test.cpp | 47 ++- .../tests/test_cases/crop_gpu_test.cpp | 38 ++- .../tests/test_cases/ctc_loss_gpu_test.cpp | 42 ++- .../tests/test_cases/cum_sum_gpu_test.cpp | 46 ++- .../test_cases/custom_gpu_primitive_test.cpp | 44 ++- .../test_cases/deconvolution_gpu_test.cpp | 39 ++- .../test_cases/depth_concatenate_gpu_test.cpp | 41 ++- .../test_cases/depth_to_space_gpu_test.cpp | 39 ++- .../test_cases/detection_output_test.cpp | 36 +- .../tests/test_cases/dft_gpu_test.cpp | 46 ++- .../tests/test_cases/eltwise_gpu_test.cpp | 50 ++- .../test_cases/embedding_bag_gpu_test.cpp | 42 ++- ...al_detectron_detection_output_gpu_test.cpp | 57 +++- ...nerate_proposals_single_image_gpu_test.cpp | 62 +++- ...etectron_prior_grid_generator_gpu_test.cpp | 46 ++- ...tectron_roi_feature_extractor_gpu_test.cpp | 49 ++- ...erimental_detectron_topk_rois_gpu_test.cpp | 61 +++- .../extract_image_patches_gpu_test.cpp | 49 ++- .../intel_gpu/tests/test_cases/eye.cpp | 63 +++- .../test_cases/fully_connected_gpu_test.cpp | 61 +++- .../test_cases/gather_elements_gpu_test.cpp | 127 ++++++- .../tests/test_cases/gather_gpu_test.cpp | 42 ++- .../tests/test_cases/gather_nd_gpu_test.cpp | 68 +++- .../tests/test_cases/gather_tree_gpu_test.cpp | 56 ++- .../generate_proposals_gpu_test.cpp | 66 +++- .../intel_gpu/tests/test_utils/network_test.h | 42 ++- .../intel_gpu/tests/test_utils/test_utils.cpp | 8 +- .../intel_gpu/tests/test_utils/test_utils.h | 20 ++ .../intel_gpu/thirdparty/CMakeLists.txt | 2 +- 272 files changed, 2486 insertions(+), 1630 deletions(-) rename src/plugins/intel_gpu/{src/graph/include => include/intel_gpu/graph}/serialization/binary_buffer.hpp (81%) rename src/plugins/intel_gpu/{src/graph/include => include/intel_gpu/graph}/serialization/bind.hpp (86%) rename src/plugins/intel_gpu/{src/graph/include => include/intel_gpu/graph}/serialization/buffer.hpp (100%) rename src/plugins/intel_gpu/{src/graph/include => include/intel_gpu/graph}/serialization/cl_kernel_data_serializer.hpp (100%) rename src/plugins/intel_gpu/{src/graph/include => include/intel_gpu/graph}/serialization/helpers.hpp (100%) rename src/plugins/intel_gpu/{src/graph/include => include/intel_gpu/graph}/serialization/layout_serializer.hpp (58%) rename src/plugins/intel_gpu/{src/graph/include => include/intel_gpu/graph}/serialization/map_serializer.hpp (100%) rename src/plugins/intel_gpu/{src/graph/include => include/intel_gpu/graph}/serialization/polymorphic_serializer.hpp (86%) rename src/plugins/intel_gpu/{src/graph/include => include/intel_gpu/graph}/serialization/serializer.hpp (100%) rename src/plugins/intel_gpu/{src/graph/include => include/intel_gpu/graph}/serialization/set_serializer.hpp (100%) rename src/plugins/intel_gpu/{src/graph/include => include/intel_gpu/graph}/serialization/static_instance.hpp (100%) rename src/plugins/intel_gpu/{src/graph/include => include/intel_gpu/graph}/serialization/string_serializer.hpp (100%) rename src/plugins/intel_gpu/{src/graph/include => include/intel_gpu/graph}/serialization/vector_serializer.hpp (100%) delete mode 100644 src/plugins/intel_gpu/src/graph/get_type_id.cpp delete mode 100644 src/plugins/intel_gpu/src/graph/include/serialization/object_types.hpp diff --git a/src/plugins/intel_gpu/include/intel_gpu/graph/network.hpp b/src/plugins/intel_gpu/include/intel_gpu/graph/network.hpp index bc74f0fb350c4f..c072e8bbf2ab18 100644 --- a/src/plugins/intel_gpu/include/intel_gpu/graph/network.hpp +++ b/src/plugins/intel_gpu/include/intel_gpu/graph/network.hpp @@ -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 #include diff --git a/src/plugins/intel_gpu/src/graph/include/serialization/binary_buffer.hpp b/src/plugins/intel_gpu/include/intel_gpu/graph/serialization/binary_buffer.hpp similarity index 81% rename from src/plugins/intel_gpu/src/graph/include/serialization/binary_buffer.hpp rename to src/plugins/intel_gpu/include/intel_gpu/graph/serialization/binary_buffer.hpp index 1d211cc6d5caf4..84563bc8ead854 100644 --- a/src/plugins/intel_gpu/src/graph/include/serialization/binary_buffer.hpp +++ b/src/plugins/intel_gpu/include/intel_gpu/graph/serialization/binary_buffer.hpp @@ -19,9 +19,8 @@ class BinaryOutputBuffer : public OutputBuffer { void write(void const * data, std::streamsize size) { auto const written_size = stream.rdbuf()->sputn(reinterpret_cast(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 @@ class BinaryInputBuffer : public InputBuffer { void read(void* const data, std::streamsize size) { auto const read_size = stream.rdbuf()->sgetn(reinterpret_cast(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 @@ class Serializer> { } // 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) \ } diff --git a/src/plugins/intel_gpu/src/graph/include/serialization/bind.hpp b/src/plugins/intel_gpu/include/intel_gpu/graph/serialization/bind.hpp similarity index 86% rename from src/plugins/intel_gpu/src/graph/include/serialization/bind.hpp rename to src/plugins/intel_gpu/include/intel_gpu/graph/serialization/bind.hpp index 9002eaf209373a..67c98b087c787c 100644 --- a/src/plugins/intel_gpu/src/graph/include/serialization/bind.hpp +++ b/src/plugins/intel_gpu/include/intel_gpu/graph/serialization/bind.hpp @@ -10,11 +10,10 @@ #include #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& bind_creator::creator = \ static_instance>::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 - std::size_t operator()(T t) const { return static_cast(t); } -}; - namespace cldnn { template struct saver_storage { using save_function = std::function; - using value_type = typename std::unordered_map::value_type; + using value_type = typename std::unordered_map::value_type; static saver_storage& instance() { static saver_storage 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 @@ struct saver_storage { saver_storage(const saver_storage&) = delete; void operator=(const saver_storage&) = delete; - std::unordered_map map; + std::unordered_map map; }; template @@ -67,14 +59,14 @@ struct void_deleter { template struct loader_storage { - using value_type = typename std::unordered_map::value_type; + using value_type = typename std::unordered_map::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 @@ struct loader_storage { loader_storage(const loader_storage&) = delete; void operator=(const loader_storage&) = delete; - std::unordered_map map; + std::unordered_map map; }; template diff --git a/src/plugins/intel_gpu/src/graph/include/serialization/buffer.hpp b/src/plugins/intel_gpu/include/intel_gpu/graph/serialization/buffer.hpp similarity index 100% rename from src/plugins/intel_gpu/src/graph/include/serialization/buffer.hpp rename to src/plugins/intel_gpu/include/intel_gpu/graph/serialization/buffer.hpp diff --git a/src/plugins/intel_gpu/src/graph/include/serialization/cl_kernel_data_serializer.hpp b/src/plugins/intel_gpu/include/intel_gpu/graph/serialization/cl_kernel_data_serializer.hpp similarity index 100% rename from src/plugins/intel_gpu/src/graph/include/serialization/cl_kernel_data_serializer.hpp rename to src/plugins/intel_gpu/include/intel_gpu/graph/serialization/cl_kernel_data_serializer.hpp diff --git a/src/plugins/intel_gpu/src/graph/include/serialization/helpers.hpp b/src/plugins/intel_gpu/include/intel_gpu/graph/serialization/helpers.hpp similarity index 100% rename from src/plugins/intel_gpu/src/graph/include/serialization/helpers.hpp rename to src/plugins/intel_gpu/include/intel_gpu/graph/serialization/helpers.hpp diff --git a/src/plugins/intel_gpu/src/graph/include/serialization/layout_serializer.hpp b/src/plugins/intel_gpu/include/intel_gpu/graph/serialization/layout_serializer.hpp similarity index 58% rename from src/plugins/intel_gpu/src/graph/include/serialization/layout_serializer.hpp rename to src/plugins/intel_gpu/include/intel_gpu/graph/serialization/layout_serializer.hpp index 31c1ebdc68f8ad..a73c1c7d0c20d7 100644 --- a/src/plugins/intel_gpu/src/graph/include/serialization/layout_serializer.hpp +++ b/src/plugins/intel_gpu/include/intel_gpu/graph/serialization/layout_serializer.hpp @@ -12,6 +12,33 @@ #include "intel_gpu/runtime/layout.hpp" namespace cldnn { +template +class Serializer, BufferType>::value>::type> { +public: + static void save(BufferType& buffer, const ov::PartialShape& partial_shape) { + std::vector 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 +class Serializer, 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 class Serializer, BufferType>::value>::type> { public: @@ -21,15 +48,7 @@ class Serializer _sizes = _layout.get_tensor().sizes(_layout.format); - // Temp WA for bs_x_bsv16 - if (_layout.format == cldnn::format::bs_x_bsv16) { - std::vector _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 @@ class Serializer _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); } }; diff --git a/src/plugins/intel_gpu/src/graph/include/serialization/map_serializer.hpp b/src/plugins/intel_gpu/include/intel_gpu/graph/serialization/map_serializer.hpp similarity index 100% rename from src/plugins/intel_gpu/src/graph/include/serialization/map_serializer.hpp rename to src/plugins/intel_gpu/include/intel_gpu/graph/serialization/map_serializer.hpp diff --git a/src/plugins/intel_gpu/src/graph/include/serialization/polymorphic_serializer.hpp b/src/plugins/intel_gpu/include/intel_gpu/graph/serialization/polymorphic_serializer.hpp similarity index 86% rename from src/plugins/intel_gpu/src/graph/include/serialization/polymorphic_serializer.hpp rename to src/plugins/intel_gpu/include/intel_gpu/graph/serialization/polymorphic_serializer.hpp index b6d7dd730eb186..e85ef7f6150066 100644 --- a/src/plugins/intel_gpu/src/graph/include/serialization/polymorphic_serializer.hpp +++ b/src/plugins/intel_gpu/include/intel_gpu/graph/serialization/polymorphic_serializer.hpp @@ -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, typename std::enable_if& ptr) { const auto& type = ptr->get_type(); - buffer << cldnn::make_data(&type, sizeof(object_type)); + buffer << type; const auto save_func = saver_storage::instance().get_save_function(type); save_func(buffer, ptr.get()); } @@ -31,8 +30,8 @@ template class Serializer, typename std::enable_if, BufferType>::value>::type> { public: static void load(BufferType& buffer, std::unique_ptr& ptr, engine& engine) { - object_type type; - buffer >> cldnn::make_data(&type, sizeof(object_type)); + std::string type; + buffer >> type; const auto load_func = dif::instance().get_load_function(type); std::unique_ptr> result; load_func(buffer, result, engine); @@ -40,8 +39,8 @@ class Serializer, typename std::enable_if& ptr) { - object_type type; - buffer >> cldnn::make_data(&type, sizeof(object_type)); + std::string type; + buffer >> type; const auto load_func = def::instance().get_load_function(type); std::unique_ptr> result; load_func(buffer, result); diff --git a/src/plugins/intel_gpu/src/graph/include/serialization/serializer.hpp b/src/plugins/intel_gpu/include/intel_gpu/graph/serialization/serializer.hpp similarity index 100% rename from src/plugins/intel_gpu/src/graph/include/serialization/serializer.hpp rename to src/plugins/intel_gpu/include/intel_gpu/graph/serialization/serializer.hpp diff --git a/src/plugins/intel_gpu/src/graph/include/serialization/set_serializer.hpp b/src/plugins/intel_gpu/include/intel_gpu/graph/serialization/set_serializer.hpp similarity index 100% rename from src/plugins/intel_gpu/src/graph/include/serialization/set_serializer.hpp rename to src/plugins/intel_gpu/include/intel_gpu/graph/serialization/set_serializer.hpp diff --git a/src/plugins/intel_gpu/src/graph/include/serialization/static_instance.hpp b/src/plugins/intel_gpu/include/intel_gpu/graph/serialization/static_instance.hpp similarity index 100% rename from src/plugins/intel_gpu/src/graph/include/serialization/static_instance.hpp rename to src/plugins/intel_gpu/include/intel_gpu/graph/serialization/static_instance.hpp diff --git a/src/plugins/intel_gpu/src/graph/include/serialization/string_serializer.hpp b/src/plugins/intel_gpu/include/intel_gpu/graph/serialization/string_serializer.hpp similarity index 100% rename from src/plugins/intel_gpu/src/graph/include/serialization/string_serializer.hpp rename to src/plugins/intel_gpu/include/intel_gpu/graph/serialization/string_serializer.hpp diff --git a/src/plugins/intel_gpu/src/graph/include/serialization/vector_serializer.hpp b/src/plugins/intel_gpu/include/intel_gpu/graph/serialization/vector_serializer.hpp similarity index 100% rename from src/plugins/intel_gpu/src/graph/include/serialization/vector_serializer.hpp rename to src/plugins/intel_gpu/include/intel_gpu/graph/serialization/vector_serializer.hpp diff --git a/src/plugins/intel_gpu/include/intel_gpu/plugin/compiled_model.hpp b/src/plugins/intel_gpu/include/intel_gpu/plugin/compiled_model.hpp index 09aa0a03bf7cb2..ab82970a24da50 100644 --- a/src/plugins/intel_gpu/include/intel_gpu/plugin/compiled_model.hpp +++ b/src/plugins/intel_gpu/include/intel_gpu/plugin/compiled_model.hpp @@ -28,7 +28,6 @@ class CompiledModel : public InferenceEngine::ExecutableNetworkThreadSafeDefault CompiledModel(std::istream& networkModel, std::shared_ptr context, Config config); void Export(std::ostream& networkModel) override; - bool isSerializable(); std::shared_ptr GetExecGraphInfo() override; InferenceEngine::IInferRequestInternal::Ptr CreateInferRequest() override; InferenceEngine::IInferRequestInternal::Ptr CreateInferRequestImpl(InferenceEngine::InputsDataMap networkInputs, @@ -47,6 +46,9 @@ class CompiledModel : public InferenceEngine::ExecutableNetworkThreadSafeDefault Config m_config; InferenceEngine::ITaskExecutor::Ptr m_taskExecutor; InferenceEngine::ITaskExecutor::Ptr m_waitExecutor; + +private: + bool is_serializable(); }; } // namespace intel_gpu diff --git a/src/plugins/intel_gpu/include/intel_gpu/primitives/primitive.hpp b/src/plugins/intel_gpu/include/intel_gpu/primitives/primitive.hpp index 5f3caabec22d24..643c5e1b0e7577 100644 --- a/src/plugins/intel_gpu/include/intel_gpu/primitives/primitive.hpp +++ b/src/plugins/intel_gpu/include/intel_gpu/primitives/primitive.hpp @@ -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 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 map; +}; /// @} /// @} } // namespace cldnn diff --git a/src/plugins/intel_gpu/src/graph/activation.cpp b/src/plugins/intel_gpu/src/graph/activation.cpp index 5548c5e4737af4..2cc58e463eee43 100644 --- a/src/plugins/intel_gpu/src/graph/activation.cpp +++ b/src/plugins/intel_gpu/src/graph/activation.cpp @@ -10,10 +10,7 @@ #include namespace cldnn { -primitive_type_id activation::type_id() { - static primitive_type_base 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(impl_param.desc->output_data_type) == false && diff --git a/src/plugins/intel_gpu/src/graph/adaptive_pooling.cpp b/src/plugins/intel_gpu/src/graph/adaptive_pooling.cpp index bbf23ce8bda55b..bf1a39d5710594 100644 --- a/src/plugins/intel_gpu/src/graph/adaptive_pooling.cpp +++ b/src/plugins/intel_gpu/src/graph/adaptive_pooling.cpp @@ -9,10 +9,7 @@ #include namespace cldnn { -primitive_type_id adaptive_pooling::type_id() { - static primitive_type_base 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(); diff --git a/src/plugins/intel_gpu/src/graph/arg_max_min.cpp b/src/plugins/intel_gpu/src/graph/arg_max_min.cpp index 8cd4ad4b9e0933..b9de9df34344de 100644 --- a/src/plugins/intel_gpu/src/graph/arg_max_min.cpp +++ b/src/plugins/intel_gpu/src/graph/arg_max_min.cpp @@ -13,10 +13,7 @@ #include "topk_shape_inference.hpp" namespace cldnn { -primitive_type_id arg_max_min::type_id() { - static primitive_type_base 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(); diff --git a/src/plugins/intel_gpu/src/graph/assign.cpp b/src/plugins/intel_gpu/src/graph/assign.cpp index 8d0219a5d23afe..8a0600ff69271a 100644 --- a/src/plugins/intel_gpu/src/graph/assign.cpp +++ b/src/plugins/intel_gpu/src/graph/assign.cpp @@ -9,11 +9,7 @@ #include namespace cldnn { - -primitive_type_id assign::type_id() { - static primitive_type_base instance; - return &instance; -} +GPU_DEFINE_PRIMITIVE_TYPE_ID(assign) assign_inst::typed_primitive_inst(network& network, const assign_node& node) : parent{network, node, false}, diff --git a/src/plugins/intel_gpu/src/graph/average_unpooling.cpp b/src/plugins/intel_gpu/src/graph/average_unpooling.cpp index c667e10454844f..eb3156d4351bb8 100644 --- a/src/plugins/intel_gpu/src/graph/average_unpooling.cpp +++ b/src/plugins/intel_gpu/src/graph/average_unpooling.cpp @@ -10,10 +10,7 @@ #include namespace cldnn { -primitive_type_id average_unpooling::type_id() { - static primitive_type_base 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(impl_param.desc->output_data_type) == false && diff --git a/src/plugins/intel_gpu/src/graph/batch_to_space.cpp b/src/plugins/intel_gpu/src/graph/batch_to_space.cpp index 78c5e2f18f588d..f8d5a446f3c6cb 100644 --- a/src/plugins/intel_gpu/src/graph/batch_to_space.cpp +++ b/src/plugins/intel_gpu/src/graph/batch_to_space.cpp @@ -12,10 +12,7 @@ #include namespace cldnn { -primitive_type_id cldnn::batch_to_space::type_id() { - static primitive_type_base 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(); diff --git a/src/plugins/intel_gpu/src/graph/binary_convolution.cpp b/src/plugins/intel_gpu/src/graph/binary_convolution.cpp index 05227380d03993..dea33e35e5a454 100644 --- a/src/plugins/intel_gpu/src/graph/binary_convolution.cpp +++ b/src/plugins/intel_gpu/src/graph/binary_convolution.cpp @@ -12,10 +12,7 @@ #include namespace cldnn { -primitive_type_id binary_convolution::type_id() { - static primitive_type_base 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(); diff --git a/src/plugins/intel_gpu/src/graph/border.cpp b/src/plugins/intel_gpu/src/graph/border.cpp index e0f7b6b9dd7ecb..8baec60eccef6f 100644 --- a/src/plugins/intel_gpu/src/graph/border.cpp +++ b/src/plugins/intel_gpu/src/graph/border.cpp @@ -12,10 +12,7 @@ #include namespace cldnn { -primitive_type_id border::type_id() { - static primitive_type_base 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(impl_param.desc->output_data_type) == false && diff --git a/src/plugins/intel_gpu/src/graph/broadcast.cpp b/src/plugins/intel_gpu/src/graph/broadcast.cpp index da7db6525b72f2..e780b00e014cc2 100644 --- a/src/plugins/intel_gpu/src/graph/broadcast.cpp +++ b/src/plugins/intel_gpu/src/graph/broadcast.cpp @@ -13,10 +13,7 @@ #include namespace cldnn { -primitive_type_id broadcast::type_id() { - static primitive_type_base 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(impl_param.desc->output_data_type) == false && diff --git a/src/plugins/intel_gpu/src/graph/bucketize.cpp b/src/plugins/intel_gpu/src/graph/bucketize.cpp index 1ffab6fbb494be..78740d10161395 100644 --- a/src/plugins/intel_gpu/src/graph/bucketize.cpp +++ b/src/plugins/intel_gpu/src/graph/bucketize.cpp @@ -11,11 +11,7 @@ #include "to_string_utils.h" namespace cldnn { - -primitive_type_id bucketize::type_id() { - static primitive_type_base 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(); diff --git a/src/plugins/intel_gpu/src/graph/concatenation.cpp b/src/plugins/intel_gpu/src/graph/concatenation.cpp index 61a75e7822ff73..03b53a192547a0 100644 --- a/src/plugins/intel_gpu/src/graph/concatenation.cpp +++ b/src/plugins/intel_gpu/src/graph/concatenation.cpp @@ -12,10 +12,7 @@ #include namespace cldnn { -primitive_type_id concatenation::type_id() { - static primitive_type_base 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(); diff --git a/src/plugins/intel_gpu/src/graph/condition.cpp b/src/plugins/intel_gpu/src/graph/condition.cpp index 0b20a19e4606f0..c9990b6cbe0d86 100644 --- a/src/plugins/intel_gpu/src/graph/condition.cpp +++ b/src/plugins/intel_gpu/src/graph/condition.cpp @@ -10,10 +10,8 @@ #include namespace cldnn { -primitive_type_id condition::type_id() { - static primitive_type_base 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: diff --git a/src/plugins/intel_gpu/src/graph/convert_color.cpp b/src/plugins/intel_gpu/src/graph/convert_color.cpp index 9af11fd3a5c38c..ca6f1e5979c066 100644 --- a/src/plugins/intel_gpu/src/graph/convert_color.cpp +++ b/src/plugins/intel_gpu/src/graph/convert_color.cpp @@ -10,10 +10,7 @@ #include namespace cldnn { -primitive_type_id convert_color::type_id() { - static primitive_type_base 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(); diff --git a/src/plugins/intel_gpu/src/graph/convolution.cpp b/src/plugins/intel_gpu/src/graph/convolution.cpp index 2c0ff9e3a4f691..d3eb13a6594c1c 100644 --- a/src/plugins/intel_gpu/src/graph/convolution.cpp +++ b/src/plugins/intel_gpu/src/graph/convolution.cpp @@ -15,10 +15,7 @@ using namespace ov::intel_gpu; namespace cldnn { -primitive_type_id convolution::type_id() { - static primitive_type_base 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(); diff --git a/src/plugins/intel_gpu/src/graph/crop.cpp b/src/plugins/intel_gpu/src/graph/crop.cpp index ac08034a757637..fcd0ed28bdfc91 100644 --- a/src/plugins/intel_gpu/src/graph/crop.cpp +++ b/src/plugins/intel_gpu/src/graph/crop.cpp @@ -14,10 +14,7 @@ #include "split_shape_inference.hpp" namespace cldnn { -primitive_type_id crop::type_id() { - static primitive_type_base 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(impl_param.desc->output_data_type) == false && diff --git a/src/plugins/intel_gpu/src/graph/ctc_greedy_decoder.cpp b/src/plugins/intel_gpu/src/graph/ctc_greedy_decoder.cpp index 853b28086ae975..f79edd2de7d084 100644 --- a/src/plugins/intel_gpu/src/graph/ctc_greedy_decoder.cpp +++ b/src/plugins/intel_gpu/src/graph/ctc_greedy_decoder.cpp @@ -8,10 +8,7 @@ #include namespace cldnn { -primitive_type_id ctc_greedy_decoder::type_id() { - static primitive_type_base 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(); diff --git a/src/plugins/intel_gpu/src/graph/ctc_loss.cpp b/src/plugins/intel_gpu/src/graph/ctc_loss.cpp index 42dfa9a0dd70fc..52d3bdbdc38954 100644 --- a/src/plugins/intel_gpu/src/graph/ctc_loss.cpp +++ b/src/plugins/intel_gpu/src/graph/ctc_loss.cpp @@ -11,11 +11,7 @@ #include "to_string_utils.h" namespace cldnn { - -primitive_type_id ctc_loss::type_id() { - static primitive_type_base 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(); diff --git a/src/plugins/intel_gpu/src/graph/cum_sum.cpp b/src/plugins/intel_gpu/src/graph/cum_sum.cpp index 28b87db68a4fed..5acb7da9e04186 100644 --- a/src/plugins/intel_gpu/src/graph/cum_sum.cpp +++ b/src/plugins/intel_gpu/src/graph/cum_sum.cpp @@ -10,10 +10,7 @@ #include namespace cldnn { -primitive_type_id cum_sum::type_id() { - static primitive_type_base 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(); diff --git a/src/plugins/intel_gpu/src/graph/custom_gpu_primitive.cpp b/src/plugins/intel_gpu/src/graph/custom_gpu_primitive.cpp index 06a93587a52d76..cdd0f5f6aa9354 100644 --- a/src/plugins/intel_gpu/src/graph/custom_gpu_primitive.cpp +++ b/src/plugins/intel_gpu/src/graph/custom_gpu_primitive.cpp @@ -10,11 +10,7 @@ #include namespace cldnn { - -primitive_type_id custom_gpu_primitive::type_id() { - static primitive_type_base 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(); diff --git a/src/plugins/intel_gpu/src/graph/data.cpp b/src/plugins/intel_gpu/src/graph/data.cpp index f6cfebcf53259a..e6c618133d987e 100644 --- a/src/plugins/intel_gpu/src/graph/data.cpp +++ b/src/plugins/intel_gpu/src/graph/data.cpp @@ -13,10 +13,7 @@ #include namespace cldnn { -primitive_type_id data::type_id() { - static primitive_type_base 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 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 _buf; + _buf.resize(data_size); + ib >> make_data(_buf.data(), data_size); + _outputs[0]->copy_from(get_network().get_stream(), _buf.data()); + } +} + } // namespace cldnn diff --git a/src/plugins/intel_gpu/src/graph/deconvolution.cpp b/src/plugins/intel_gpu/src/graph/deconvolution.cpp index dac38d87a7577a..d5d88af713055c 100644 --- a/src/plugins/intel_gpu/src/graph/deconvolution.cpp +++ b/src/plugins/intel_gpu/src/graph/deconvolution.cpp @@ -13,10 +13,7 @@ using namespace ov::intel_gpu; namespace cldnn { -primitive_type_id deconvolution::type_id() { - static primitive_type_base 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(impl_param.desc->output_data_type) == false && diff --git a/src/plugins/intel_gpu/src/graph/deformable_convolution.cpp b/src/plugins/intel_gpu/src/graph/deformable_convolution.cpp index ff9b969c34ae2e..3acb451b46dac9 100644 --- a/src/plugins/intel_gpu/src/graph/deformable_convolution.cpp +++ b/src/plugins/intel_gpu/src/graph/deformable_convolution.cpp @@ -10,10 +10,7 @@ #include namespace cldnn { -primitive_type_id deformable_conv::type_id() { - static primitive_type_base 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(); @@ -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 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(); diff --git a/src/plugins/intel_gpu/src/graph/depth_to_space.cpp b/src/plugins/intel_gpu/src/graph/depth_to_space.cpp index cd2d54350727b1..01c01ccd941d73 100644 --- a/src/plugins/intel_gpu/src/graph/depth_to_space.cpp +++ b/src/plugins/intel_gpu/src/graph/depth_to_space.cpp @@ -10,10 +10,7 @@ #include namespace cldnn { -primitive_type_id depth_to_space::type_id() { - static primitive_type_base 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(); diff --git a/src/plugins/intel_gpu/src/graph/detection_output.cpp b/src/plugins/intel_gpu/src/graph/detection_output.cpp index c25ca051922148..06f8b30e915c41 100644 --- a/src/plugins/intel_gpu/src/graph/detection_output.cpp +++ b/src/plugins/intel_gpu/src/graph/detection_output.cpp @@ -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 -#include "serialization/string_serializer.hpp" namespace cldnn { -primitive_type_id detection_output::type_id() { - static primitive_type_base 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(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; diff --git a/src/plugins/intel_gpu/src/graph/dft.cpp b/src/plugins/intel_gpu/src/graph/dft.cpp index 9cd0459c065dbc..3b0b079646f270 100644 --- a/src/plugins/intel_gpu/src/graph/dft.cpp +++ b/src/plugins/intel_gpu/src/graph/dft.cpp @@ -8,11 +8,7 @@ #include "json_object.h" namespace cldnn { - -primitive_type_id dft::type_id() { - static primitive_type_base 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(); diff --git a/src/plugins/intel_gpu/src/graph/eltwise.cpp b/src/plugins/intel_gpu/src/graph/eltwise.cpp index 705fc082461d8e..c38963212616a5 100644 --- a/src/plugins/intel_gpu/src/graph/eltwise.cpp +++ b/src/plugins/intel_gpu/src/graph/eltwise.cpp @@ -12,10 +12,7 @@ #include namespace cldnn { -primitive_type_id eltwise::type_id() { - static primitive_type_base 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; diff --git a/src/plugins/intel_gpu/src/graph/embedding_bag.cpp b/src/plugins/intel_gpu/src/graph/embedding_bag.cpp index c2807b7e418917..e2863bfabb6e1a 100644 --- a/src/plugins/intel_gpu/src/graph/embedding_bag.cpp +++ b/src/plugins/intel_gpu/src/graph/embedding_bag.cpp @@ -10,10 +10,7 @@ #include namespace cldnn { -primitive_type_id embedding_bag::type_id() { - static primitive_type_base 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(); diff --git a/src/plugins/intel_gpu/src/graph/experimental_detectron_detection_output.cpp b/src/plugins/intel_gpu/src/graph/experimental_detectron_detection_output.cpp index daaa48fc4c5b9f..63cf986939a2e8 100644 --- a/src/plugins/intel_gpu/src/graph/experimental_detectron_detection_output.cpp +++ b/src/plugins/intel_gpu/src/graph/experimental_detectron_detection_output.cpp @@ -10,10 +10,7 @@ #include "primitive_type_base.h" namespace cldnn { -primitive_type_id experimental_detectron_detection_output::type_id() { - static primitive_type_base 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) { diff --git a/src/plugins/intel_gpu/src/graph/experimental_detectron_generate_proposal_single_image.cpp b/src/plugins/intel_gpu/src/graph/experimental_detectron_generate_proposal_single_image.cpp index be56e4aeafede2..4399a9b4d1243a 100644 --- a/src/plugins/intel_gpu/src/graph/experimental_detectron_generate_proposal_single_image.cpp +++ b/src/plugins/intel_gpu/src/graph/experimental_detectron_generate_proposal_single_image.cpp @@ -9,10 +9,7 @@ #include namespace cldnn { -primitive_type_id experimental_detectron_generate_proposals_single_image::type_id() { - static primitive_type_base 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) { diff --git a/src/plugins/intel_gpu/src/graph/experimental_detectron_prior_grid_generator.cpp b/src/plugins/intel_gpu/src/graph/experimental_detectron_prior_grid_generator.cpp index 23f09d9ed9c8b8..8f92bf87a5386b 100644 --- a/src/plugins/intel_gpu/src/graph/experimental_detectron_prior_grid_generator.cpp +++ b/src/plugins/intel_gpu/src/graph/experimental_detectron_prior_grid_generator.cpp @@ -8,11 +8,7 @@ #include "json_object.h" namespace cldnn { - -primitive_type_id experimental_detectron_prior_grid_generator::type_id() { - static primitive_type_base 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) { diff --git a/src/plugins/intel_gpu/src/graph/experimental_detectron_roi_feature_extractor.cpp b/src/plugins/intel_gpu/src/graph/experimental_detectron_roi_feature_extractor.cpp index 4c39b1b76a3616..5ff14f1d68aa51 100644 --- a/src/plugins/intel_gpu/src/graph/experimental_detectron_roi_feature_extractor.cpp +++ b/src/plugins/intel_gpu/src/graph/experimental_detectron_roi_feature_extractor.cpp @@ -9,10 +9,7 @@ #include namespace cldnn { -primitive_type_id experimental_detectron_roi_feature_extractor::type_id() { - static primitive_type_base 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; diff --git a/src/plugins/intel_gpu/src/graph/experimental_detectron_topk_rois.cpp b/src/plugins/intel_gpu/src/graph/experimental_detectron_topk_rois.cpp index d3a1d28ec905ef..ce87eb7c085d85 100644 --- a/src/plugins/intel_gpu/src/graph/experimental_detectron_topk_rois.cpp +++ b/src/plugins/intel_gpu/src/graph/experimental_detectron_topk_rois.cpp @@ -9,11 +9,7 @@ #include namespace cldnn { - -primitive_type_id experimental_detectron_topk_rois::type_id() { - static primitive_type_base 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) { diff --git a/src/plugins/intel_gpu/src/graph/extract_image_patches.cpp b/src/plugins/intel_gpu/src/graph/extract_image_patches.cpp index c95c3dcbabdddd..a146ec85f29497 100644 --- a/src/plugins/intel_gpu/src/graph/extract_image_patches.cpp +++ b/src/plugins/intel_gpu/src/graph/extract_image_patches.cpp @@ -10,10 +10,7 @@ #include namespace cldnn { -primitive_type_id extract_image_patches::type_id() { - static primitive_type_base 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(); diff --git a/src/plugins/intel_gpu/src/graph/eye.cpp b/src/plugins/intel_gpu/src/graph/eye.cpp index 405316d3429c4e..270f270c02cd84 100644 --- a/src/plugins/intel_gpu/src/graph/eye.cpp +++ b/src/plugins/intel_gpu/src/graph/eye.cpp @@ -10,11 +10,7 @@ #include "primitive_type_base.h" namespace cldnn { - -primitive_type_id eye::type_id() { - static primitive_type_base instance; - return &instance; -} +GPU_DEFINE_PRIMITIVE_TYPE_ID(eye) eye_inst::typed_primitive_inst(network& network, eye_node const& node) : parent(network, node) {} diff --git a/src/plugins/intel_gpu/src/graph/fully_connected.cpp b/src/plugins/intel_gpu/src/graph/fully_connected.cpp index e5dfb9b1fa1723..570fe7f06c0ac8 100644 --- a/src/plugins/intel_gpu/src/graph/fully_connected.cpp +++ b/src/plugins/intel_gpu/src/graph/fully_connected.cpp @@ -14,10 +14,7 @@ #include "matmul_shape_inference.hpp" namespace cldnn { -primitive_type_id fully_connected::type_id() { - static primitive_type_base instance; - return &instance; -} +GPU_DEFINE_PRIMITIVE_TYPE_ID(fully_connected) namespace { bool is_batch_after_spatial(const std::string order) { diff --git a/src/plugins/intel_gpu/src/graph/gather.cpp b/src/plugins/intel_gpu/src/graph/gather.cpp index 624869bb6117cd..fd8418afb5fb93 100644 --- a/src/plugins/intel_gpu/src/graph/gather.cpp +++ b/src/plugins/intel_gpu/src/graph/gather.cpp @@ -12,10 +12,7 @@ #include "gather_shape_inference.hpp" namespace cldnn { -primitive_type_id gather::type_id() { - static primitive_type_base 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(); diff --git a/src/plugins/intel_gpu/src/graph/gather_elements.cpp b/src/plugins/intel_gpu/src/graph/gather_elements.cpp index 39c4c5ea86a56b..3f06b2441ff6c7 100644 --- a/src/plugins/intel_gpu/src/graph/gather_elements.cpp +++ b/src/plugins/intel_gpu/src/graph/gather_elements.cpp @@ -11,10 +11,7 @@ #include namespace cldnn { -primitive_type_id gather_elements::type_id() { - static primitive_type_base 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(); diff --git a/src/plugins/intel_gpu/src/graph/gather_nd.cpp b/src/plugins/intel_gpu/src/graph/gather_nd.cpp index 38dfee536a3273..692b50411d1a13 100644 --- a/src/plugins/intel_gpu/src/graph/gather_nd.cpp +++ b/src/plugins/intel_gpu/src/graph/gather_nd.cpp @@ -10,10 +10,7 @@ #include namespace cldnn { -primitive_type_id gather_nd::type_id() { - static primitive_type_base 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(); diff --git a/src/plugins/intel_gpu/src/graph/gather_tree.cpp b/src/plugins/intel_gpu/src/graph/gather_tree.cpp index eb685eda75b503..498385ead947b0 100644 --- a/src/plugins/intel_gpu/src/graph/gather_tree.cpp +++ b/src/plugins/intel_gpu/src/graph/gather_tree.cpp @@ -11,10 +11,7 @@ #include namespace cldnn { -primitive_type_id gather_tree::type_id() { - static primitive_type_base 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(impl_param.desc->output_data_type) == false && diff --git a/src/plugins/intel_gpu/src/graph/gemm.cpp b/src/plugins/intel_gpu/src/graph/gemm.cpp index 06d86e99a98a55..8b3f9e5ac904e6 100644 --- a/src/plugins/intel_gpu/src/graph/gemm.cpp +++ b/src/plugins/intel_gpu/src/graph/gemm.cpp @@ -14,10 +14,7 @@ #include "matmul_shape_inference.hpp" namespace cldnn { -primitive_type_id gemm::type_id() { - static primitive_type_base 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(); diff --git a/src/plugins/intel_gpu/src/graph/generate_proposals.cpp b/src/plugins/intel_gpu/src/graph/generate_proposals.cpp index e27505884ca50d..f0a13313f3fcae 100644 --- a/src/plugins/intel_gpu/src/graph/generate_proposals.cpp +++ b/src/plugins/intel_gpu/src/graph/generate_proposals.cpp @@ -9,10 +9,7 @@ #include namespace cldnn { -primitive_type_id generate_proposals::type_id() { - static primitive_type_base 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(); diff --git a/src/plugins/intel_gpu/src/graph/generic_layer.cpp b/src/plugins/intel_gpu/src/graph/generic_layer.cpp index f0cfa6f58ad099..a452dab4cc188a 100644 --- a/src/plugins/intel_gpu/src/graph/generic_layer.cpp +++ b/src/plugins/intel_gpu/src/graph/generic_layer.cpp @@ -13,11 +13,7 @@ #include namespace cldnn { - -primitive_type_id generic_layer::type_id() { - static primitive_type_base instance; - return &instance; -} +GPU_DEFINE_PRIMITIVE_TYPE_ID(generic_layer) generic_layer_node::typed_program_node(const std::shared_ptr prim, program& prog) : parent(prim, prog) { diff --git a/src/plugins/intel_gpu/src/graph/get_type_id.cpp b/src/plugins/intel_gpu/src/graph/get_type_id.cpp deleted file mode 100644 index 7e68782abb59f2..00000000000000 --- a/src/plugins/intel_gpu/src/graph/get_type_id.cpp +++ /dev/null @@ -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 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]; -} \ No newline at end of file diff --git a/src/plugins/intel_gpu/src/graph/grid_sample.cpp b/src/plugins/intel_gpu/src/graph/grid_sample.cpp index 57f7052f71ce46..9fc3575d9395e1 100644 --- a/src/plugins/intel_gpu/src/graph/grid_sample.cpp +++ b/src/plugins/intel_gpu/src/graph/grid_sample.cpp @@ -9,11 +9,7 @@ #include "primitive_type_base.h" namespace cldnn { - -primitive_type_id grid_sample::type_id() { - static primitive_type_base 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(); diff --git a/src/plugins/intel_gpu/src/graph/grn.cpp b/src/plugins/intel_gpu/src/graph/grn.cpp index 919cea62e126f0..e68f17554516ad 100644 --- a/src/plugins/intel_gpu/src/graph/grn.cpp +++ b/src/plugins/intel_gpu/src/graph/grn.cpp @@ -8,10 +8,7 @@ #include namespace cldnn { -primitive_type_id grn::type_id() { - static primitive_type_base 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(); diff --git a/src/plugins/intel_gpu/src/graph/impls/common/condition.cpp b/src/plugins/intel_gpu/src/graph/impls/common/condition.cpp index 7ca3bb697f87b8..06b59924340579 100644 --- a/src/plugins/intel_gpu/src/graph/impls/common/condition.cpp +++ b/src/plugins/intel_gpu/src/graph/impls/common/condition.cpp @@ -13,6 +13,8 @@ namespace cldnn { namespace common { struct condition_impl : typed_primitive_impl { + DECLARE_OBJECT_TYPE_SERIALIZATION + std::unique_ptr clone() const override { return make_unique(*this); } @@ -135,3 +137,5 @@ attach_condition_common::attach_condition_common() { } // namespace detail } // namespace common } // namespace cldnn + +ASSIGN_TYPE_NAME(cldnn::common::condition_impl) diff --git a/src/plugins/intel_gpu/src/graph/impls/common/loop.cpp b/src/plugins/intel_gpu/src/graph/impls/common/loop.cpp index 577a5d72c69ec5..a2d7ce84474d89 100644 --- a/src/plugins/intel_gpu/src/graph/impls/common/loop.cpp +++ b/src/plugins/intel_gpu/src/graph/impls/common/loop.cpp @@ -14,6 +14,8 @@ namespace cldnn { namespace common { struct loop_impl : typed_primitive_impl { + DECLARE_OBJECT_TYPE_SERIALIZATION + std::unique_ptr clone() const override { return make_unique(*this); } @@ -210,3 +212,5 @@ attach_loop_common::attach_loop_common() { } // namespace common } // namespace cldnn + +ASSIGN_TYPE_NAME(cldnn::common::loop_impl) diff --git a/src/plugins/intel_gpu/src/graph/impls/common/wait_for_events.cpp b/src/plugins/intel_gpu/src/graph/impls/common/wait_for_events.cpp index c0abd5377aa03d..b7d52ab938c55e 100644 --- a/src/plugins/intel_gpu/src/graph/impls/common/wait_for_events.cpp +++ b/src/plugins/intel_gpu/src/graph/impls/common/wait_for_events.cpp @@ -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 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) \ No newline at end of file +BIND_BINARY_BUFFER_WITH_TYPE(cldnn::common::wait_for_events_impl) diff --git a/src/plugins/intel_gpu/src/graph/impls/cpu/assign.cpp b/src/plugins/intel_gpu/src/graph/impls/cpu/assign.cpp index 6b3fcc3c545c85..1c824b12127ebe 100644 --- a/src/plugins/intel_gpu/src/graph/impls/cpu/assign.cpp +++ b/src/plugins/intel_gpu/src/graph/impls/cpu/assign.cpp @@ -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) \ No newline at end of file +BIND_BINARY_BUFFER_WITH_TYPE(cldnn::cpu::assign_impl) diff --git a/src/plugins/intel_gpu/src/graph/impls/cpu/detection_output.cpp b/src/plugins/intel_gpu/src/graph/impls/cpu/detection_output.cpp index 0f9d3328ab695a..b11ffaf63edc14 100644 --- a/src/plugins/intel_gpu/src/graph/impls/cpu/detection_output.cpp +++ b/src/plugins/intel_gpu/src/graph/impls/cpu/detection_output.cpp @@ -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) \ No newline at end of file +BIND_BINARY_BUFFER_WITH_TYPE(cldnn::cpu::detection_output_impl) diff --git a/src/plugins/intel_gpu/src/graph/impls/cpu/non_max_suppression.cpp b/src/plugins/intel_gpu/src/graph/impls/cpu/non_max_suppression.cpp index 50eb5bb4a343a7..16b3ee28d8b3f2 100644 --- a/src/plugins/intel_gpu/src/graph/impls/cpu/non_max_suppression.cpp +++ b/src/plugins/intel_gpu/src/graph/impls/cpu/non_max_suppression.cpp @@ -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) \ No newline at end of file +BIND_BINARY_BUFFER_WITH_TYPE(cldnn::cpu::non_max_suppression_impl) diff --git a/src/plugins/intel_gpu/src/graph/impls/cpu/proposal.cpp b/src/plugins/intel_gpu/src/graph/impls/cpu/proposal.cpp index c8616303daf138..b2283ad7d4fd6b 100644 --- a/src/plugins/intel_gpu/src/graph/impls/cpu/proposal.cpp +++ b/src/plugins/intel_gpu/src/graph/impls/cpu/proposal.cpp @@ -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) \ No newline at end of file +BIND_BINARY_BUFFER_WITH_TYPE(cldnn::cpu::proposal_impl) diff --git a/src/plugins/intel_gpu/src/graph/impls/cpu/read_value.cpp b/src/plugins/intel_gpu/src/graph/impls/cpu/read_value.cpp index 88ef5d3525d519..4b0de7dec4a08b 100644 --- a/src/plugins/intel_gpu/src/graph/impls/cpu/read_value.cpp +++ b/src/plugins/intel_gpu/src/graph/impls/cpu/read_value.cpp @@ -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) \ No newline at end of file +BIND_BINARY_BUFFER_WITH_TYPE(cldnn::cpu::read_value_impl) diff --git a/src/plugins/intel_gpu/src/graph/impls/ocl/activation.cpp b/src/plugins/intel_gpu/src/graph/impls/ocl/activation.cpp index 59d02527995737..3492c1f93dc36c 100644 --- a/src/plugins/intel_gpu/src/graph/impls/ocl/activation.cpp +++ b/src/plugins/intel_gpu/src/graph/impls/ocl/activation.cpp @@ -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) diff --git a/src/plugins/intel_gpu/src/graph/impls/ocl/adaptive_pooling.cpp b/src/plugins/intel_gpu/src/graph/impls/ocl/adaptive_pooling.cpp index cc06fada7517b0..66515e886e2ffc 100644 --- a/src/plugins/intel_gpu/src/graph/impls/ocl/adaptive_pooling.cpp +++ b/src/plugins/intel_gpu/src/graph/impls/ocl/adaptive_pooling.cpp @@ -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) \ No newline at end of file +BIND_BINARY_BUFFER_WITH_TYPE(cldnn::ocl::adaptive_pooling_impl) diff --git a/src/plugins/intel_gpu/src/graph/impls/ocl/arg_max_min.cpp b/src/plugins/intel_gpu/src/graph/impls/ocl/arg_max_min.cpp index f8c90fafd406ca..93d8b9c70fa253 100644 --- a/src/plugins/intel_gpu/src/graph/impls/ocl/arg_max_min.cpp +++ b/src/plugins/intel_gpu/src/graph/impls/ocl/arg_max_min.cpp @@ -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) \ No newline at end of file +BIND_BINARY_BUFFER_WITH_TYPE(cldnn::ocl::arg_max_min_impl) diff --git a/src/plugins/intel_gpu/src/graph/impls/ocl/average_unpooling.cpp b/src/plugins/intel_gpu/src/graph/impls/ocl/average_unpooling.cpp index 9dedd0c78e430a..6f0c47509d8675 100644 --- a/src/plugins/intel_gpu/src/graph/impls/ocl/average_unpooling.cpp +++ b/src/plugins/intel_gpu/src/graph/impls/ocl/average_unpooling.cpp @@ -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) \ No newline at end of file +BIND_BINARY_BUFFER_WITH_TYPE(cldnn::ocl::average_unpooling_impl) diff --git a/src/plugins/intel_gpu/src/graph/impls/ocl/batch_to_space.cpp b/src/plugins/intel_gpu/src/graph/impls/ocl/batch_to_space.cpp index 328f4cfd2d1dae..c0433191e0b40a 100644 --- a/src/plugins/intel_gpu/src/graph/impls/ocl/batch_to_space.cpp +++ b/src/plugins/intel_gpu/src/graph/impls/ocl/batch_to_space.cpp @@ -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) \ No newline at end of file +BIND_BINARY_BUFFER_WITH_TYPE(cldnn::ocl::batch_to_space_impl) diff --git a/src/plugins/intel_gpu/src/graph/impls/ocl/binary_convolution.cpp b/src/plugins/intel_gpu/src/graph/impls/ocl/binary_convolution.cpp index a56cb040e537c1..d0f7e6a9851f30 100644 --- a/src/plugins/intel_gpu/src/graph/impls/ocl/binary_convolution.cpp +++ b/src/plugins/intel_gpu/src/graph/impls/ocl/binary_convolution.cpp @@ -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) diff --git a/src/plugins/intel_gpu/src/graph/impls/ocl/border.cpp b/src/plugins/intel_gpu/src/graph/impls/ocl/border.cpp index 127f274637e461..7aabf8352d04bd 100644 --- a/src/plugins/intel_gpu/src/graph/impls/ocl/border.cpp +++ b/src/plugins/intel_gpu/src/graph/impls/ocl/border.cpp @@ -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) \ No newline at end of file +BIND_BINARY_BUFFER_WITH_TYPE(cldnn::ocl::border_impl) diff --git a/src/plugins/intel_gpu/src/graph/impls/ocl/broadcast.cpp b/src/plugins/intel_gpu/src/graph/impls/ocl/broadcast.cpp index 1493a56cbffb83..b86bbabbd221a9 100644 --- a/src/plugins/intel_gpu/src/graph/impls/ocl/broadcast.cpp +++ b/src/plugins/intel_gpu/src/graph/impls/ocl/broadcast.cpp @@ -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) \ No newline at end of file +BIND_BINARY_BUFFER_WITH_TYPE(cldnn::ocl::broadcast_impl) diff --git a/src/plugins/intel_gpu/src/graph/impls/ocl/bucketize.cpp b/src/plugins/intel_gpu/src/graph/impls/ocl/bucketize.cpp index d59eec4cd9cdfe..f6ee0585c08b0c 100644 --- a/src/plugins/intel_gpu/src/graph/impls/ocl/bucketize.cpp +++ b/src/plugins/intel_gpu/src/graph/impls/ocl/bucketize.cpp @@ -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) \ No newline at end of file +BIND_BINARY_BUFFER_WITH_TYPE(cldnn::ocl::bucketize_impl) diff --git a/src/plugins/intel_gpu/src/graph/impls/ocl/concatenation.cpp b/src/plugins/intel_gpu/src/graph/impls/ocl/concatenation.cpp index 20727257594a18..4d73c498f9d178 100644 --- a/src/plugins/intel_gpu/src/graph/impls/ocl/concatenation.cpp +++ b/src/plugins/intel_gpu/src/graph/impls/ocl/concatenation.cpp @@ -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) diff --git a/src/plugins/intel_gpu/src/graph/impls/ocl/convert_color.cpp b/src/plugins/intel_gpu/src/graph/impls/ocl/convert_color.cpp index 84d9d396f691dd..8502538e192f65 100644 --- a/src/plugins/intel_gpu/src/graph/impls/ocl/convert_color.cpp +++ b/src/plugins/intel_gpu/src/graph/impls/ocl/convert_color.cpp @@ -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) \ No newline at end of file +BIND_BINARY_BUFFER_WITH_TYPE(cldnn::ocl::convert_color_impl) diff --git a/src/plugins/intel_gpu/src/graph/impls/ocl/convolution.cpp b/src/plugins/intel_gpu/src/graph/impls/ocl/convolution.cpp index 44062954ca4ea6..07c5d32c2e5f1c 100644 --- a/src/plugins/intel_gpu/src/graph/impls/ocl/convolution.cpp +++ b/src/plugins/intel_gpu/src/graph/impls/ocl/convolution.cpp @@ -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) diff --git a/src/plugins/intel_gpu/src/graph/impls/ocl/crop.cpp b/src/plugins/intel_gpu/src/graph/impls/ocl/crop.cpp index 797c6de6d79014..7dd28fc57c5b7c 100644 --- a/src/plugins/intel_gpu/src/graph/impls/ocl/crop.cpp +++ b/src/plugins/intel_gpu/src/graph/impls/ocl/crop.cpp @@ -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) diff --git a/src/plugins/intel_gpu/src/graph/impls/ocl/ctc_greedy_decoder.cpp b/src/plugins/intel_gpu/src/graph/impls/ocl/ctc_greedy_decoder.cpp index 5071f453db46e5..e52e5abb7cf0ad 100644 --- a/src/plugins/intel_gpu/src/graph/impls/ocl/ctc_greedy_decoder.cpp +++ b/src/plugins/intel_gpu/src/graph/impls/ocl/ctc_greedy_decoder.cpp @@ -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) \ No newline at end of file +BIND_BINARY_BUFFER_WITH_TYPE(cldnn::ocl::ctc_greedy_decoder_impl) diff --git a/src/plugins/intel_gpu/src/graph/impls/ocl/ctc_loss.cpp b/src/plugins/intel_gpu/src/graph/impls/ocl/ctc_loss.cpp index 7d228726a24556..2635c327b72350 100644 --- a/src/plugins/intel_gpu/src/graph/impls/ocl/ctc_loss.cpp +++ b/src/plugins/intel_gpu/src/graph/impls/ocl/ctc_loss.cpp @@ -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) \ No newline at end of file +BIND_BINARY_BUFFER_WITH_TYPE(cldnn::ocl::ctc_loss_impl) diff --git a/src/plugins/intel_gpu/src/graph/impls/ocl/cum_sum.cpp b/src/plugins/intel_gpu/src/graph/impls/ocl/cum_sum.cpp index 48ec50b07c39be..24b00fd7f6683c 100644 --- a/src/plugins/intel_gpu/src/graph/impls/ocl/cum_sum.cpp +++ b/src/plugins/intel_gpu/src/graph/impls/ocl/cum_sum.cpp @@ -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) \ No newline at end of file +BIND_BINARY_BUFFER_WITH_TYPE(cldnn::ocl::cum_sum_impl) diff --git a/src/plugins/intel_gpu/src/graph/impls/ocl/custom_primitive.cpp b/src/plugins/intel_gpu/src/graph/impls/ocl/custom_primitive.cpp index 5272f6bbff6329..145a4189e82a3a 100644 --- a/src/plugins/intel_gpu/src/graph/impls/ocl/custom_primitive.cpp +++ b/src/plugins/intel_gpu/src/graph/impls/ocl/custom_primitive.cpp @@ -78,13 +78,17 @@ struct custom_gpu_primitive_impl : typed_primitive_impl { 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 get_kernel_ids() override { + std::vector get_kernel_ids() const override { return {_kernel_id}; } + std::vector 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) \ No newline at end of file +BIND_BINARY_BUFFER_WITH_TYPE(cldnn::ocl::custom_gpu_primitive_impl) diff --git a/src/plugins/intel_gpu/src/graph/impls/ocl/deconvolution.cpp b/src/plugins/intel_gpu/src/graph/impls/ocl/deconvolution.cpp index 67247ade7547b3..333c07caeac795 100644 --- a/src/plugins/intel_gpu/src/graph/impls/ocl/deconvolution.cpp +++ b/src/plugins/intel_gpu/src/graph/impls/ocl/deconvolution.cpp @@ -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) \ No newline at end of file +BIND_BINARY_BUFFER_WITH_TYPE(cldnn::ocl::deconvolution_impl) diff --git a/src/plugins/intel_gpu/src/graph/impls/ocl/deformable_convolution.cpp b/src/plugins/intel_gpu/src/graph/impls/ocl/deformable_convolution.cpp index 9aca5783f73951..f0cacef75c01de 100644 --- a/src/plugins/intel_gpu/src/graph/impls/ocl/deformable_convolution.cpp +++ b/src/plugins/intel_gpu/src/graph/impls/ocl/deformable_convolution.cpp @@ -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) \ No newline at end of file +BIND_BINARY_BUFFER_WITH_TYPE(cldnn::ocl::deformable_conv_impl) +BIND_BINARY_BUFFER_WITH_TYPE(cldnn::ocl::deformable_interp_impl) diff --git a/src/plugins/intel_gpu/src/graph/impls/ocl/depth_to_space.cpp b/src/plugins/intel_gpu/src/graph/impls/ocl/depth_to_space.cpp index bc085b15d5474e..f90e2c8257fabe 100644 --- a/src/plugins/intel_gpu/src/graph/impls/ocl/depth_to_space.cpp +++ b/src/plugins/intel_gpu/src/graph/impls/ocl/depth_to_space.cpp @@ -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) \ No newline at end of file +BIND_BINARY_BUFFER_WITH_TYPE(cldnn::ocl::depth_to_space_impl) diff --git a/src/plugins/intel_gpu/src/graph/impls/ocl/detection_output.cpp b/src/plugins/intel_gpu/src/graph/impls/ocl/detection_output.cpp index 5fe817b0481069..ae35a2f7bdfa2f 100644 --- a/src/plugins/intel_gpu/src/graph/impls/ocl/detection_output.cpp +++ b/src/plugins/intel_gpu/src/graph/impls/ocl/detection_output.cpp @@ -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) \ No newline at end of file +BIND_BINARY_BUFFER_WITH_TYPE(cldnn::ocl::detection_output_impl) diff --git a/src/plugins/intel_gpu/src/graph/impls/ocl/dft.cpp b/src/plugins/intel_gpu/src/graph/impls/ocl/dft.cpp index 958fd837d79985..387e78d092c1ff 100644 --- a/src/plugins/intel_gpu/src/graph/impls/ocl/dft.cpp +++ b/src/plugins/intel_gpu/src/graph/impls/ocl/dft.cpp @@ -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) \ No newline at end of file +BIND_BINARY_BUFFER_WITH_TYPE(cldnn::ocl::dft_impl) diff --git a/src/plugins/intel_gpu/src/graph/impls/ocl/eltwise.cpp b/src/plugins/intel_gpu/src/graph/impls/ocl/eltwise.cpp index 08fa31cd8f8cfe..6824e06855299c 100644 --- a/src/plugins/intel_gpu/src/graph/impls/ocl/eltwise.cpp +++ b/src/plugins/intel_gpu/src/graph/impls/ocl/eltwise.cpp @@ -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) \ No newline at end of file +BIND_BINARY_BUFFER_WITH_TYPE(cldnn::ocl::eltwise_impl) diff --git a/src/plugins/intel_gpu/src/graph/impls/ocl/embedding_bag.cpp b/src/plugins/intel_gpu/src/graph/impls/ocl/embedding_bag.cpp index 86020c16de31b3..5ff4cb47a2db62 100644 --- a/src/plugins/intel_gpu/src/graph/impls/ocl/embedding_bag.cpp +++ b/src/plugins/intel_gpu/src/graph/impls/ocl/embedding_bag.cpp @@ -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) \ No newline at end of file +BIND_BINARY_BUFFER_WITH_TYPE(cldnn::ocl::embedding_bag_impl) diff --git a/src/plugins/intel_gpu/src/graph/impls/ocl/experimental_detectron_detection_output.cpp b/src/plugins/intel_gpu/src/graph/impls/ocl/experimental_detectron_detection_output.cpp index 4ccc17de90ac41..315e3e9b5491d2 100644 --- a/src/plugins/intel_gpu/src/graph/impls/ocl/experimental_detectron_detection_output.cpp +++ b/src/plugins/intel_gpu/src/graph/impls/ocl/experimental_detectron_detection_output.cpp @@ -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) \ No newline at end of file +BIND_BINARY_BUFFER_WITH_TYPE(cldnn::ocl::experimental_detectron_detection_output_impl) diff --git a/src/plugins/intel_gpu/src/graph/impls/ocl/experimental_detectron_generate_proposals_single_image.cpp b/src/plugins/intel_gpu/src/graph/impls/ocl/experimental_detectron_generate_proposals_single_image.cpp index c940038553f646..fca543796a7c87 100644 --- a/src/plugins/intel_gpu/src/graph/impls/ocl/experimental_detectron_generate_proposals_single_image.cpp +++ b/src/plugins/intel_gpu/src/graph/impls/ocl/experimental_detectron_generate_proposals_single_image.cpp @@ -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) \ No newline at end of file +BIND_BINARY_BUFFER_WITH_TYPE(cldnn::ocl::experimental_detectron_generate_proposals_single_image_impl) diff --git a/src/plugins/intel_gpu/src/graph/impls/ocl/experimental_detectron_prior_grid_generator.cpp b/src/plugins/intel_gpu/src/graph/impls/ocl/experimental_detectron_prior_grid_generator.cpp index 532b6bf056df98..1c989a3f234b75 100644 --- a/src/plugins/intel_gpu/src/graph/impls/ocl/experimental_detectron_prior_grid_generator.cpp +++ b/src/plugins/intel_gpu/src/graph/impls/ocl/experimental_detectron_prior_grid_generator.cpp @@ -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) \ No newline at end of file +BIND_BINARY_BUFFER_WITH_TYPE(cldnn::ocl::experimental_detectron_prior_grid_generator_impl) diff --git a/src/plugins/intel_gpu/src/graph/impls/ocl/experimental_detectron_roi_feature_extractor.cpp b/src/plugins/intel_gpu/src/graph/impls/ocl/experimental_detectron_roi_feature_extractor.cpp index 988f81159dd440..948796a1fddc70 100644 --- a/src/plugins/intel_gpu/src/graph/impls/ocl/experimental_detectron_roi_feature_extractor.cpp +++ b/src/plugins/intel_gpu/src/graph/impls/ocl/experimental_detectron_roi_feature_extractor.cpp @@ -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) \ No newline at end of file +BIND_BINARY_BUFFER_WITH_TYPE(cldnn::ocl::experimental_detectron_roi_feature_extractor_impl) diff --git a/src/plugins/intel_gpu/src/graph/impls/ocl/experimental_detectron_topk_rois.cpp b/src/plugins/intel_gpu/src/graph/impls/ocl/experimental_detectron_topk_rois.cpp index 6febbbfb3f5361..19c41a69190aa0 100644 --- a/src/plugins/intel_gpu/src/graph/impls/ocl/experimental_detectron_topk_rois.cpp +++ b/src/plugins/intel_gpu/src/graph/impls/ocl/experimental_detectron_topk_rois.cpp @@ -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) \ No newline at end of file +BIND_BINARY_BUFFER_WITH_TYPE(cldnn::ocl::experimental_detectron_topk_rois_impl) diff --git a/src/plugins/intel_gpu/src/graph/impls/ocl/extract_image_patches.cpp b/src/plugins/intel_gpu/src/graph/impls/ocl/extract_image_patches.cpp index 199e7775f96862..0c65d3e75f4b7a 100644 --- a/src/plugins/intel_gpu/src/graph/impls/ocl/extract_image_patches.cpp +++ b/src/plugins/intel_gpu/src/graph/impls/ocl/extract_image_patches.cpp @@ -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) \ No newline at end of file +BIND_BINARY_BUFFER_WITH_TYPE(cldnn::ocl::extract_image_patches_impl) diff --git a/src/plugins/intel_gpu/src/graph/impls/ocl/eye.cpp b/src/plugins/intel_gpu/src/graph/impls/ocl/eye.cpp index 10e3514d46d8c3..6c3470a8e51ebe 100644 --- a/src/plugins/intel_gpu/src/graph/impls/ocl/eye.cpp +++ b/src/plugins/intel_gpu/src/graph/impls/ocl/eye.cpp @@ -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) \ No newline at end of file +BIND_BINARY_BUFFER_WITH_TYPE(cldnn::ocl::eye_impl) diff --git a/src/plugins/intel_gpu/src/graph/impls/ocl/fully_connected.cpp b/src/plugins/intel_gpu/src/graph/impls/ocl/fully_connected.cpp index f88969ebf8c80e..fb21537282be1d 100644 --- a/src/plugins/intel_gpu/src/graph/impls/ocl/fully_connected.cpp +++ b/src/plugins/intel_gpu/src/graph/impls/ocl/fully_connected.cpp @@ -151,4 +151,4 @@ attach_fully_connected_impl::attach_fully_connected_impl() { } // namespace ocl } // namespace cldnn -BIND_BINARY_BUFFER_WITH_TYPE(cldnn::ocl::fully_connected_impl, cldnn::object_type::FULLY_CONNECTED_IMPL) \ No newline at end of file +BIND_BINARY_BUFFER_WITH_TYPE(cldnn::ocl::fully_connected_impl) diff --git a/src/plugins/intel_gpu/src/graph/impls/ocl/gather.cpp b/src/plugins/intel_gpu/src/graph/impls/ocl/gather.cpp index d1efccb669952d..fe47acad1990cd 100644 --- a/src/plugins/intel_gpu/src/graph/impls/ocl/gather.cpp +++ b/src/plugins/intel_gpu/src/graph/impls/ocl/gather.cpp @@ -211,4 +211,4 @@ attach_gather_impl::attach_gather_impl() { } // namespace ocl } // namespace cldnn -BIND_BINARY_BUFFER_WITH_TYPE(cldnn::ocl::gather_impl, cldnn::object_type::GATHER_IMPL) \ No newline at end of file +BIND_BINARY_BUFFER_WITH_TYPE(cldnn::ocl::gather_impl) diff --git a/src/plugins/intel_gpu/src/graph/impls/ocl/gather_elements.cpp b/src/plugins/intel_gpu/src/graph/impls/ocl/gather_elements.cpp index e91bade0711b83..3812ea48c060f1 100644 --- a/src/plugins/intel_gpu/src/graph/impls/ocl/gather_elements.cpp +++ b/src/plugins/intel_gpu/src/graph/impls/ocl/gather_elements.cpp @@ -93,4 +93,4 @@ attach_gather_elements_impl::attach_gather_elements_impl() { } // namespace ocl } // namespace cldnn -BIND_BINARY_BUFFER_WITH_TYPE(cldnn::ocl::gather_elements_impl, cldnn::object_type::GATHER_ELEMENTS_IMPL) \ No newline at end of file +BIND_BINARY_BUFFER_WITH_TYPE(cldnn::ocl::gather_elements_impl) diff --git a/src/plugins/intel_gpu/src/graph/impls/ocl/gather_nd.cpp b/src/plugins/intel_gpu/src/graph/impls/ocl/gather_nd.cpp index a0a88aff702e92..c2f840951c9163 100644 --- a/src/plugins/intel_gpu/src/graph/impls/ocl/gather_nd.cpp +++ b/src/plugins/intel_gpu/src/graph/impls/ocl/gather_nd.cpp @@ -60,4 +60,4 @@ attach_gather_nd_impl::attach_gather_nd_impl() { } // namespace ocl } // namespace cldnn -BIND_BINARY_BUFFER_WITH_TYPE(cldnn::ocl::gather_nd_impl, cldnn::object_type::GATHER_ND_IMPL) \ No newline at end of file +BIND_BINARY_BUFFER_WITH_TYPE(cldnn::ocl::gather_nd_impl) diff --git a/src/plugins/intel_gpu/src/graph/impls/ocl/gather_tree.cpp b/src/plugins/intel_gpu/src/graph/impls/ocl/gather_tree.cpp index 7f781e7ccd5296..887d4cb50476a6 100644 --- a/src/plugins/intel_gpu/src/graph/impls/ocl/gather_tree.cpp +++ b/src/plugins/intel_gpu/src/graph/impls/ocl/gather_tree.cpp @@ -63,4 +63,4 @@ attach_gather_tree_impl::attach_gather_tree_impl() { } // namespace ocl } // namespace cldnn -BIND_BINARY_BUFFER_WITH_TYPE(cldnn::ocl::gather_tree_impl, cldnn::object_type::GATHER_TREE_IMPL) \ No newline at end of file +BIND_BINARY_BUFFER_WITH_TYPE(cldnn::ocl::gather_tree_impl) diff --git a/src/plugins/intel_gpu/src/graph/impls/ocl/gemm.cpp b/src/plugins/intel_gpu/src/graph/impls/ocl/gemm.cpp index 5afd4fe0bf6ea2..1a7d863e934f6e 100644 --- a/src/plugins/intel_gpu/src/graph/impls/ocl/gemm.cpp +++ b/src/plugins/intel_gpu/src/graph/impls/ocl/gemm.cpp @@ -165,4 +165,4 @@ attach_gemm_impl::attach_gemm_impl() { } // namespace ocl } // namespace cldnn -BIND_BINARY_BUFFER_WITH_TYPE(cldnn::ocl::gemm_impl, cldnn::object_type::GEMM_IMPL) \ No newline at end of file +BIND_BINARY_BUFFER_WITH_TYPE(cldnn::ocl::gemm_impl) diff --git a/src/plugins/intel_gpu/src/graph/impls/ocl/generate_proposals.cpp b/src/plugins/intel_gpu/src/graph/impls/ocl/generate_proposals.cpp index 2b0993bc680de5..0d0bc5c3b3f0fe 100644 --- a/src/plugins/intel_gpu/src/graph/impls/ocl/generate_proposals.cpp +++ b/src/plugins/intel_gpu/src/graph/impls/ocl/generate_proposals.cpp @@ -78,4 +78,4 @@ namespace detail { } // namespace ocl } // namespace cldnn -BIND_BINARY_BUFFER_WITH_TYPE(cldnn::ocl::generate_proposals_impl, cldnn::object_type::GENERATE_PROPOSALS_IMPL) \ No newline at end of file +BIND_BINARY_BUFFER_WITH_TYPE(cldnn::ocl::generate_proposals_impl) diff --git a/src/plugins/intel_gpu/src/graph/impls/ocl/generic_layer.cpp b/src/plugins/intel_gpu/src/graph/impls/ocl/generic_layer.cpp index 81ae1850b332f1..bf1e456750c5e2 100644 --- a/src/plugins/intel_gpu/src/graph/impls/ocl/generic_layer.cpp +++ b/src/plugins/intel_gpu/src/graph/impls/ocl/generic_layer.cpp @@ -86,6 +86,7 @@ struct generic_layer_impl : typed_primitive_impl { // TODO: move this file to cpu folder and add a new traget to 'cldnn::engine_types' struct generic_layer_cpu : typed_primitive_impl { const generic_layer_node& outer; + DECLARE_OBJECT_TYPE_SERIALIZATION std::unique_ptr clone() const override { return make_unique(*this); @@ -136,4 +137,5 @@ attach_generic_layer_impl::attach_generic_layer_impl() { } // namespace ocl } // namespace cldnn -BIND_BINARY_BUFFER_WITH_TYPE(cldnn::ocl::generic_layer_impl, cldnn::object_type::GENERIC_LAYER_IMPL) \ No newline at end of file +BIND_BINARY_BUFFER_WITH_TYPE(cldnn::ocl::generic_layer_impl) +ASSIGN_TYPE_NAME(cldnn::ocl::generic_layer_cpu) \ No newline at end of file diff --git a/src/plugins/intel_gpu/src/graph/impls/ocl/grid_sample.cpp b/src/plugins/intel_gpu/src/graph/impls/ocl/grid_sample.cpp index 15a5f34e8e3d69..0063a1c6003aa9 100644 --- a/src/plugins/intel_gpu/src/graph/impls/ocl/grid_sample.cpp +++ b/src/plugins/intel_gpu/src/graph/impls/ocl/grid_sample.cpp @@ -87,4 +87,4 @@ attach_grid_sample_impl::attach_grid_sample_impl() { } // namespace ocl } // namespace cldnn -BIND_BINARY_BUFFER_WITH_TYPE(cldnn::ocl::grid_sample_impl, cldnn::object_type::GRID_SAMPLE_IMPL) \ No newline at end of file +BIND_BINARY_BUFFER_WITH_TYPE(cldnn::ocl::grid_sample_impl) diff --git a/src/plugins/intel_gpu/src/graph/impls/ocl/grn.cpp b/src/plugins/intel_gpu/src/graph/impls/ocl/grn.cpp index 9dd877c5d8d12b..9eece30b14332a 100644 --- a/src/plugins/intel_gpu/src/graph/impls/ocl/grn.cpp +++ b/src/plugins/intel_gpu/src/graph/impls/ocl/grn.cpp @@ -54,4 +54,4 @@ attach_grn_impl::attach_grn_impl() { } // namespace ocl } // namespace cldnn -BIND_BINARY_BUFFER_WITH_TYPE(cldnn::ocl::grn_impl, cldnn::object_type::GRN_IMPL) +BIND_BINARY_BUFFER_WITH_TYPE(cldnn::ocl::grn_impl) diff --git a/src/plugins/intel_gpu/src/graph/impls/ocl/lrn.cpp b/src/plugins/intel_gpu/src/graph/impls/ocl/lrn.cpp index d13e574d213166..79517b7f30878c 100644 --- a/src/plugins/intel_gpu/src/graph/impls/ocl/lrn.cpp +++ b/src/plugins/intel_gpu/src/graph/impls/ocl/lrn.cpp @@ -93,4 +93,4 @@ attach_lrn_impl::attach_lrn_impl() { } // namespace ocl } // namespace cldnn -BIND_BINARY_BUFFER_WITH_TYPE(cldnn::ocl::lrn_impl, cldnn::object_type::LRN_IMPL) +BIND_BINARY_BUFFER_WITH_TYPE(cldnn::ocl::lrn_impl) diff --git a/src/plugins/intel_gpu/src/graph/impls/ocl/lstm_dynamic_input.cpp b/src/plugins/intel_gpu/src/graph/impls/ocl/lstm_dynamic_input.cpp index b2b848c729e749..8f6548931bd9b6 100644 --- a/src/plugins/intel_gpu/src/graph/impls/ocl/lstm_dynamic_input.cpp +++ b/src/plugins/intel_gpu/src/graph/impls/ocl/lstm_dynamic_input.cpp @@ -78,4 +78,4 @@ attach_lstm_dynamic_input_impl::attach_lstm_dynamic_input_impl() { } // namespace ocl } // namespace cldnn -BIND_BINARY_BUFFER_WITH_TYPE(cldnn::ocl::lstm_dynamic_input_impl, cldnn::object_type::LSTM_DYNAMIC_INPUT_IMPL) +BIND_BINARY_BUFFER_WITH_TYPE(cldnn::ocl::lstm_dynamic_input_impl) diff --git a/src/plugins/intel_gpu/src/graph/impls/ocl/lstm_dynamic_timeloop.cpp b/src/plugins/intel_gpu/src/graph/impls/ocl/lstm_dynamic_timeloop.cpp index ce98279b24bfad..e064b05b2c59f8 100644 --- a/src/plugins/intel_gpu/src/graph/impls/ocl/lstm_dynamic_timeloop.cpp +++ b/src/plugins/intel_gpu/src/graph/impls/ocl/lstm_dynamic_timeloop.cpp @@ -100,4 +100,4 @@ attach_lstm_dynamic_timeloop_impl::attach_lstm_dynamic_timeloop_impl() { } // namespace ocl } // namespace cldnn -BIND_BINARY_BUFFER_WITH_TYPE(cldnn::ocl::lstm_dynamic_timeloop_impl, cldnn::object_type::LSTM_DYNAMIC_TIMELOOP_IMPL) +BIND_BINARY_BUFFER_WITH_TYPE(cldnn::ocl::lstm_dynamic_timeloop_impl) diff --git a/src/plugins/intel_gpu/src/graph/impls/ocl/lstm_elt.cpp b/src/plugins/intel_gpu/src/graph/impls/ocl/lstm_elt.cpp index 9abca882abde19..0d1a39d13eac8e 100644 --- a/src/plugins/intel_gpu/src/graph/impls/ocl/lstm_elt.cpp +++ b/src/plugins/intel_gpu/src/graph/impls/ocl/lstm_elt.cpp @@ -103,4 +103,4 @@ attach_lstm_elt_impl::attach_lstm_elt_impl() { } // namespace ocl } // namespace cldnn -BIND_BINARY_BUFFER_WITH_TYPE(cldnn::ocl::lstm_elt_impl, cldnn::object_type::LSTM_ELT_IMPL) +BIND_BINARY_BUFFER_WITH_TYPE(cldnn::ocl::lstm_elt_impl) diff --git a/src/plugins/intel_gpu/src/graph/impls/ocl/lstm_gemm.cpp b/src/plugins/intel_gpu/src/graph/impls/ocl/lstm_gemm.cpp index 942dcdef6fe6cc..4c2c9da44a9715 100644 --- a/src/plugins/intel_gpu/src/graph/impls/ocl/lstm_gemm.cpp +++ b/src/plugins/intel_gpu/src/graph/impls/ocl/lstm_gemm.cpp @@ -104,4 +104,4 @@ attach_lstm_gemm_impl::attach_lstm_gemm_impl() { } // namespace ocl } // namespace cldnn -BIND_BINARY_BUFFER_WITH_TYPE(cldnn::ocl::lstm_gemm_impl, cldnn::object_type::LSTM_GEMM_IMPL) +BIND_BINARY_BUFFER_WITH_TYPE(cldnn::ocl::lstm_gemm_impl) diff --git a/src/plugins/intel_gpu/src/graph/impls/ocl/matrix_nms.cpp b/src/plugins/intel_gpu/src/graph/impls/ocl/matrix_nms.cpp index 2cb99dce385092..9509564cdf412f 100644 --- a/src/plugins/intel_gpu/src/graph/impls/ocl/matrix_nms.cpp +++ b/src/plugins/intel_gpu/src/graph/impls/ocl/matrix_nms.cpp @@ -43,6 +43,8 @@ struct matrix_nms_impl : typed_primitive_impl_ocl { using kernel_selector_t = kernel_selector::matrix_nms_kernel_selector; using kernel_params_t = std::pair; + DECLARE_OBJECT_TYPE_SERIALIZATION + std::unique_ptr clone() const override { return make_unique(*this); } @@ -106,3 +108,5 @@ attach_matrix_nms_impl::attach_matrix_nms_impl() { } // namespace detail } // namespace ocl } // namespace cldnn + +BIND_BINARY_BUFFER_WITH_TYPE(cldnn::ocl::matrix_nms_impl) diff --git a/src/plugins/intel_gpu/src/graph/impls/ocl/multiclass_nms.cpp b/src/plugins/intel_gpu/src/graph/impls/ocl/multiclass_nms.cpp index 271c3c587137d0..6d0c51dc00c388 100644 --- a/src/plugins/intel_gpu/src/graph/impls/ocl/multiclass_nms.cpp +++ b/src/plugins/intel_gpu/src/graph/impls/ocl/multiclass_nms.cpp @@ -116,4 +116,4 @@ attach_multiclass_nms_impl::attach_multiclass_nms_impl() { } // namespace ocl } // namespace cldnn -BIND_BINARY_BUFFER_WITH_TYPE(cldnn::ocl::multiclass_nms_impl, cldnn::object_type::MULTICLASS_NMS_IMPL) \ No newline at end of file +BIND_BINARY_BUFFER_WITH_TYPE(cldnn::ocl::multiclass_nms_impl) diff --git a/src/plugins/intel_gpu/src/graph/impls/ocl/mutable_data.cpp b/src/plugins/intel_gpu/src/graph/impls/ocl/mutable_data.cpp index 86600cae2ab2a3..1cc650329144cf 100644 --- a/src/plugins/intel_gpu/src/graph/impls/ocl/mutable_data.cpp +++ b/src/plugins/intel_gpu/src/graph/impls/ocl/mutable_data.cpp @@ -35,4 +35,4 @@ attach_mutable_data_impl::attach_mutable_data_impl() { } // namespace ocl } // namespace cldnn -BIND_BINARY_BUFFER_WITH_TYPE(cldnn::ocl::mutable_data_impl, cldnn::object_type::MUTABLE_DATA_IMPL) +BIND_BINARY_BUFFER_WITH_TYPE(cldnn::ocl::mutable_data_impl) diff --git a/src/plugins/intel_gpu/src/graph/impls/ocl/mvn.cpp b/src/plugins/intel_gpu/src/graph/impls/ocl/mvn.cpp index 1b84b90d9199e6..2c739a0ac441c3 100644 --- a/src/plugins/intel_gpu/src/graph/impls/ocl/mvn.cpp +++ b/src/plugins/intel_gpu/src/graph/impls/ocl/mvn.cpp @@ -100,4 +100,4 @@ attach_mvn_impl::attach_mvn_impl() { } // namespace ocl } // namespace cldnn -BIND_BINARY_BUFFER_WITH_TYPE(cldnn::ocl::mvn_impl, cldnn::object_type::MVN_IMPL) +BIND_BINARY_BUFFER_WITH_TYPE(cldnn::ocl::mvn_impl) diff --git a/src/plugins/intel_gpu/src/graph/impls/ocl/non_max_suppression.cpp b/src/plugins/intel_gpu/src/graph/impls/ocl/non_max_suppression.cpp index c9edd4524323b6..96b89537a82865 100644 --- a/src/plugins/intel_gpu/src/graph/impls/ocl/non_max_suppression.cpp +++ b/src/plugins/intel_gpu/src/graph/impls/ocl/non_max_suppression.cpp @@ -213,4 +213,4 @@ attach_non_max_suppression_impl::attach_non_max_suppression_impl() { } // namespace ocl } // namespace cldnn -BIND_BINARY_BUFFER_WITH_TYPE(cldnn::ocl::non_max_suppression_impl, cldnn::object_type::NON_MAX_SUPPRESSION_IMPL_OCL) +BIND_BINARY_BUFFER_WITH_TYPE(cldnn::ocl::non_max_suppression_impl) diff --git a/src/plugins/intel_gpu/src/graph/impls/ocl/non_zero.cpp b/src/plugins/intel_gpu/src/graph/impls/ocl/non_zero.cpp index 6993bca663d2bc..78a982a1a53a89 100644 --- a/src/plugins/intel_gpu/src/graph/impls/ocl/non_zero.cpp +++ b/src/plugins/intel_gpu/src/graph/impls/ocl/non_zero.cpp @@ -108,5 +108,5 @@ attach_gather_nonzero_impl::attach_gather_nonzero_impl() { } // namespace ocl } // namespace cldnn -BIND_BINARY_BUFFER_WITH_TYPE(cldnn::ocl::count_nonzero_impl, cldnn::object_type::COUNT_NONZERO_IMPL) -BIND_BINARY_BUFFER_WITH_TYPE(cldnn::ocl::gather_nonzero_impl, cldnn::object_type::GATHER_NONZERO_IMPL) +BIND_BINARY_BUFFER_WITH_TYPE(cldnn::ocl::count_nonzero_impl) +BIND_BINARY_BUFFER_WITH_TYPE(cldnn::ocl::gather_nonzero_impl) diff --git a/src/plugins/intel_gpu/src/graph/impls/ocl/normalize.cpp b/src/plugins/intel_gpu/src/graph/impls/ocl/normalize.cpp index ecb2d908052428..aac624dde1e164 100644 --- a/src/plugins/intel_gpu/src/graph/impls/ocl/normalize.cpp +++ b/src/plugins/intel_gpu/src/graph/impls/ocl/normalize.cpp @@ -77,4 +77,4 @@ attach_normalize_impl::attach_normalize_impl() { } // namespace ocl } // namespace cldnn -BIND_BINARY_BUFFER_WITH_TYPE(cldnn::ocl::normalize_impl, cldnn::object_type::NORMALIZE_IMPL) +BIND_BINARY_BUFFER_WITH_TYPE(cldnn::ocl::normalize_impl) diff --git a/src/plugins/intel_gpu/src/graph/impls/ocl/one_hot.cpp b/src/plugins/intel_gpu/src/graph/impls/ocl/one_hot.cpp index 7e9ad4c51f5b35..d1c33c4c72eae8 100644 --- a/src/plugins/intel_gpu/src/graph/impls/ocl/one_hot.cpp +++ b/src/plugins/intel_gpu/src/graph/impls/ocl/one_hot.cpp @@ -66,4 +66,4 @@ attach_one_hot_impl::attach_one_hot_impl() { } // namespace ocl } // namespace cldnn -BIND_BINARY_BUFFER_WITH_TYPE(cldnn::ocl::one_hot_impl, cldnn::object_type::ONE_HOT_IMPL) +BIND_BINARY_BUFFER_WITH_TYPE(cldnn::ocl::one_hot_impl) diff --git a/src/plugins/intel_gpu/src/graph/impls/ocl/permute.cpp b/src/plugins/intel_gpu/src/graph/impls/ocl/permute.cpp index dff87acdbcd164..e69507eaf42401 100644 --- a/src/plugins/intel_gpu/src/graph/impls/ocl/permute.cpp +++ b/src/plugins/intel_gpu/src/graph/impls/ocl/permute.cpp @@ -82,4 +82,4 @@ attach_permute_impl::attach_permute_impl() { } // namespace ocl } // namespace cldnn -BIND_BINARY_BUFFER_WITH_TYPE(cldnn::ocl::permute_impl, cldnn::object_type::PERMUTE_IMPL) +BIND_BINARY_BUFFER_WITH_TYPE(cldnn::ocl::permute_impl) diff --git a/src/plugins/intel_gpu/src/graph/impls/ocl/pooling.cpp b/src/plugins/intel_gpu/src/graph/impls/ocl/pooling.cpp index 51a4f030f54423..dffc9b5079b75c 100644 --- a/src/plugins/intel_gpu/src/graph/impls/ocl/pooling.cpp +++ b/src/plugins/intel_gpu/src/graph/impls/ocl/pooling.cpp @@ -206,4 +206,4 @@ attach_pooling_impl::attach_pooling_impl() { } // namespace ocl } // namespace cldnn -BIND_BINARY_BUFFER_WITH_TYPE(cldnn::ocl::pooling_impl, cldnn::object_type::POOLING_IMPL) +BIND_BINARY_BUFFER_WITH_TYPE(cldnn::ocl::pooling_impl) diff --git a/src/plugins/intel_gpu/src/graph/impls/ocl/primitive_base.hpp b/src/plugins/intel_gpu/src/graph/impls/ocl/primitive_base.hpp index bde5d9c9445d19..1a78aedf768135 100644 --- a/src/plugins/intel_gpu/src/graph/impls/ocl/primitive_base.hpp +++ b/src/plugins/intel_gpu/src/graph/impls/ocl/primitive_base.hpp @@ -11,12 +11,12 @@ #include "intel_gpu/runtime/error_handler.hpp" #include "kernel_selector_helper.h" #include "intel_gpu/graph/network.hpp" -#include "serialization/binary_buffer.hpp" -#include "serialization/cl_kernel_data_serializer.hpp" -#include "serialization/helpers.hpp" -#include "serialization/set_serializer.hpp" -#include "serialization/string_serializer.hpp" -#include "serialization/vector_serializer.hpp" +#include "intel_gpu/graph/serialization/binary_buffer.hpp" +#include "intel_gpu/graph/serialization/cl_kernel_data_serializer.hpp" +#include "intel_gpu/graph/serialization/helpers.hpp" +#include "intel_gpu/graph/serialization/set_serializer.hpp" +#include "intel_gpu/graph/serialization/string_serializer.hpp" +#include "intel_gpu/graph/serialization/vector_serializer.hpp" #include "register.hpp" #include #include @@ -67,6 +67,10 @@ struct typed_primitive_impl_ocl : public typed_primitive_impl { bool is_cpu() const override { return false; } + // Cache blob format: + // [ kernel_selector::kernel_data ] + // [ kernel_id ] + // [ kernel_arguments ] void save(BinaryOutputBuffer& ob) const override { ob << make_data(&_kernel_data.internalBufferDataType, sizeof(kernel_selector::Datatype)); ob << _kernel_data.internalBufferSizes; @@ -177,10 +181,14 @@ struct typed_primitive_impl_ocl : public typed_primitive_impl { } } - std::vector get_kernel_ids() override { + std::vector get_kernel_ids() const override { return _kernel_ids; } + std::vector get_kernels() const override { + return _kernels; + } + std::vector get_internal_buffer_layouts_impl() const override { if (_kernel_data.internalBufferSizes.empty()) return {}; diff --git a/src/plugins/intel_gpu/src/graph/impls/ocl/prior_box.cpp b/src/plugins/intel_gpu/src/graph/impls/ocl/prior_box.cpp index d17925b279865a..7c6e911309aafc 100644 --- a/src/plugins/intel_gpu/src/graph/impls/ocl/prior_box.cpp +++ b/src/plugins/intel_gpu/src/graph/impls/ocl/prior_box.cpp @@ -99,4 +99,4 @@ attach_prior_box_impl::attach_prior_box_impl() { } // namespace ocl } // namespace cldnn -BIND_BINARY_BUFFER_WITH_TYPE(cldnn::ocl::prior_box_impl, cldnn::object_type::PRIOR_BOX_IMPL) +BIND_BINARY_BUFFER_WITH_TYPE(cldnn::ocl::prior_box_impl) diff --git a/src/plugins/intel_gpu/src/graph/impls/ocl/pyramid_roi_align.cpp b/src/plugins/intel_gpu/src/graph/impls/ocl/pyramid_roi_align.cpp index 96b0bff9c62e1a..146f006e506fb2 100644 --- a/src/plugins/intel_gpu/src/graph/impls/ocl/pyramid_roi_align.cpp +++ b/src/plugins/intel_gpu/src/graph/impls/ocl/pyramid_roi_align.cpp @@ -73,4 +73,4 @@ attach_pyramid_roi_align_impl::attach_pyramid_roi_align_impl() { } // namespace ocl } // namespace cldnn -BIND_BINARY_BUFFER_WITH_TYPE(cldnn::ocl::pyramid_roi_align_impl, cldnn::object_type::PYRAMID_ROI_ALIGN_IMPL) +BIND_BINARY_BUFFER_WITH_TYPE(cldnn::ocl::pyramid_roi_align_impl) diff --git a/src/plugins/intel_gpu/src/graph/impls/ocl/quantize.cpp b/src/plugins/intel_gpu/src/graph/impls/ocl/quantize.cpp index e8466e7647e27a..b2ad4926dbb6c7 100644 --- a/src/plugins/intel_gpu/src/graph/impls/ocl/quantize.cpp +++ b/src/plugins/intel_gpu/src/graph/impls/ocl/quantize.cpp @@ -203,4 +203,4 @@ attach_quantize_impl::attach_quantize_impl() { } // namespace ocl } // namespace cldnn -BIND_BINARY_BUFFER_WITH_TYPE(cldnn::ocl::quantize_impl, cldnn::object_type::QUANTIZE_IMPL) +BIND_BINARY_BUFFER_WITH_TYPE(cldnn::ocl::quantize_impl) diff --git a/src/plugins/intel_gpu/src/graph/impls/ocl/random_uniform.cpp b/src/plugins/intel_gpu/src/graph/impls/ocl/random_uniform.cpp index a2f8e4ee2e1f75..53cbdfbfa67594 100644 --- a/src/plugins/intel_gpu/src/graph/impls/ocl/random_uniform.cpp +++ b/src/plugins/intel_gpu/src/graph/impls/ocl/random_uniform.cpp @@ -61,4 +61,4 @@ attach_random_uniform_impl::attach_random_uniform_impl() { } // namespace ocl } // namespace cldnn -BIND_BINARY_BUFFER_WITH_TYPE(cldnn::ocl::random_uniform_impl, cldnn::object_type::RANDOM_UNIFORM_IMPL) +BIND_BINARY_BUFFER_WITH_TYPE(cldnn::ocl::random_uniform_impl) diff --git a/src/plugins/intel_gpu/src/graph/impls/ocl/range.cpp b/src/plugins/intel_gpu/src/graph/impls/ocl/range.cpp index 417e92f283907f..c2c1d2bc797fdb 100644 --- a/src/plugins/intel_gpu/src/graph/impls/ocl/range.cpp +++ b/src/plugins/intel_gpu/src/graph/impls/ocl/range.cpp @@ -56,4 +56,4 @@ attach_range_impl::attach_range_impl() { } // namespace ocl } // namespace cldnn -BIND_BINARY_BUFFER_WITH_TYPE(cldnn::ocl::range_impl, cldnn::object_type::RANGE_IMPL) +BIND_BINARY_BUFFER_WITH_TYPE(cldnn::ocl::range_impl) diff --git a/src/plugins/intel_gpu/src/graph/impls/ocl/reduce.cpp b/src/plugins/intel_gpu/src/graph/impls/ocl/reduce.cpp index b3a2d889f883d5..cf4aa3892a3bb7 100644 --- a/src/plugins/intel_gpu/src/graph/impls/ocl/reduce.cpp +++ b/src/plugins/intel_gpu/src/graph/impls/ocl/reduce.cpp @@ -137,4 +137,4 @@ attach_reduce_impl::attach_reduce_impl() { } // namespace ocl } // namespace cldnn -BIND_BINARY_BUFFER_WITH_TYPE(cldnn::ocl::reduce_impl, cldnn::object_type::REDUCE_IMPL) +BIND_BINARY_BUFFER_WITH_TYPE(cldnn::ocl::reduce_impl) diff --git a/src/plugins/intel_gpu/src/graph/impls/ocl/region_yolo.cpp b/src/plugins/intel_gpu/src/graph/impls/ocl/region_yolo.cpp index 129ccb89a6d862..267902044ef921 100644 --- a/src/plugins/intel_gpu/src/graph/impls/ocl/region_yolo.cpp +++ b/src/plugins/intel_gpu/src/graph/impls/ocl/region_yolo.cpp @@ -59,4 +59,4 @@ attach_region_yolo_impl::attach_region_yolo_impl() { } // namespace ocl } // namespace cldnn -BIND_BINARY_BUFFER_WITH_TYPE(cldnn::ocl::region_yolo_impl, cldnn::object_type::REGION_YOLO_IMPL) +BIND_BINARY_BUFFER_WITH_TYPE(cldnn::ocl::region_yolo_impl) diff --git a/src/plugins/intel_gpu/src/graph/impls/ocl/reorder.cpp b/src/plugins/intel_gpu/src/graph/impls/ocl/reorder.cpp index 7c97252703f5b9..3eb1ffe8896b6c 100644 --- a/src/plugins/intel_gpu/src/graph/impls/ocl/reorder.cpp +++ b/src/plugins/intel_gpu/src/graph/impls/ocl/reorder.cpp @@ -150,4 +150,4 @@ attach_reorder_impl::attach_reorder_impl() { } // namespace ocl } // namespace cldnn -BIND_BINARY_BUFFER_WITH_TYPE(cldnn::ocl::reorder_impl, cldnn::object_type::REORDER_IMPL) +BIND_BINARY_BUFFER_WITH_TYPE(cldnn::ocl::reorder_impl) diff --git a/src/plugins/intel_gpu/src/graph/impls/ocl/reorg_yolo.cpp b/src/plugins/intel_gpu/src/graph/impls/ocl/reorg_yolo.cpp index 53ca76294cc481..6f2e50ff59703a 100644 --- a/src/plugins/intel_gpu/src/graph/impls/ocl/reorg_yolo.cpp +++ b/src/plugins/intel_gpu/src/graph/impls/ocl/reorg_yolo.cpp @@ -57,4 +57,4 @@ attach_reorg_yolo_impl::attach_reorg_yolo_impl() { } // namespace ocl } // namespace cldnn -BIND_BINARY_BUFFER_WITH_TYPE(cldnn::ocl::reorg_yolo_impl, cldnn::object_type::REORG_YOLO_IMPL) +BIND_BINARY_BUFFER_WITH_TYPE(cldnn::ocl::reorg_yolo_impl) diff --git a/src/plugins/intel_gpu/src/graph/impls/ocl/resample.cpp b/src/plugins/intel_gpu/src/graph/impls/ocl/resample.cpp index a8bb63fcfd7c48..6e83709366fc2a 100644 --- a/src/plugins/intel_gpu/src/graph/impls/ocl/resample.cpp +++ b/src/plugins/intel_gpu/src/graph/impls/ocl/resample.cpp @@ -208,4 +208,4 @@ attach_resample_impl::attach_resample_impl() { } // namespace ocl } // namespace cldnn -BIND_BINARY_BUFFER_WITH_TYPE(cldnn::ocl::resample_impl, cldnn::object_type::RESAMPLE_IMPL) +BIND_BINARY_BUFFER_WITH_TYPE(cldnn::ocl::resample_impl) diff --git a/src/plugins/intel_gpu/src/graph/impls/ocl/reshape.cpp b/src/plugins/intel_gpu/src/graph/impls/ocl/reshape.cpp index 05aed4f0e8f69a..af8fe76b3ad747 100644 --- a/src/plugins/intel_gpu/src/graph/impls/ocl/reshape.cpp +++ b/src/plugins/intel_gpu/src/graph/impls/ocl/reshape.cpp @@ -43,4 +43,4 @@ attach_reshape_impl::attach_reshape_impl() { } // namespace ocl } // namespace cldnn -BIND_BINARY_BUFFER_WITH_TYPE(cldnn::ocl::reshape_impl, cldnn::object_type::RESHAPE_IMPL) +BIND_BINARY_BUFFER_WITH_TYPE(cldnn::ocl::reshape_impl) diff --git a/src/plugins/intel_gpu/src/graph/impls/ocl/reverse.cpp b/src/plugins/intel_gpu/src/graph/impls/ocl/reverse.cpp index 2f0c27214017ae..2d6b2601ac6dcb 100644 --- a/src/plugins/intel_gpu/src/graph/impls/ocl/reverse.cpp +++ b/src/plugins/intel_gpu/src/graph/impls/ocl/reverse.cpp @@ -75,4 +75,4 @@ attach_reverse_impl::attach_reverse_impl() { } // namespace ocl } // namespace cldnn -BIND_BINARY_BUFFER_WITH_TYPE(cldnn::ocl::reverse_impl, cldnn::object_type::REVERSE_IMPL) +BIND_BINARY_BUFFER_WITH_TYPE(cldnn::ocl::reverse_impl) diff --git a/src/plugins/intel_gpu/src/graph/impls/ocl/reverse_sequence.cpp b/src/plugins/intel_gpu/src/graph/impls/ocl/reverse_sequence.cpp index a4db466c40c611..f4b89d9fb0f5c3 100644 --- a/src/plugins/intel_gpu/src/graph/impls/ocl/reverse_sequence.cpp +++ b/src/plugins/intel_gpu/src/graph/impls/ocl/reverse_sequence.cpp @@ -56,4 +56,4 @@ attach_reverse_sequence_impl::attach_reverse_sequence_impl() { } // namespace ocl } // namespace cldnn -BIND_BINARY_BUFFER_WITH_TYPE(cldnn::ocl::reverse_sequence_impl, cldnn::object_type::REVERSE_SEQUENCE_IMPL) +BIND_BINARY_BUFFER_WITH_TYPE(cldnn::ocl::reverse_sequence_impl) diff --git a/src/plugins/intel_gpu/src/graph/impls/ocl/roi_align.cpp b/src/plugins/intel_gpu/src/graph/impls/ocl/roi_align.cpp index 3a1ddc1def06ef..64d210a721d25e 100644 --- a/src/plugins/intel_gpu/src/graph/impls/ocl/roi_align.cpp +++ b/src/plugins/intel_gpu/src/graph/impls/ocl/roi_align.cpp @@ -98,4 +98,4 @@ attach_roi_align_impl::attach_roi_align_impl() { } // namespace ocl } // namespace cldnn -BIND_BINARY_BUFFER_WITH_TYPE(cldnn::ocl::roi_align_impl, cldnn::object_type::ROI_ALIGN_IMPL) +BIND_BINARY_BUFFER_WITH_TYPE(cldnn::ocl::roi_align_impl) diff --git a/src/plugins/intel_gpu/src/graph/impls/ocl/roi_pooling.cpp b/src/plugins/intel_gpu/src/graph/impls/ocl/roi_pooling.cpp index cd739863ffb59d..c7e623f903b512 100644 --- a/src/plugins/intel_gpu/src/graph/impls/ocl/roi_pooling.cpp +++ b/src/plugins/intel_gpu/src/graph/impls/ocl/roi_pooling.cpp @@ -108,4 +108,4 @@ attach_roi_pooling_impl::attach_roi_pooling_impl() { } // namespace ocl } // namespace cldnn -BIND_BINARY_BUFFER_WITH_TYPE(cldnn::ocl::roi_pooling_impl, cldnn::object_type::ROI_POOLING_IMPL) +BIND_BINARY_BUFFER_WITH_TYPE(cldnn::ocl::roi_pooling_impl) diff --git a/src/plugins/intel_gpu/src/graph/impls/ocl/roll.cpp b/src/plugins/intel_gpu/src/graph/impls/ocl/roll.cpp index eabf566017aa07..3d2574d836c6ae 100644 --- a/src/plugins/intel_gpu/src/graph/impls/ocl/roll.cpp +++ b/src/plugins/intel_gpu/src/graph/impls/ocl/roll.cpp @@ -69,4 +69,4 @@ attach_roll_impl::attach_roll_impl() { } // namespace ocl } // namespace cldnn -BIND_BINARY_BUFFER_WITH_TYPE(cldnn::ocl::roll_impl, cldnn::object_type::ROLL_IMPL) +BIND_BINARY_BUFFER_WITH_TYPE(cldnn::ocl::roll_impl) diff --git a/src/plugins/intel_gpu/src/graph/impls/ocl/scatter_elements_update.cpp b/src/plugins/intel_gpu/src/graph/impls/ocl/scatter_elements_update.cpp index 60f86bbde7db9b..f393297a0cd35a 100644 --- a/src/plugins/intel_gpu/src/graph/impls/ocl/scatter_elements_update.cpp +++ b/src/plugins/intel_gpu/src/graph/impls/ocl/scatter_elements_update.cpp @@ -99,5 +99,4 @@ attach_scatter_elements_update_impl::attach_scatter_elements_update_impl() { } // namespace ocl } // namespace cldnn -BIND_BINARY_BUFFER_WITH_TYPE(cldnn::ocl::scatter_elements_update_impl, - cldnn::object_type::SCATTER_ELEMENTS_UPDATE_IMPL) +BIND_BINARY_BUFFER_WITH_TYPE(cldnn::ocl::scatter_elements_update_impl) diff --git a/src/plugins/intel_gpu/src/graph/impls/ocl/scatter_nd_update.cpp b/src/plugins/intel_gpu/src/graph/impls/ocl/scatter_nd_update.cpp index 8747bd1a181b17..2a1f66690df02b 100644 --- a/src/plugins/intel_gpu/src/graph/impls/ocl/scatter_nd_update.cpp +++ b/src/plugins/intel_gpu/src/graph/impls/ocl/scatter_nd_update.cpp @@ -141,4 +141,4 @@ attach_scatter_nd_update_impl::attach_scatter_nd_update_impl() { } // namespace ocl } // namespace cldnn -BIND_BINARY_BUFFER_WITH_TYPE(cldnn::ocl::scatter_nd_update_impl, cldnn::object_type::SCATTER_ND_UPDATE_IMPL) +BIND_BINARY_BUFFER_WITH_TYPE(cldnn::ocl::scatter_nd_update_impl) diff --git a/src/plugins/intel_gpu/src/graph/impls/ocl/scatter_update.cpp b/src/plugins/intel_gpu/src/graph/impls/ocl/scatter_update.cpp index 49e9d31259981b..b8b063531928dd 100644 --- a/src/plugins/intel_gpu/src/graph/impls/ocl/scatter_update.cpp +++ b/src/plugins/intel_gpu/src/graph/impls/ocl/scatter_update.cpp @@ -94,4 +94,4 @@ attach_scatter_update_impl::attach_scatter_update_impl() { } // namespace ocl } // namespace cldnn -BIND_BINARY_BUFFER_WITH_TYPE(cldnn::ocl::scatter_update_impl, cldnn::object_type::SCATTER_UPDATE_IMPL) +BIND_BINARY_BUFFER_WITH_TYPE(cldnn::ocl::scatter_update_impl) diff --git a/src/plugins/intel_gpu/src/graph/impls/ocl/select.cpp b/src/plugins/intel_gpu/src/graph/impls/ocl/select.cpp index c128280238abd9..c7c48a44e7b955 100644 --- a/src/plugins/intel_gpu/src/graph/impls/ocl/select.cpp +++ b/src/plugins/intel_gpu/src/graph/impls/ocl/select.cpp @@ -87,4 +87,4 @@ attach_select_impl::attach_select_impl() { } // namespace ocl } // namespace cldnn -BIND_BINARY_BUFFER_WITH_TYPE(cldnn::ocl::select_impl, cldnn::object_type::SELECT_IMPL) +BIND_BINARY_BUFFER_WITH_TYPE(cldnn::ocl::select_impl) diff --git a/src/plugins/intel_gpu/src/graph/impls/ocl/shape_of.cpp b/src/plugins/intel_gpu/src/graph/impls/ocl/shape_of.cpp index f95caf65c48e60..844da59e42964e 100644 --- a/src/plugins/intel_gpu/src/graph/impls/ocl/shape_of.cpp +++ b/src/plugins/intel_gpu/src/graph/impls/ocl/shape_of.cpp @@ -47,4 +47,4 @@ attach_shape_of_impl::attach_shape_of_impl() { } // namespace ocl } // namespace cldnn -BIND_BINARY_BUFFER_WITH_TYPE(cldnn::ocl::shape_of_impl, cldnn::object_type::SHAPE_OF_IMPL) +BIND_BINARY_BUFFER_WITH_TYPE(cldnn::ocl::shape_of_impl) diff --git a/src/plugins/intel_gpu/src/graph/impls/ocl/shuffle_channels.cpp b/src/plugins/intel_gpu/src/graph/impls/ocl/shuffle_channels.cpp index 99aeb5eb3130bb..674bc32869b7e4 100644 --- a/src/plugins/intel_gpu/src/graph/impls/ocl/shuffle_channels.cpp +++ b/src/plugins/intel_gpu/src/graph/impls/ocl/shuffle_channels.cpp @@ -74,4 +74,4 @@ attach_shuffle_channels_impl::attach_shuffle_channels_impl() { } // namespace ocl } // namespace cldnn -BIND_BINARY_BUFFER_WITH_TYPE(cldnn::ocl::shuffle_channels_impl, cldnn::object_type::SHUFFLE_CHANNELS_IMPL) +BIND_BINARY_BUFFER_WITH_TYPE(cldnn::ocl::shuffle_channels_impl) diff --git a/src/plugins/intel_gpu/src/graph/impls/ocl/slice.cpp b/src/plugins/intel_gpu/src/graph/impls/ocl/slice.cpp index fb5905ceb1c7f8..19e537e8fc2800 100644 --- a/src/plugins/intel_gpu/src/graph/impls/ocl/slice.cpp +++ b/src/plugins/intel_gpu/src/graph/impls/ocl/slice.cpp @@ -137,4 +137,4 @@ attach_slice_impl::attach_slice_impl() { } // namespace ocl } // namespace cldnn -BIND_BINARY_BUFFER_WITH_TYPE(cldnn::ocl::slice_impl, cldnn::object_type::SLICE_IMPL) +BIND_BINARY_BUFFER_WITH_TYPE(cldnn::ocl::slice_impl) diff --git a/src/plugins/intel_gpu/src/graph/impls/ocl/softmax.cpp b/src/plugins/intel_gpu/src/graph/impls/ocl/softmax.cpp index bd0c16f19a896c..1b211f63cb8f36 100644 --- a/src/plugins/intel_gpu/src/graph/impls/ocl/softmax.cpp +++ b/src/plugins/intel_gpu/src/graph/impls/ocl/softmax.cpp @@ -77,4 +77,4 @@ attach_softmax_impl::attach_softmax_impl() { } // namespace ocl } // namespace cldnn -BIND_BINARY_BUFFER_WITH_TYPE(cldnn::ocl::softmax_impl, cldnn::object_type::SOFTMAX_IMPL) +BIND_BINARY_BUFFER_WITH_TYPE(cldnn::ocl::softmax_impl) diff --git a/src/plugins/intel_gpu/src/graph/impls/ocl/space_to_batch.cpp b/src/plugins/intel_gpu/src/graph/impls/ocl/space_to_batch.cpp index f29fb6cda50b83..0c7841a9226b07 100644 --- a/src/plugins/intel_gpu/src/graph/impls/ocl/space_to_batch.cpp +++ b/src/plugins/intel_gpu/src/graph/impls/ocl/space_to_batch.cpp @@ -68,4 +68,4 @@ attach_space_to_batch_impl::attach_space_to_batch_impl() { } // namespace ocl } // namespace cldnn -BIND_BINARY_BUFFER_WITH_TYPE(cldnn::ocl::space_to_batch_impl, cldnn::object_type::SPACE_TO_BATCH_IMPL) +BIND_BINARY_BUFFER_WITH_TYPE(cldnn::ocl::space_to_batch_impl) diff --git a/src/plugins/intel_gpu/src/graph/impls/ocl/space_to_depth.cpp b/src/plugins/intel_gpu/src/graph/impls/ocl/space_to_depth.cpp index a4963010495e4c..70556e0e08a0af 100644 --- a/src/plugins/intel_gpu/src/graph/impls/ocl/space_to_depth.cpp +++ b/src/plugins/intel_gpu/src/graph/impls/ocl/space_to_depth.cpp @@ -68,4 +68,4 @@ attach_space_to_depth_impl::attach_space_to_depth_impl() { } // namespace ocl } // namespace cldnn -BIND_BINARY_BUFFER_WITH_TYPE(cldnn::ocl::space_to_depth_impl, cldnn::object_type::SPACE_TO_DEPTH_IMPL) +BIND_BINARY_BUFFER_WITH_TYPE(cldnn::ocl::space_to_depth_impl) diff --git a/src/plugins/intel_gpu/src/graph/impls/ocl/strided_slice.cpp b/src/plugins/intel_gpu/src/graph/impls/ocl/strided_slice.cpp index 3cbc1d4eb7f783..10f181f17fd7f6 100644 --- a/src/plugins/intel_gpu/src/graph/impls/ocl/strided_slice.cpp +++ b/src/plugins/intel_gpu/src/graph/impls/ocl/strided_slice.cpp @@ -165,4 +165,4 @@ attach_strided_slice_impl::attach_strided_slice_impl() { } // namespace ocl } // namespace cldnn -BIND_BINARY_BUFFER_WITH_TYPE(cldnn::ocl::strided_slice_impl, cldnn::object_type::STRIDED_SLICE_IMPL) +BIND_BINARY_BUFFER_WITH_TYPE(cldnn::ocl::strided_slice_impl) diff --git a/src/plugins/intel_gpu/src/graph/impls/ocl/tile.cpp b/src/plugins/intel_gpu/src/graph/impls/ocl/tile.cpp index b8153a8f9d73f9..d1bcc719e2ace7 100644 --- a/src/plugins/intel_gpu/src/graph/impls/ocl/tile.cpp +++ b/src/plugins/intel_gpu/src/graph/impls/ocl/tile.cpp @@ -76,4 +76,4 @@ attach_tile_impl::attach_tile_impl() { } // namespace ocl } // namespace cldnn -BIND_BINARY_BUFFER_WITH_TYPE(cldnn::ocl::tile_impl, cldnn::object_type::TILE_IMPL) +BIND_BINARY_BUFFER_WITH_TYPE(cldnn::ocl::tile_impl) diff --git a/src/plugins/intel_gpu/src/graph/impls/onednn/concatenation_onednn.cpp b/src/plugins/intel_gpu/src/graph/impls/onednn/concatenation_onednn.cpp index 0ea0e571655e7e..4a410289e908ea 100644 --- a/src/plugins/intel_gpu/src/graph/impls/onednn/concatenation_onednn.cpp +++ b/src/plugins/intel_gpu/src/graph/impls/onednn/concatenation_onednn.cpp @@ -152,4 +152,4 @@ attach_concatenation_onednn::attach_concatenation_onednn() { } // namespace onednn } // namespace cldnn -BIND_BINARY_BUFFER_WITH_TYPE(cldnn::onednn::concatenation_onednn, cldnn::object_type::CONCATENATION_ONEDNN) +BIND_BINARY_BUFFER_WITH_TYPE(cldnn::onednn::concatenation_onednn) diff --git a/src/plugins/intel_gpu/src/graph/impls/onednn/convolution_onednn.cpp b/src/plugins/intel_gpu/src/graph/impls/onednn/convolution_onednn.cpp index 593ee455a45fe7..02c00599eec361 100644 --- a/src/plugins/intel_gpu/src/graph/impls/onednn/convolution_onednn.cpp +++ b/src/plugins/intel_gpu/src/graph/impls/onednn/convolution_onednn.cpp @@ -266,4 +266,4 @@ attach_convolution_onednn::attach_convolution_onednn() { } // namespace onednn } // namespace cldnn -BIND_BINARY_BUFFER_WITH_TYPE(cldnn::onednn::convolution_onednn, cldnn::object_type::CONVOLUTION_ONEDNN) +BIND_BINARY_BUFFER_WITH_TYPE(cldnn::onednn::convolution_onednn) diff --git a/src/plugins/intel_gpu/src/graph/impls/onednn/deconvolution_onednn.cpp b/src/plugins/intel_gpu/src/graph/impls/onednn/deconvolution_onednn.cpp index bd1c6a1fa15662..2848691fb5a300 100644 --- a/src/plugins/intel_gpu/src/graph/impls/onednn/deconvolution_onednn.cpp +++ b/src/plugins/intel_gpu/src/graph/impls/onednn/deconvolution_onednn.cpp @@ -168,4 +168,4 @@ attach_deconvolution_onednn::attach_deconvolution_onednn() { } // namespace onednn } // namespace cldnn -BIND_BINARY_BUFFER_WITH_TYPE(cldnn::onednn::deconvolution_onednn, cldnn::object_type::DECONVOLUTION_ONEDNN) +BIND_BINARY_BUFFER_WITH_TYPE(cldnn::onednn::deconvolution_onednn) diff --git a/src/plugins/intel_gpu/src/graph/impls/onednn/fully_connected_onednn.cpp b/src/plugins/intel_gpu/src/graph/impls/onednn/fully_connected_onednn.cpp index c01cf59b2030cc..e7b480abeeabd2 100644 --- a/src/plugins/intel_gpu/src/graph/impls/onednn/fully_connected_onednn.cpp +++ b/src/plugins/intel_gpu/src/graph/impls/onednn/fully_connected_onednn.cpp @@ -218,4 +218,4 @@ attach_fully_connected_onednn::attach_fully_connected_onednn() { } // namespace onednn } // namespace cldnn -BIND_BINARY_BUFFER_WITH_TYPE(cldnn::onednn::fully_connected_onednn, cldnn::object_type::FULLY_CONNECTED_ONEDNN) +BIND_BINARY_BUFFER_WITH_TYPE(cldnn::onednn::fully_connected_onednn) diff --git a/src/plugins/intel_gpu/src/graph/impls/onednn/gemm_onednn.cpp b/src/plugins/intel_gpu/src/graph/impls/onednn/gemm_onednn.cpp index bcf130525feef4..3f51bf59281bed 100644 --- a/src/plugins/intel_gpu/src/graph/impls/onednn/gemm_onednn.cpp +++ b/src/plugins/intel_gpu/src/graph/impls/onednn/gemm_onednn.cpp @@ -263,4 +263,4 @@ attach_gemm_onednn::attach_gemm_onednn() { } // namespace onednn } // namespace cldnn -BIND_BINARY_BUFFER_WITH_TYPE(cldnn::onednn::gemm_onednn, cldnn::object_type::GEMM_ONEDNN) +BIND_BINARY_BUFFER_WITH_TYPE(cldnn::onednn::gemm_onednn) diff --git a/src/plugins/intel_gpu/src/graph/impls/onednn/pooling_onednn.cpp b/src/plugins/intel_gpu/src/graph/impls/onednn/pooling_onednn.cpp index 61717bc2083647..f1b3d04969f080 100644 --- a/src/plugins/intel_gpu/src/graph/impls/onednn/pooling_onednn.cpp +++ b/src/plugins/intel_gpu/src/graph/impls/onednn/pooling_onednn.cpp @@ -129,4 +129,4 @@ attach_pooling_onednn::attach_pooling_onednn() { } // namespace onednn } // namespace cldnn -BIND_BINARY_BUFFER_WITH_TYPE(cldnn::onednn::pooling_onednn, cldnn::object_type::POOLING_ONEDNN) +BIND_BINARY_BUFFER_WITH_TYPE(cldnn::onednn::pooling_onednn) diff --git a/src/plugins/intel_gpu/src/graph/impls/onednn/primitive_onednn_base.h b/src/plugins/intel_gpu/src/graph/impls/onednn/primitive_onednn_base.h index 2207245d0e3e94..398546c4774831 100644 --- a/src/plugins/intel_gpu/src/graph/impls/onednn/primitive_onednn_base.h +++ b/src/plugins/intel_gpu/src/graph/impls/onednn/primitive_onednn_base.h @@ -5,6 +5,7 @@ #pragma once #include "primitive_inst.h" +#include "intel_gpu/graph/serialization/binary_buffer.hpp" #include "intel_gpu/runtime/error_handler.hpp" #include "intel_gpu/runtime/memory.hpp" #include "to_string_utils.h" @@ -17,7 +18,6 @@ #include "reorder/reorder_weights_kernel_selector.h" #include "reorder/reorder_kernel_base.h" -#include "serialization/binary_buffer.hpp" #include #include @@ -67,6 +67,10 @@ struct typed_primitive_onednn_impl : public typed_primitive_impl { bool is_cpu() const override { return false; } + // Cache blob format: + // [ dnnl::primitive_attr ] + // [ dnnl::primitive_desc ] + // [ dnnl::cache_blob ] void save(BinaryOutputBuffer& ob) const override { if (_attrs.get() == nullptr) { ob << false; diff --git a/src/plugins/intel_gpu/src/graph/impls/onednn/reduction_onednn.cpp b/src/plugins/intel_gpu/src/graph/impls/onednn/reduction_onednn.cpp index ef25e17f5d8487..341a2fdb78612b 100644 --- a/src/plugins/intel_gpu/src/graph/impls/onednn/reduction_onednn.cpp +++ b/src/plugins/intel_gpu/src/graph/impls/onednn/reduction_onednn.cpp @@ -158,4 +158,4 @@ attach_reduction_onednn::attach_reduction_onednn() { } // namespace onednn } // namespace cldnn -BIND_BINARY_BUFFER_WITH_TYPE(cldnn::onednn::reduction_onednn, cldnn::object_type::REDUCTION_ONEDNN) +BIND_BINARY_BUFFER_WITH_TYPE(cldnn::onednn::reduction_onednn) diff --git a/src/plugins/intel_gpu/src/graph/impls/onednn/reorder_onednn.cpp b/src/plugins/intel_gpu/src/graph/impls/onednn/reorder_onednn.cpp index 3b7906aace2388..14d5b782bed51c 100644 --- a/src/plugins/intel_gpu/src/graph/impls/onednn/reorder_onednn.cpp +++ b/src/plugins/intel_gpu/src/graph/impls/onednn/reorder_onednn.cpp @@ -105,4 +105,4 @@ attach_reorder_onednn::attach_reorder_onednn() { } // namespace onednn } // namespace cldnn -BIND_BINARY_BUFFER_WITH_TYPE(cldnn::onednn::reorder_onednn, cldnn::object_type::REORDER_ONEDNN) +BIND_BINARY_BUFFER_WITH_TYPE(cldnn::onednn::reorder_onednn) diff --git a/src/plugins/intel_gpu/src/graph/include/data_inst.h b/src/plugins/intel_gpu/src/graph/include/data_inst.h index bc872844e160e7..bfd541e4ec3330 100644 --- a/src/plugins/intel_gpu/src/graph/include/data_inst.h +++ b/src/plugins/intel_gpu/src/graph/include/data_inst.h @@ -42,6 +42,8 @@ class typed_primitive_inst : public typed_primitive_inst_base { public: typed_primitive_inst(network& network, data_node const& node); + void save(BinaryOutputBuffer& ob) const override; + void load(BinaryInputBuffer& ib) override; }; using data_inst = typed_primitive_inst; diff --git a/src/plugins/intel_gpu/src/graph/include/kernel_selector_helper.h b/src/plugins/intel_gpu/src/graph/include/kernel_selector_helper.h index 3f9b69702b8213..71d8e732c2b47e 100644 --- a/src/plugins/intel_gpu/src/graph/include/kernel_selector_helper.h +++ b/src/plugins/intel_gpu/src/graph/include/kernel_selector_helper.h @@ -4,6 +4,7 @@ #pragma once +#include "intel_gpu/graph/serialization/binary_buffer.hpp" #include "intel_gpu/runtime/engine.hpp" #include "intel_gpu/runtime/utils.hpp" #include "intel_gpu/runtime/tensor.hpp" @@ -17,7 +18,6 @@ #include "kernel_selector_common.h" #include "tensor_type.h" #include "fused_primitive_desc.h" -#include "serialization/binary_buffer.hpp" #include #include diff --git a/src/plugins/intel_gpu/src/graph/include/mutable_data_inst.h b/src/plugins/intel_gpu/src/graph/include/mutable_data_inst.h index c86171c75f6045..ab87272568ca00 100644 --- a/src/plugins/intel_gpu/src/graph/include/mutable_data_inst.h +++ b/src/plugins/intel_gpu/src/graph/include/mutable_data_inst.h @@ -44,9 +44,10 @@ class typed_primitive_inst : public typed_primitive_inst_base& get_user_ids() const { return _user_ids; } - void save(cldnn::BinaryOutputBuffer& ob) const override; - void load(cldnn::BinaryInputBuffer& ib) override; +private: + std::list _user_ids; }; using mutable_data_inst = typed_primitive_inst; diff --git a/src/plugins/intel_gpu/src/graph/include/primitive_inst.h b/src/plugins/intel_gpu/src/graph/include/primitive_inst.h index e0bab02d5c5a3e..f2f382381a483e 100644 --- a/src/plugins/intel_gpu/src/graph/include/primitive_inst.h +++ b/src/plugins/intel_gpu/src/graph/include/primitive_inst.h @@ -14,14 +14,13 @@ #include "meta_utils.h" #include "program_node.h" #include "primitive_type.h" -#include "serialization/binary_buffer.hpp" -#include "serialization/helpers.hpp" -#include "serialization/cl_kernel_data_serializer.hpp" -#include "serialization/object_types.hpp" -#include "serialization/polymorphic_serializer.hpp" -#include "serialization/string_serializer.hpp" -#include "serialization/layout_serializer.hpp" -#include "serialization/vector_serializer.hpp" +#include "intel_gpu/graph/serialization/binary_buffer.hpp" +#include "intel_gpu/graph/serialization/helpers.hpp" +#include "intel_gpu/graph/serialization/cl_kernel_data_serializer.hpp" +#include "intel_gpu/graph/serialization/polymorphic_serializer.hpp" +#include "intel_gpu/graph/serialization/string_serializer.hpp" +#include "intel_gpu/graph/serialization/layout_serializer.hpp" +#include "intel_gpu/graph/serialization/vector_serializer.hpp" #include "runtime/kernels_cache.hpp" #include @@ -33,8 +32,6 @@ namespace cldnn { // checks if any user in a list is a cpu primitive bool is_any_user_cpu(const std::list& users); -primitive_type_id get_type_id(std::string type_str); - class primitive_inst; template @@ -51,7 +48,7 @@ struct primitive_impl { virtual std::vector get_internal_buffer_layouts() const = 0; virtual void set_node_params(const program_node&) {} - virtual object_type get_type() const { return object_type::NONE; } + virtual std::string get_type() const = 0; virtual void set_arguments(primitive_inst& instance) = 0; virtual void set_arguments(kernel_arguments_data_idx& args_idx) = 0; virtual kernel_arguments_data get_arguments(const primitive_inst& instance) const = 0; @@ -64,11 +61,12 @@ struct primitive_impl { virtual bool is_cpu() const { return true; } virtual void init_kernels(const kernels_cache&) = 0; virtual std::unique_ptr clone() const = 0; - virtual std::vector get_kernel_ids() { + virtual std::vector get_kernel_ids() const { return {}; } virtual std::vector> get_kernels_source() { return {}; } virtual void set_kernels(std::vector) {} + virtual std::vector get_kernels() const { return {}; } virtual void set_kernel_ids(std::vector kernel_ids) {} virtual void save(cldnn::BinaryOutputBuffer& ob) const {} virtual void load(cldnn::BinaryInputBuffer& ib) {} diff --git a/src/plugins/intel_gpu/src/graph/include/serialization/object_types.hpp b/src/plugins/intel_gpu/src/graph/include/serialization/object_types.hpp deleted file mode 100644 index 3fcf15d8eaec26..00000000000000 --- a/src/plugins/intel_gpu/src/graph/include/serialization/object_types.hpp +++ /dev/null @@ -1,120 +0,0 @@ -// Copyright (C) 2018-2022 Intel Corporation -// SPDX-License-Identifier: Apache-2.0 -// - -/////////////////////////////////////////////////////////////////////////////////////////////////// -#pragma once - -namespace cldnn { - -enum class object_type { - ACTIVATION_IMPL, - ADAPTIVE_POOLING_IMPL, - ARG_MAX_MIN_IMPL, - ASSIGN_IMPL, - AVERAGE_UNPOOLING_IMPL, - BATCH_TO_SPACE_IMPL, - BINARY_CONVOLUTION_IMPL, - BORDER_IMPL, - BROADCAST_IMPL, - BUCKETIZE_IMPL, - CONCATENATION_IMPL, - CONVERT_COLOR_IMPL, - CONVOLUTION_IMPL, - CROP_IMPL, - CTC_GREEDY_DECODER_IMPL, - CTC_LOSS_IMPL, - CUM_SUM_IMPL, - CUSTOM_GPU_PRIMITIVE_IMPL, - DECONVOLUTION_IMPL, - DEFORMABLE_CONV_IMPL, - DEFORMABLE_INTERP_IMPL, - DEPTH_TO_SPACE_IMPL, - DETECTION_OUTPUT_IMPL_OCL, - DFT_IMPL, - ELTWISE_IMPL, - EMBEDDING_BAG_IMPL, - EXPERIMENTAL_DETECTRON_DETECTION_OUTPUT_IMPL, - EXPERIMENTAL_DETECTRON_GENERATE_PROPOSALS_SINGLE_IMAGE_IMPL, - EXPERIMENTAL_DETECTRON_PRIOR_GRID_GENERATOR_IMPL, - EXPERIMENTAL_DETECTRON_ROI_FEATURE_EXTRACTOR_IMPL, - EXPERIMENTAL_DETECTRON_TOPK_ROIS_IMPL, - EXTRACT_IMAGE_PATCHES_IMPL, - EYE_IMPL, - FULLY_CONNECTED_IMPL, - FUSED_CONV_ELTWISE_IMPL, - GATHER_ELEMENTS_IMPL, - GATHER_ND_IMPL, - GATHER_TREE_IMPL, - GATHER_IMPL, - GEMM_IMPL, - GENERATE_PROPOSALS_IMPL, - GENERIC_LAYER_IMPL, - GRID_SAMPLE_IMPL, - GRN_IMPL, - LRN_IMPL, - LSTM_DYNAMIC_INPUT_IMPL, - LSTM_DYNAMIC_TIMELOOP_IMPL, - LSTM_ELT_IMPL, - LSTM_GEMM_IMPL, - MAX_UNPOOLING_IMPL, - MULTICLASS_NMS_IMPL, - MUTABLE_DATA_IMPL, - MVN_IMPL, - NON_MAX_SUPPRESSION_IMPL_OCL, - COUNT_NONZERO_IMPL, - GATHER_NONZERO_IMPL, - NORMALIZE_IMPL, - ONE_HOT_IMPL, - PERMUTE_IMPL, - POOLING_IMPL, - PRIOR_BOX_IMPL, - PYRAMID_ROI_ALIGN_IMPL, - QUANTIZE_IMPL, - RANDOM_UNIFORM_IMPL, - RANGE_IMPL, - READ_VALUE_IMPL, - REDUCE_IMPL, - REGION_YOLO_IMPL, - REORDER_IMPL, - REORG_YOLO_IMPL, - RESAMPLE_IMPL, - RESHAPE_IMPL, - REVERSE_SEQUENCE_IMPL, - REVERSE_IMPL, - ROI_ALIGN_IMPL, - ROI_POOLING_IMPL, - ROLL_IMPL, - SCALE_IMPL, - SCATTER_ELEMENTS_UPDATE_IMPL, - SCATTER_ND_UPDATE_IMPL, - SCATTER_UPDATE_IMPL, - SELECT_IMPL, - SHAPE_OF_IMPL, - SHUFFLE_CHANNELS_IMPL, - SLICE_IMPL, - SOFTMAX_IMPL, - SPACE_TO_BATCH_IMPL, - SPACE_TO_DEPTH_IMPL, - STRIDED_SLICE_IMPL, - TILE_IMPL, - WAIT_FOR_EVENTS_IMPL, - CONDITION_IMPL, - LOOP_IMPL, - DETECTION_OUTPUT_IMPL_CPU, - NON_MAX_SUPPRESSION_IMPL_CPU, - PROPOSAL_IMPL_CPU, - DATA_INST, - EXECUTABLE_INST, - CONVOLUTION_ONEDNN, - POOLING_ONEDNN, - CONCATENATION_ONEDNN, - DECONVOLUTION_ONEDNN, - FULLY_CONNECTED_ONEDNN, - GEMM_ONEDNN, - REDUCTION_ONEDNN, - REORDER_ONEDNN, - NONE -}; - -} //namespace cldnn \ No newline at end of file diff --git a/src/plugins/intel_gpu/src/graph/input_layout.cpp b/src/plugins/intel_gpu/src/graph/input_layout.cpp index 607bae3f1f1a6f..e884ae184e7210 100644 --- a/src/plugins/intel_gpu/src/graph/input_layout.cpp +++ b/src/plugins/intel_gpu/src/graph/input_layout.cpp @@ -25,10 +25,7 @@ bool has_optimized_users(input_layout_node const& node) { } // namespace namespace cldnn { -primitive_type_id input_layout::type_id() { - static primitive_type_base instance; - return &instance; -} +GPU_DEFINE_PRIMITIVE_TYPE_ID(input_layout) input_layout_node::typed_program_node(const std::shared_ptr dprim, program& prog) : parent(dprim, prog) { diff --git a/src/plugins/intel_gpu/src/graph/kernel_selector_helper.cpp b/src/plugins/intel_gpu/src/graph/kernel_selector_helper.cpp index 8721234761a12a..706e784e7023e8 100644 --- a/src/plugins/intel_gpu/src/graph/kernel_selector_helper.cpp +++ b/src/plugins/intel_gpu/src/graph/kernel_selector_helper.cpp @@ -8,9 +8,9 @@ #include "kernel_selector_params.h" #include "to_string_utils.h" #include "program_node.h" -#include "serialization/layout_serializer.hpp" -#include "serialization/string_serializer.hpp" -#include "serialization/vector_serializer.hpp" +#include "intel_gpu/graph/serialization/layout_serializer.hpp" +#include "intel_gpu/graph/serialization/string_serializer.hpp" +#include "intel_gpu/graph/serialization/vector_serializer.hpp" #include #include diff --git a/src/plugins/intel_gpu/src/graph/loop.cpp b/src/plugins/intel_gpu/src/graph/loop.cpp index ff482136510e3c..516d452031f843 100644 --- a/src/plugins/intel_gpu/src/graph/loop.cpp +++ b/src/plugins/intel_gpu/src/graph/loop.cpp @@ -14,10 +14,7 @@ #include namespace cldnn { -primitive_type_id loop::type_id() { - static primitive_type_base instance; - return &instance; -} +GPU_DEFINE_PRIMITIVE_TYPE_ID(loop) static bool check_if_axis_is_set_properly(loop_node const & node) { const auto& input_primitive_maps = node.get_input_primitive_maps(); diff --git a/src/plugins/intel_gpu/src/graph/lrn.cpp b/src/plugins/intel_gpu/src/graph/lrn.cpp index d60c4b5909a3b3..9444e357245740 100644 --- a/src/plugins/intel_gpu/src/graph/lrn.cpp +++ b/src/plugins/intel_gpu/src/graph/lrn.cpp @@ -9,10 +9,7 @@ #include namespace cldnn { -primitive_type_id lrn::type_id() { - static primitive_type_base instance; - return &instance; -} +GPU_DEFINE_PRIMITIVE_TYPE_ID(lrn) layout lrn_inst::calc_output_layout(lrn_node const& node, kernel_impl_params const& impl_param) { assert(static_cast(impl_param.desc->output_data_type) == false && diff --git a/src/plugins/intel_gpu/src/graph/lstm.cpp b/src/plugins/intel_gpu/src/graph/lstm.cpp index 077336f48f1187..eba2522110c44e 100644 --- a/src/plugins/intel_gpu/src/graph/lstm.cpp +++ b/src/plugins/intel_gpu/src/graph/lstm.cpp @@ -10,10 +10,7 @@ #include namespace cldnn { -primitive_type_id lstm::type_id() { - static primitive_type_base instance; - return &instance; -} +GPU_DEFINE_PRIMITIVE_TYPE_ID(lstm) layout lstm_inst::calc_output_layout(lstm_node const& node, kernel_impl_params const& impl_param) { assert(static_cast(impl_param.desc->output_data_type) == false && diff --git a/src/plugins/intel_gpu/src/graph/lstm_dynamic.cpp b/src/plugins/intel_gpu/src/graph/lstm_dynamic.cpp index 409eca411d6e96..282f20cb2aae4a 100644 --- a/src/plugins/intel_gpu/src/graph/lstm_dynamic.cpp +++ b/src/plugins/intel_gpu/src/graph/lstm_dynamic.cpp @@ -10,10 +10,7 @@ #include namespace cldnn { -primitive_type_id lstm_dynamic::type_id() { - static primitive_type_base instance; - return &instance; -} +GPU_DEFINE_PRIMITIVE_TYPE_ID(lstm_dynamic) // input_tensor: [b: batch, f: max_sequence_length, x: input_size, y: direction] // weights_tensor: [b: 1, f: direction, x: input_size, y: 4 * hidden_size] diff --git a/src/plugins/intel_gpu/src/graph/lstm_dynamic_input.cpp b/src/plugins/intel_gpu/src/graph/lstm_dynamic_input.cpp index eeb9020d5c419a..ff91a43107a6a6 100644 --- a/src/plugins/intel_gpu/src/graph/lstm_dynamic_input.cpp +++ b/src/plugins/intel_gpu/src/graph/lstm_dynamic_input.cpp @@ -11,10 +11,7 @@ #include namespace cldnn { -primitive_type_id lstm_dynamic_input::type_id() { - static primitive_type_base instance; - return &instance; -} +GPU_DEFINE_PRIMITIVE_TYPE_ID(lstm_dynamic_input) // input_tensor: [b: batch, f: max_sequence_length, x: input_size, y: direction] // weights_tensor: [b: 1, f: direction, x: input_size, y: 4 * hidden_size] // output_tensor: [b: batch, f: max_sequence_length, x: 4 * hidden_size, y: direction] diff --git a/src/plugins/intel_gpu/src/graph/lstm_dynamic_timeloop.cpp b/src/plugins/intel_gpu/src/graph/lstm_dynamic_timeloop.cpp index e84cbf0cd7d7fd..dfe062deeda739 100644 --- a/src/plugins/intel_gpu/src/graph/lstm_dynamic_timeloop.cpp +++ b/src/plugins/intel_gpu/src/graph/lstm_dynamic_timeloop.cpp @@ -11,10 +11,7 @@ #include namespace cldnn { -primitive_type_id lstm_dynamic_timeloop::type_id() { - static primitive_type_base instance; - return &instance; -} +GPU_DEFINE_PRIMITIVE_TYPE_ID(lstm_dynamic_timeloop) program_node& lstm_dynamic_timeloop_node::get_dependency_by_name(std::string val) const { return get_dependency(get_dependency_idx(val)); diff --git a/src/plugins/intel_gpu/src/graph/lstm_elt.cpp b/src/plugins/intel_gpu/src/graph/lstm_elt.cpp index 62bb1f59fc514c..60702247f73faa 100644 --- a/src/plugins/intel_gpu/src/graph/lstm_elt.cpp +++ b/src/plugins/intel_gpu/src/graph/lstm_elt.cpp @@ -10,10 +10,7 @@ #include namespace cldnn { -primitive_type_id lstm_elt::type_id() { - static primitive_type_base instance; - return &instance; -} +GPU_DEFINE_PRIMITIVE_TYPE_ID(lstm_elt) layout lstm_elt_inst::calc_output_layout(lstm_elt_node const& node, kernel_impl_params const& impl_param) { assert(static_cast(impl_param.desc->output_data_type) == false && diff --git a/src/plugins/intel_gpu/src/graph/lstm_gemm.cpp b/src/plugins/intel_gpu/src/graph/lstm_gemm.cpp index 48d4fcdf5e75c8..60392acd7a50c3 100644 --- a/src/plugins/intel_gpu/src/graph/lstm_gemm.cpp +++ b/src/plugins/intel_gpu/src/graph/lstm_gemm.cpp @@ -10,10 +10,7 @@ #include namespace cldnn { -primitive_type_id lstm_gemm::type_id() { - static primitive_type_base instance; - return &instance; -} +GPU_DEFINE_PRIMITIVE_TYPE_ID(lstm_gemm) layout lstm_gemm_inst::calc_output_layout(lstm_gemm_node const& node, kernel_impl_params const& impl_param) { assert(static_cast(impl_param.desc->output_data_type) == false && diff --git a/src/plugins/intel_gpu/src/graph/matrix_nms.cpp b/src/plugins/intel_gpu/src/graph/matrix_nms.cpp index e7154e28d33acb..c2c927137ea834 100644 --- a/src/plugins/intel_gpu/src/graph/matrix_nms.cpp +++ b/src/plugins/intel_gpu/src/graph/matrix_nms.cpp @@ -11,10 +11,7 @@ #include "primitive_type_base.h" namespace cldnn { -primitive_type_id matrix_nms::type_id() { - static primitive_type_base instance; - return &instance; -} +GPU_DEFINE_PRIMITIVE_TYPE_ID(matrix_nms) layout matrix_nms_inst::calc_output_layout(const matrix_nms_node& node, const kernel_impl_params& impl_param) { const auto primitive = impl_param.typed_desc(); diff --git a/src/plugins/intel_gpu/src/graph/multiclass_nms.cpp b/src/plugins/intel_gpu/src/graph/multiclass_nms.cpp index b98a85bdef7816..394ea4bac47cc3 100644 --- a/src/plugins/intel_gpu/src/graph/multiclass_nms.cpp +++ b/src/plugins/intel_gpu/src/graph/multiclass_nms.cpp @@ -10,10 +10,7 @@ #include "primitive_type_base.h" namespace cldnn { -primitive_type_id multiclass_nms::type_id() { - static primitive_type_base instance; - return &instance; -} +GPU_DEFINE_PRIMITIVE_TYPE_ID(multiclass_nms) layout multiclass_nms_inst::calc_output_layout(const multiclass_nms_node& node, const kernel_impl_params& impl_param) { const auto input_layout = impl_param.get_input_layout(); diff --git a/src/plugins/intel_gpu/src/graph/mutable_data.cpp b/src/plugins/intel_gpu/src/graph/mutable_data.cpp index cf3e5a763e8145..95e345aac757b8 100644 --- a/src/plugins/intel_gpu/src/graph/mutable_data.cpp +++ b/src/plugins/intel_gpu/src/graph/mutable_data.cpp @@ -14,10 +14,7 @@ #include namespace cldnn { -primitive_type_id mutable_data::type_id() { - static primitive_type_base instance; - return &instance; -} +GPU_DEFINE_PRIMITIVE_TYPE_ID(mutable_data) namespace { memory::ptr attach_or_copy_data(network& network, memory::ptr mem, bool reuse) { @@ -77,35 +74,11 @@ void mutable_data_inst::set_output_memory(memory::ptr mem_new, bool check, size_ } mutable_data_inst::typed_primitive_inst(network& network, mutable_data_node const& node) - : parent(network, node, attach_or_copy_data(network, node.get_attached_memory_ptr(), network.is_primary_stream())) {} - -void mutable_data_inst::save(cldnn::BinaryOutputBuffer& ob) const { - parent::save(ob); - - if (!_mem_allocated) { - for (size_t dep_idx = 0; dep_idx < _deps.size(); ++dep_idx) { - for (size_t m_idx = 0; m_idx < _deps[dep_idx]->_deps.size(); ++m_idx) { - if (get_network().get_engine().is_the_same_buffer(*_outputs[0], *_deps[dep_idx]->_deps[m_idx]->_outputs[0])) { - ob << true << dep_idx << m_idx; - return; - } - } - } + : parent(network, node, attach_or_copy_data(network, node.get_attached_memory_ptr(), network.is_primary_stream())) { + const auto& users = get_users(); + for (const auto& usr : users) { + _user_ids.emplace_back(usr->id()); } - ob << false; } -void mutable_data_inst::load(cldnn::BinaryInputBuffer& ib) { - parent::load(ib); - - bool from_dep; - ib >> from_dep; - if (from_dep && !_mem_allocated) { - size_t dep_idx, m_idx; - ib >> dep_idx >> m_idx; - - auto prev_node = get_network().get_primitive(_dep_ids[dep_idx]); - _outputs[0] = get_network().get_primitive(prev_node->_dep_ids[m_idx])->output_memory_ptr(); - } -} } // namespace cldnn diff --git a/src/plugins/intel_gpu/src/graph/mvn.cpp b/src/plugins/intel_gpu/src/graph/mvn.cpp index 02ee0db81b99a6..fc1a23a34ab735 100644 --- a/src/plugins/intel_gpu/src/graph/mvn.cpp +++ b/src/plugins/intel_gpu/src/graph/mvn.cpp @@ -8,10 +8,7 @@ #include namespace cldnn { -primitive_type_id mvn::type_id() { - static primitive_type_base instance; - return &instance; -} +GPU_DEFINE_PRIMITIVE_TYPE_ID(mvn) layout mvn_inst::calc_output_layout(mvn_node const& node, kernel_impl_params const& impl_param) { auto input_node_layout = impl_param.get_non_padded_input_layout(); diff --git a/src/plugins/intel_gpu/src/graph/network.cpp b/src/plugins/intel_gpu/src/graph/network.cpp index fb6c090754b846..960d7eacda5fca 100644 --- a/src/plugins/intel_gpu/src/graph/network.cpp +++ b/src/plugins/intel_gpu/src/graph/network.cpp @@ -18,6 +18,7 @@ #include "intel_gpu/graph/program.hpp" #include "intel_gpu/graph/network.hpp" +#include "intel_gpu/graph/serialization/map_serializer.hpp" #include "assign_inst.h" #include "read_value_inst.h" #include "reshape_inst.h" @@ -32,7 +33,6 @@ #include "program_helpers.h" #include "runtime/cldnn_itt.hpp" #include "kernels_cache.hpp" -#include "serialization/map_serializer.hpp" #include #include @@ -269,6 +269,11 @@ void wait_for_the_turn() {} #endif } // namespace +static uint32_t get_unique_net_id() { + static std::atomic id_gen{0}; + return ++id_gen; +} + /* Network will always have net_id = 0 when it will be cldnn internal micronetwork (created i.e by propagate_constants opt pass). @@ -281,9 +286,8 @@ network::network(program::ptr program, stream::ptr stream, bool is_internal, boo , _internal(is_internal) , _is_primary_stream(is_primary_stream) , _reset_arguments(true) { - static std::atomic id_gen{0}; if (!_internal) { - net_id = ++id_gen; + net_id = get_unique_net_id(); } GPU_DEBUG_GET_INSTANCE(debug_config); @@ -327,31 +331,25 @@ network::network(program::ptr program, stream::ptr stream, uint16_t stream_id) network::network(cldnn::BinaryInputBuffer& ib, stream::ptr stream, engine& engine, uint16_t stream_id) : _program(nullptr) - , _engine(ib.get_engine()) + , _engine(engine) , _stream(stream) , _memory_pool(new memory_pool(engine)) , _internal(false) , _is_primary_stream(false) , _reset_arguments(true) { - net_id += 1; + net_id = get_unique_net_id(); - uint32_t prog_id; - std::vector batch_header_str; - ib >> prog_id; - ib >> batch_header_str; - kernels_cache kernels_cache(get_engine(), prog_id, batch_header_str); + kernels_cache kernels_cache(get_engine(), 0, {""}); ib >> kernels_cache; int num_data_nodes; ib >> num_data_nodes; - _memory_pool->clear_pool_for_network(net_id); - for (int i = 0; i < num_data_nodes; ++i) { std::string type; std::string _primitive_id; ib >> type >> _primitive_id; - std::shared_ptr new_primitive_inst = cldnn::get_type_id(type)->create_instance(*this); + std::shared_ptr new_primitive_inst = prim_map_storage::instance().get_type_id(type)->create_instance(*this); ib >> *new_primitive_inst; _primitives[_primitive_id] = new_primitive_inst; } @@ -365,7 +363,7 @@ network::network(cldnn::BinaryInputBuffer& ib, stream::ptr stream, engine& engin for (auto& type : _exec_order_types) { ib >> type; - std::shared_ptr new_primitive_inst = cldnn::get_type_id(type)->create_instance(*this); + std::shared_ptr new_primitive_inst = prim_map_storage::instance().get_type_id(type)->create_instance(*this); _exec_order.emplace_back(new_primitive_inst); } @@ -375,12 +373,18 @@ network::network(cldnn::BinaryInputBuffer& ib, stream::ptr stream, engine& engin for (const auto& p_inst : _exec_order) { ib >> *p_inst; _primitives[p_inst->id()] = p_inst; + p_inst->init_kernels(kernels_cache); + } + + for (auto& item : _primitives) { + auto& p_inst = item.second; if (p_inst->is_input()) _inputs.push_back(p_inst); - if (p_inst->is_output()) + if (p_inst->is_output()) { _outputs.push_back(p_inst); - - p_inst->init_kernels(kernels_cache); + if (p_inst->type() == cldnn::data::type_id()) + _data_outputs.push_back(p_inst); + } } for (auto p_inst : _exec_order) { @@ -428,8 +432,18 @@ network::~network() { } } +// Cache blob format: +// [ cldnn::kernels_cache ] +// [ non executable primitive_inst ] +// [ executable primitive_inst ] +// [ memory reuse information ] void network::save(cldnn::BinaryOutputBuffer& ob) { - ob << _program->get_kernels_cache(); + kernels_cache kernels_cache(get_engine(), 0, {""}); + for (const auto& p_inst : _exec_order) { + if (p_inst->get_impl() != nullptr) + kernels_cache.add_kernels(p_inst->get_impl()->get_kernel_ids(), p_inst->get_impl()->get_kernels()); + } + ob << kernels_cache; int num_data_nodes = 0; for (const auto& p_inst : _primitives) { @@ -594,9 +608,9 @@ network::output_chains_map::iterator network::add_output_chain(std::shared_ptr

get_users(); - for (const auto& usr : users) { - auto usr_prim = get_primitive(usr->id()); + const auto& user_ids = mdata_ptr->get_user_ids(); + for (const auto& id : user_ids) { + auto usr_prim = get_primitive(id); if (eng.is_the_same_buffer(mem_orig, usr_prim->output_memory())) { chain.push_back(usr_prim); } diff --git a/src/plugins/intel_gpu/src/graph/non_max_suppression.cpp b/src/plugins/intel_gpu/src/graph/non_max_suppression.cpp index 7d1b38def99c92..1f6c7d72f5032f 100644 --- a/src/plugins/intel_gpu/src/graph/non_max_suppression.cpp +++ b/src/plugins/intel_gpu/src/graph/non_max_suppression.cpp @@ -11,10 +11,7 @@ #include "nms_shape_inference.hpp" namespace cldnn { -primitive_type_id non_max_suppression::type_id() { - static primitive_type_base instance; - return &instance; -} +GPU_DEFINE_PRIMITIVE_TYPE_ID(non_max_suppression) layout non_max_suppression_inst::calc_output_layout(non_max_suppression_node const& node, kernel_impl_params const& impl_param) { auto desc = impl_param.typed_desc(); diff --git a/src/plugins/intel_gpu/src/graph/non_zero.cpp b/src/plugins/intel_gpu/src/graph/non_zero.cpp index cbe60bb6926b2f..32c173ef73e216 100644 --- a/src/plugins/intel_gpu/src/graph/non_zero.cpp +++ b/src/plugins/intel_gpu/src/graph/non_zero.cpp @@ -16,10 +16,7 @@ namespace cldnn { // ----------------------------------------------- // count_nonzero // ----------------------------------------------- -primitive_type_id count_nonzero::type_id() { - static primitive_type_base instance; - return &instance; -} +GPU_DEFINE_PRIMITIVE_TYPE_ID(count_nonzero) layout count_nonzero_inst::calc_output_layout(count_nonzero_node const& node, kernel_impl_params const& impl_param) { assert(static_cast(node.get_primitive()->output_data_type) == false && @@ -60,10 +57,7 @@ void count_nonzero_inst::on_execute() { // ----------------------------------------------- // gather_nonzero // ----------------------------------------------- -primitive_type_id gather_nonzero::type_id() { - static primitive_type_base instance; - return &instance; -} +GPU_DEFINE_PRIMITIVE_TYPE_ID(gather_nonzero) layout gather_nonzero_inst::calc_output_layout(gather_nonzero_node const& node, kernel_impl_params const& impl_param) { assert(static_cast(node.get_primitive()->output_data_type) == false && diff --git a/src/plugins/intel_gpu/src/graph/normalize.cpp b/src/plugins/intel_gpu/src/graph/normalize.cpp index efa690e770030a..5f70c59093e56b 100644 --- a/src/plugins/intel_gpu/src/graph/normalize.cpp +++ b/src/plugins/intel_gpu/src/graph/normalize.cpp @@ -9,10 +9,7 @@ #include namespace cldnn { -primitive_type_id normalize::type_id() { - static primitive_type_base instance; - return &instance; -} +GPU_DEFINE_PRIMITIVE_TYPE_ID(normalize) layout normalize_inst::calc_output_layout(normalize_node const& node, kernel_impl_params const& impl_param) { assert(static_cast(impl_param.desc->output_data_type) == false && diff --git a/src/plugins/intel_gpu/src/graph/one_hot.cpp b/src/plugins/intel_gpu/src/graph/one_hot.cpp index d222509e44d570..3dd48a8a7adcd2 100644 --- a/src/plugins/intel_gpu/src/graph/one_hot.cpp +++ b/src/plugins/intel_gpu/src/graph/one_hot.cpp @@ -13,10 +13,7 @@ #include "one_hot_shape_inference.hpp" namespace cldnn { -primitive_type_id one_hot::type_id() { - static primitive_type_base instance; - return &instance; -} +GPU_DEFINE_PRIMITIVE_TYPE_ID(one_hot) static bool is_output_bfzyx(const layout& input, int32_t axis) { if (input.format == format::bfzyx) diff --git a/src/plugins/intel_gpu/src/graph/permute.cpp b/src/plugins/intel_gpu/src/graph/permute.cpp index 89f6ec10f1c580..d25afad5acd157 100644 --- a/src/plugins/intel_gpu/src/graph/permute.cpp +++ b/src/plugins/intel_gpu/src/graph/permute.cpp @@ -13,11 +13,7 @@ #include namespace cldnn { - -primitive_type_id permute::type_id() { - static primitive_type_base instance; - return &instance; -} +GPU_DEFINE_PRIMITIVE_TYPE_ID(permute) layout permute_inst::calc_output_layout(permute_node const& node, kernel_impl_params const& impl_param) { assert(static_cast(impl_param.desc->output_data_type) == false && diff --git a/src/plugins/intel_gpu/src/graph/pooling.cpp b/src/plugins/intel_gpu/src/graph/pooling.cpp index 167bbcee23dced..581bae675a0c4f 100644 --- a/src/plugins/intel_gpu/src/graph/pooling.cpp +++ b/src/plugins/intel_gpu/src/graph/pooling.cpp @@ -16,10 +16,7 @@ using namespace ov::intel_gpu; namespace cldnn { -primitive_type_id pooling::type_id() { - static primitive_type_base instance; - return &instance; -} +GPU_DEFINE_PRIMITIVE_TYPE_ID(pooling) layout pooling_inst::calc_output_layout(parent::typed_node const& node, kernel_impl_params const& impl_param) { auto desc = impl_param.typed_desc(); diff --git a/src/plugins/intel_gpu/src/graph/primitive_inst.cpp b/src/plugins/intel_gpu/src/graph/primitive_inst.cpp index ae849ed9ced0a6..a04ec05f219100 100644 --- a/src/plugins/intel_gpu/src/graph/primitive_inst.cpp +++ b/src/plugins/intel_gpu/src/graph/primitive_inst.cpp @@ -19,12 +19,12 @@ #include "intel_gpu/plugin/common_utils.hpp" #include "intel_gpu/graph/network.hpp" +#include "intel_gpu/graph/serialization/set_serializer.hpp" #include "intel_gpu/runtime/engine.hpp" #include "intel_gpu/runtime/memory.hpp" #include "intel_gpu/runtime/error_handler.hpp" #include "intel_gpu/runtime/debug_configuration.hpp" -#include "serialization/set_serializer.hpp" #include "json_object.h" #include #include @@ -498,8 +498,7 @@ void primitive_inst::set_arguments() { } void primitive_inst::build_deps() { - if (_node == nullptr) - return; + OPENVINO_ASSERT(_node != nullptr, "_node should not be nullptr for build_deps."); if (_deps.empty() && !_node->get_dependencies().empty()) { _deps = _network.get_primitives(_node->get_dependencies()); @@ -515,7 +514,7 @@ void primitive_inst::rebuild_deps( _deps.resize(_dep_ids.size()); for (size_t i = 0; i < _dep_ids.size(); i++) { - OPENVINO_ASSERT((primitives.count(_dep_ids[i]) > 0), _dep_ids[i], "is not found in _primitives"); + OPENVINO_ASSERT((primitives.count(_dep_ids[i]) > 0), _dep_ids[i], "is not found in primitives while rebuilding _deps"); _deps[i] = primitives.at(_dep_ids[i]); } } @@ -533,7 +532,7 @@ void primitive_inst::rebuild_exec_deps( break; } } - OPENVINO_ASSERT(found, _exec_dep_ids[i], "not found in _exec_order"); + OPENVINO_ASSERT(found, _exec_dep_ids[i], "not found in primitives while rebuilding _exec_deps"); } } @@ -1034,79 +1033,99 @@ std::string primitive_inst::get_implementation_name() const { return "undef"; } -void primitive_inst::save(cldnn::BinaryOutputBuffer& ob) const { - if (type() == cldnn::data::type_id() || - (type() == cldnn::mutable_data::type_id() && _impl == nullptr)) { - object_type _object_type = object_type::DATA_INST; - ob << cldnn::make_data(&_object_type, sizeof(object_type)); - ob << _node->get_primitive()->type_string(); - _impl_params->save(ob); - ob << _outputs[0]->get_layout(); - - const auto _allocation_type = _outputs[0]->get_allocation_type(); - ob << make_data(&_allocation_type, sizeof(_allocation_type)); +static primitive_id find_dep_by_mem(const cldnn::primitive_inst* p_inst, memory& mem_ptr, int max_dist = 5) { + std::vector> queue; + size_t head = 0; - size_t data_size = _outputs[0]->size(); - ob << cldnn::make_data(&data_size, sizeof(size_t)); + for (auto& p_inst : p_inst->dependencies()) + queue.emplace_back(std::make_pair(p_inst->id(), 0)); - if (_allocation_type == allocation_type::usm_host || _allocation_type == allocation_type::usm_shared) { - ob << cldnn::make_data(_outputs[0]->buffer_ptr(), data_size); - } else { - mem_lock lock{_outputs[0], get_node().get_program().get_stream()}; - ob << cldnn::make_data(lock.data(), data_size); - } - } else { - object_type _object_type = object_type::EXECUTABLE_INST; - ob << cldnn::make_data(&_object_type, sizeof(object_type)); + const network& const_network = p_inst->get_network(); + while (head < queue.size()) { + auto curr_item = queue.at(head); + auto curr_prim = const_network.get_primitive(curr_item.first); + + if (p_inst->get_network().get_engine().is_the_same_buffer(mem_ptr, curr_prim->output_memory())) + return curr_prim->id(); + + if (max_dist > curr_item.second) + for (auto& p_inst : curr_prim->dependencies()) + queue.emplace_back(std::make_pair(p_inst->id(), curr_item.second+1)); + head += 1; + } + + return "NOT_FOUND"; +} + +// Cache blob format: +// [ primitive_impl ] +// [ kernel_impl_params ] +// [ member variables of primitive_inst ] +// [ output memory information ] +// [ memory dependency information ] +// [ execution dependency information ] +// [ intermediate memory information ] +void primitive_inst::save(cldnn::BinaryOutputBuffer& ob) const { + if (_impl != nullptr) { + ob << true; kernel_arguments_data args = _impl->get_arguments(*this); kernel_arguments_data_idx args_idx; convert_args(args, args_idx); _impl->set_arguments(args_idx); - - _impl_params->save(ob); - ob.setKernlImplParams(_impl_params.get()); ob << _impl; + } else { + ob << false; + } - ob << _node_output_layout; - ob << has_mutable_input(); - ob << mem_allocated(); - ob << is_dynamic(); - ob << _node->get_primitive()->type_string(); - ob << id(); - ob << org_id(); - ob << is_input(); - ob << is_output(); - ob << inputs_memory_count(); - ob << outputs_memory_count(); - ob << get_fused_mem_count(); - ob << get_fused_mem_offset(); - ob << can_be_optimized(); - ob << can_share_buffer(); - ob << is_constant(); - - ob << _outputs[0]->get_layout(); - const auto _allocation_type = _outputs[0]->get_allocation_type(); - ob << make_data(&_allocation_type, sizeof(_allocation_type)); + _impl_params->save(ob); + ob.setKernlImplParams(_impl_params.get()); + + ob << _node_output_layout; + ob << has_mutable_input(); + ob << mem_allocated(); + ob << is_dynamic(); + ob << _node->get_primitive()->type_string(); + ob << id(); + ob << org_id(); + ob << is_input(); + ob << is_output(); + ob << inputs_memory_count(); + ob << outputs_memory_count(); + ob << get_fused_mem_count(); + ob << get_fused_mem_offset(); + ob << can_be_optimized(); + ob << can_share_buffer(); + ob << is_constant(); + + if (type() == cldnn::data::type_id()) { + return; + } - ob << _node->get_memory_dependencies(); + ob << _outputs[0]->get_layout(); + const auto _allocation_type = _outputs[0]->get_allocation_type(); + ob << make_data(&_allocation_type, sizeof(_allocation_type)); - ob << _deps.size(); - for (const auto& dep : _deps) { - ob << dep->id(); - } + ob << _node->get_memory_dependencies(); - ob << _exec_deps.size(); - for (const auto& dep : _exec_deps) { - ob << dep->id(); - } + ob << _deps.size(); + for (const auto& dep : _deps) { + ob << dep->id(); + } - ob << _intermediates_memory.size(); - for (const auto& ibuf : _intermediates_memory) { - ob << ibuf->get_layout(); - const auto _allocation_type = ibuf->get_allocation_type(); - ob << make_data(&_allocation_type, sizeof(_allocation_type)); - } + ob << _exec_deps.size(); + for (const auto& dep : _exec_deps) { + ob << dep->id(); + } + + if (!mem_allocated()) + ob << find_dep_by_mem(this, output_memory()); + + ob << _intermediates_memory.size(); + for (const auto& ibuf : _intermediates_memory) { + ob << ibuf->get_layout(); + const auto _allocation_type = ibuf->get_allocation_type(); + ob << make_data(&_allocation_type, sizeof(_allocation_type)); } } @@ -1141,122 +1160,99 @@ void primitive_inst::convert_args(const kernel_arguments_data& args, kernel_argu } int32_t primitive_inst::get_index_in_deps(memory::cptr arg) const { - uint32_t idx = 0; - - for (idx = 0; idx < _deps.size(); ++idx) { + for (uint32_t idx = 0; idx < _deps.size(); ++idx) { if (arg == _deps[idx]->_outputs[0]) - break; + return idx; } - if (idx == _deps.size()) - std::cout << "[get_index_in_deps]: not found" << std::endl; - - return (idx == _deps.size()) ? -1 : idx; + IE_THROW() << "[get_index_in_deps]: not found in _deps"; } void primitive_inst::load(cldnn::BinaryInputBuffer& ib) { - object_type _object_type; - ib >> make_data(&_object_type, sizeof(object_type)); - - if (_object_type == object_type::DATA_INST) { - std::string type_str; - ib >> type_str; - _type = get_type_id(type_str); - - _impl_params.release(); - _impl_params = make_unique(); - _impl_params->load(ib); - - layout output_layout = layout(cldnn::data_types::bin, cldnn::format::any, cldnn::tensor()); - ib >> output_layout; - - allocation_type _allocation_type; - ib >> make_data(&_allocation_type, sizeof(_allocation_type)); - - size_t data_size; - ib >> cldnn::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 >> cldnn::make_data(_outputs[0]->buffer_ptr(), data_size); - } else { - char *_buf = new char[data_size]; - ib >> cldnn::make_data(_buf, data_size); - _outputs[0]->copy_from(get_network().get_stream(), _buf); - delete[] _buf; - } - } else if (_object_type == object_type::EXECUTABLE_INST) { - _impl_params.release(); - _impl_params = make_unique(); - _impl_params->load(ib); + bool has_impl; + ib >> has_impl; + if (has_impl) { _impl.release(); - ib.setKernlImplParams(_impl_params.get()); ib >> _impl; + } - ib >> _node_output_layout; - ib >> _has_mutable_input; - ib >> _mem_allocated; - ib >> _is_dynamic; - std::string type_str; - ib >> type_str; - _type = get_type_id(type_str); - ib >> _id; - ib >> _org_id; - ib >> _is_input; - ib >> _is_output; - ib >> _inputs_memory_count; - ib >> _outputs_memory_count; - ib >> _fused_mem_count; - ib >> _fused_mem_offset; - ib >> _can_be_optimized; - ib >> _can_share_buffer; - ib >> _is_constant; - - layout output_layout = layout(cldnn::data_types::bin, cldnn::format::any, cldnn::tensor()); - ib >> output_layout; + _impl_params.release(); + _impl_params = make_unique(); + _impl_params->load(ib); + ib.setKernlImplParams(_impl_params.get()); + + ib >> _node_output_layout; + ib >> _has_mutable_input; + ib >> _mem_allocated; + ib >> _is_dynamic; + std::string type_str; + ib >> type_str; + _type = cldnn::prim_map_storage::instance().get_type_id(type_str); + ib >> _id; + ib >> _org_id; + ib >> _is_input; + ib >> _is_output; + ib >> _inputs_memory_count; + ib >> _outputs_memory_count; + ib >> _fused_mem_count; + ib >> _fused_mem_offset; + ib >> _can_be_optimized; + ib >> _can_share_buffer; + ib >> _is_constant; + + if (type() == cldnn::data::type_id()) { + return; + } - allocation_type _allocation_type; - ib >> make_data(&_allocation_type, sizeof(_allocation_type)); + layout output_layout = layout(); + ib >> output_layout; - std::set _node_mem_deps; - ib >> _node_mem_deps; + allocation_type _allocation_type; + ib >> make_data(&_allocation_type, sizeof(_allocation_type)); - size_t vector_size = 0UL; - ib >> vector_size; - _dep_ids.resize(vector_size); - for (auto& el : _dep_ids) { - ib >> el; - } + std::set _node_mem_deps; + ib >> _node_mem_deps; - ib >> vector_size; - _exec_dep_ids.resize(vector_size); - for (auto& el : _exec_dep_ids) { - ib >> el; - } + size_t vector_size = 0UL; + ib >> vector_size; + _dep_ids.resize(vector_size); + for (auto& el : _dep_ids) { + ib >> el; + } - _outputs[0] = nullptr; - if (!_mem_allocated) { - if (can_be_optimized() && type() != cldnn::concatenation::type_id()) - _outputs[0] = get_network().get_engine().reinterpret_buffer(get_network().get_primitive(_dep_ids[0])->output_memory(), output_layout); + ib >> vector_size; + _exec_dep_ids.resize(vector_size); + for (auto& el : _exec_dep_ids) { + ib >> el; + } + + _outputs[0] = nullptr; + if (!_mem_allocated) { + std::string dep_id; + ib >> dep_id; + if (dep_id.compare("NOT_FOUND") != 0) { + _outputs[0] = get_network().get_engine().reinterpret_buffer(get_network().get_primitive(dep_id)->output_memory(), output_layout); + } else if (type() == cldnn::mutable_data::type_id()) { + _outputs[0] = get_network().get_engine().allocate_memory(output_layout, _allocation_type); + } + } else { + if ((!can_share_buffer()) || can_be_optimized() || is_output()) { + _outputs[0] = get_network().get_engine().allocate_memory(output_layout, _allocation_type); } else { - if ((!can_share_buffer()) || can_be_optimized() || is_output()) { - _outputs[0] = get_network().get_engine().allocate_memory(output_layout, _allocation_type); - } else { - _outputs[0] = get_network().get_memory_pool().get_memory(output_layout, id(), get_network_id(), _node_mem_deps, _allocation_type, true); - } + _outputs[0] = get_network().get_memory_pool().get_memory(output_layout, id(), get_network_id(), _node_mem_deps, _allocation_type, true); } - _output_changed = false; + } + _output_changed = false; - ib >> vector_size; - _intermediates_memory.resize(vector_size); - for (size_t i = 0; i < vector_size; i++) { - layout ibuf_layout = layout(cldnn::data_types::bin, cldnn::format::any, cldnn::tensor()); - ib >> ibuf_layout; - allocation_type _allocation_type; - ib >> make_data(&_allocation_type, sizeof(_allocation_type)); + ib >> vector_size; + _intermediates_memory.resize(vector_size); + for (size_t i = 0; i < vector_size; i++) { + layout ibuf_layout = layout(); + ib >> ibuf_layout; + allocation_type _allocation_type; + ib >> make_data(&_allocation_type, sizeof(_allocation_type)); - _intermediates_memory[i] = get_network().get_engine().allocate_memory(ibuf_layout, _allocation_type); - } + _intermediates_memory[i] = get_network().get_engine().allocate_memory(ibuf_layout, _allocation_type); } } } // namespace cldnn diff --git a/src/plugins/intel_gpu/src/graph/prior_box.cpp b/src/plugins/intel_gpu/src/graph/prior_box.cpp index 3a1571a029d4b7..50b6f7e643a16d 100644 --- a/src/plugins/intel_gpu/src/graph/prior_box.cpp +++ b/src/plugins/intel_gpu/src/graph/prior_box.cpp @@ -14,10 +14,7 @@ #include namespace cldnn { -primitive_type_id prior_box::type_id() { - static primitive_type_base instance; - return &instance; -} +GPU_DEFINE_PRIMITIVE_TYPE_ID(prior_box) namespace { template diff --git a/src/plugins/intel_gpu/src/graph/program.cpp b/src/plugins/intel_gpu/src/graph/program.cpp index a29199f2249bd7..add4e18ad72221 100644 --- a/src/plugins/intel_gpu/src/graph/program.cpp +++ b/src/plugins/intel_gpu/src/graph/program.cpp @@ -763,8 +763,7 @@ void program::cleanup() { } } - if (_engine.configuration().kernels_cache_path.empty()) - _kernels_cache->reset(); + _kernels_cache->reset(); } void program::add_split_outputs() { diff --git a/src/plugins/intel_gpu/src/graph/proposal.cpp b/src/plugins/intel_gpu/src/graph/proposal.cpp index 93b07b2a15ef01..c8a6e4b5de6530 100644 --- a/src/plugins/intel_gpu/src/graph/proposal.cpp +++ b/src/plugins/intel_gpu/src/graph/proposal.cpp @@ -20,10 +20,7 @@ static void generate_anchors(unsigned base_size, bool shift_anchors, bool round_ratios); -primitive_type_id proposal::type_id() { - static primitive_type_base instance; - return &instance; -} +GPU_DEFINE_PRIMITIVE_TYPE_ID(proposal) layout proposal_inst::calc_output_layout(proposal_node const& node, kernel_impl_params const& impl_param) { assert(static_cast(impl_param.desc->output_data_type) == false && diff --git a/src/plugins/intel_gpu/src/graph/pyramid_roi_align.cpp b/src/plugins/intel_gpu/src/graph/pyramid_roi_align.cpp index a7c83e428b0b96..4a20c26d490fd9 100644 --- a/src/plugins/intel_gpu/src/graph/pyramid_roi_align.cpp +++ b/src/plugins/intel_gpu/src/graph/pyramid_roi_align.cpp @@ -10,10 +10,7 @@ #include namespace cldnn { -primitive_type_id pyramid_roi_align::type_id() { - static primitive_type_base instance; - return &instance; -} +GPU_DEFINE_PRIMITIVE_TYPE_ID(pyramid_roi_align) layout pyramid_roi_align_inst::calc_output_layout(pyramid_roi_align_node const& node, kernel_impl_params const& impl_param) { assert(static_cast(impl_param.desc->output_data_type) == false && diff --git a/src/plugins/intel_gpu/src/graph/quantize.cpp b/src/plugins/intel_gpu/src/graph/quantize.cpp index 9217e849fd824b..fb49cbf11566f5 100644 --- a/src/plugins/intel_gpu/src/graph/quantize.cpp +++ b/src/plugins/intel_gpu/src/graph/quantize.cpp @@ -12,10 +12,7 @@ #include namespace cldnn { -primitive_type_id quantize::type_id() { - static primitive_type_base instance; - return &instance; -} +GPU_DEFINE_PRIMITIVE_TYPE_ID(quantize) layout quantize_inst::calc_output_layout(quantize_node const& node, kernel_impl_params const& impl_param) { auto desc = impl_param.typed_desc(); diff --git a/src/plugins/intel_gpu/src/graph/random_uniform.cpp b/src/plugins/intel_gpu/src/graph/random_uniform.cpp index 29da8ad624531c..29603cab7b6a8c 100644 --- a/src/plugins/intel_gpu/src/graph/random_uniform.cpp +++ b/src/plugins/intel_gpu/src/graph/random_uniform.cpp @@ -9,11 +9,7 @@ #include namespace cldnn { - -primitive_type_id random_uniform::type_id() { - static primitive_type_base instance; - return &instance; -} +GPU_DEFINE_PRIMITIVE_TYPE_ID(random_uniform) random_uniform_inst::typed_primitive_inst(network& network, random_uniform_node const &node) : parent(network, node) { diff --git a/src/plugins/intel_gpu/src/graph/range.cpp b/src/plugins/intel_gpu/src/graph/range.cpp index 4706fe901a0aa2..86459ebb0dd020 100644 --- a/src/plugins/intel_gpu/src/graph/range.cpp +++ b/src/plugins/intel_gpu/src/graph/range.cpp @@ -18,10 +18,7 @@ std::string lexical_cast(const json_base& j, int offset = 1) { } } // namespace -primitive_type_id range::type_id() { - static primitive_type_base instance; - return &instance; -} +GPU_DEFINE_PRIMITIVE_TYPE_ID(range) layout range_inst::calc_output_layout(range_node const& node, kernel_impl_params const& impl_param) { return impl_param.typed_desc()->output_layout; diff --git a/src/plugins/intel_gpu/src/graph/read_value.cpp b/src/plugins/intel_gpu/src/graph/read_value.cpp index f74af539a1b5f8..bcced0f3a542e1 100644 --- a/src/plugins/intel_gpu/src/graph/read_value.cpp +++ b/src/plugins/intel_gpu/src/graph/read_value.cpp @@ -9,11 +9,7 @@ #include namespace cldnn { - -primitive_type_id read_value::type_id() { - static primitive_type_base instance; - return &instance; -} +GPU_DEFINE_PRIMITIVE_TYPE_ID(read_value) read_value_inst::typed_primitive_inst(network& network, const read_value_node& node) : parent(network, node, false), diff --git a/src/plugins/intel_gpu/src/graph/reduce.cpp b/src/plugins/intel_gpu/src/graph/reduce.cpp index 21e748012f09f9..a063c06a159bf6 100644 --- a/src/plugins/intel_gpu/src/graph/reduce.cpp +++ b/src/plugins/intel_gpu/src/graph/reduce.cpp @@ -14,10 +14,7 @@ #include "reduce_shape_inference.hpp" namespace cldnn { -primitive_type_id reduce::type_id() { - static primitive_type_base instance; - return &instance; -} +GPU_DEFINE_PRIMITIVE_TYPE_ID(reduce) static std::vector convert_axes(std::vector axes, size_t rank) { std::vector converted_axes; diff --git a/src/plugins/intel_gpu/src/graph/region_yolo.cpp b/src/plugins/intel_gpu/src/graph/region_yolo.cpp index 24fc23bcda59bd..b470eccd526f3d 100644 --- a/src/plugins/intel_gpu/src/graph/region_yolo.cpp +++ b/src/plugins/intel_gpu/src/graph/region_yolo.cpp @@ -8,10 +8,7 @@ #include namespace cldnn { -primitive_type_id region_yolo::type_id() { - static primitive_type_base instance; - return &instance; -} +GPU_DEFINE_PRIMITIVE_TYPE_ID(region_yolo) layout region_yolo_inst::calc_output_layout(region_yolo_node const& node, kernel_impl_params const& impl_param) { assert(static_cast(impl_param.desc->output_data_type) == false && diff --git a/src/plugins/intel_gpu/src/graph/reorder.cpp b/src/plugins/intel_gpu/src/graph/reorder.cpp index ed1c0beafa6619..b4820b0865dc74 100644 --- a/src/plugins/intel_gpu/src/graph/reorder.cpp +++ b/src/plugins/intel_gpu/src/graph/reorder.cpp @@ -14,11 +14,7 @@ #include namespace cldnn { - -primitive_type_id reorder::type_id() { - static primitive_type_base instance; - return &instance; -} +GPU_DEFINE_PRIMITIVE_TYPE_ID(reorder) layout reorder_inst::calc_output_layout(reorder_node const& node, kernel_impl_params const& impl_param) { auto input_layout = impl_param.get_input_layout(); @@ -254,7 +250,8 @@ void reorder_inst::update_output_memory() { if (static_cast(_outputs[0]) && _network.get_engine().is_the_same_buffer(output_memory(), input_memory())) return; - build_deps(); + if (_node != nullptr) + build_deps(); if (requires_reinterpret()) { _outputs[0] = _network.get_engine().reinterpret_buffer(input_memory(), get_output_layout()); diff --git a/src/plugins/intel_gpu/src/graph/reorg_yolo.cpp b/src/plugins/intel_gpu/src/graph/reorg_yolo.cpp index 0053a56a9eb34c..939386fc4c8784 100644 --- a/src/plugins/intel_gpu/src/graph/reorg_yolo.cpp +++ b/src/plugins/intel_gpu/src/graph/reorg_yolo.cpp @@ -8,10 +8,7 @@ #include namespace cldnn { -primitive_type_id reorg_yolo::type_id() { - static primitive_type_base instance; - return &instance; -} +GPU_DEFINE_PRIMITIVE_TYPE_ID(reorg_yolo) layout reorg_yolo_inst::calc_output_layout(reorg_yolo_node const& node, kernel_impl_params const& impl_param) { assert(static_cast(impl_param.desc->output_data_type) == false && diff --git a/src/plugins/intel_gpu/src/graph/resample.cpp b/src/plugins/intel_gpu/src/graph/resample.cpp index f1dab6fe524f78..27061cf1080782 100644 --- a/src/plugins/intel_gpu/src/graph/resample.cpp +++ b/src/plugins/intel_gpu/src/graph/resample.cpp @@ -12,10 +12,7 @@ #include "interpolate_shape_inference.hpp" namespace cldnn { -primitive_type_id resample::type_id() { - static primitive_type_base instance; - return &instance; -} +GPU_DEFINE_PRIMITIVE_TYPE_ID(resample) layout resample_inst::calc_output_layout(resample_node const& node, kernel_impl_params const& impl_param) { auto desc = impl_param.typed_desc(); diff --git a/src/plugins/intel_gpu/src/graph/reshape.cpp b/src/plugins/intel_gpu/src/graph/reshape.cpp index ed412c2fae32ce..06d25e9b29de9b 100644 --- a/src/plugins/intel_gpu/src/graph/reshape.cpp +++ b/src/plugins/intel_gpu/src/graph/reshape.cpp @@ -15,11 +15,7 @@ #include "unsqueeze_shape_inference.hpp" namespace cldnn { - -primitive_type_id reshape::type_id() { - static primitive_type_base instance; - return &instance; -} +GPU_DEFINE_PRIMITIVE_TYPE_ID(reshape) layout reshape_inst::calc_output_layout(reshape_node const& node, kernel_impl_params const& impl_param) { assert(static_cast(impl_param.desc->output_data_type) == false && diff --git a/src/plugins/intel_gpu/src/graph/reverse.cpp b/src/plugins/intel_gpu/src/graph/reverse.cpp index e981a15bc6ba8a..11388ecadb4f11 100644 --- a/src/plugins/intel_gpu/src/graph/reverse.cpp +++ b/src/plugins/intel_gpu/src/graph/reverse.cpp @@ -9,10 +9,7 @@ #include "reverse_inst.h" namespace cldnn { -primitive_type_id reverse::type_id() { - static primitive_type_base instance; - return &instance; -} +GPU_DEFINE_PRIMITIVE_TYPE_ID(reverse) layout reverse_inst::calc_output_layout(reverse_node const& node, kernel_impl_params const& impl_param) { return impl_param.get_input_layout(); diff --git a/src/plugins/intel_gpu/src/graph/reverse_sequence.cpp b/src/plugins/intel_gpu/src/graph/reverse_sequence.cpp index f8f5eefec13e8b..cbb99ebed30078 100644 --- a/src/plugins/intel_gpu/src/graph/reverse_sequence.cpp +++ b/src/plugins/intel_gpu/src/graph/reverse_sequence.cpp @@ -10,10 +10,7 @@ #include namespace cldnn { -primitive_type_id reverse_sequence::type_id() { - static primitive_type_base instance; - return &instance; -} +GPU_DEFINE_PRIMITIVE_TYPE_ID(reverse_sequence) layout reverse_sequence_inst::calc_output_layout(reverse_sequence_node const& node, kernel_impl_params const& impl_param) { auto input_layout = impl_param.get_input_layout(); diff --git a/src/plugins/intel_gpu/src/graph/roi_align.cpp b/src/plugins/intel_gpu/src/graph/roi_align.cpp index 8d4cb4561fedc0..2ae803582552c8 100644 --- a/src/plugins/intel_gpu/src/graph/roi_align.cpp +++ b/src/plugins/intel_gpu/src/graph/roi_align.cpp @@ -9,11 +9,7 @@ #include "openvino/core/enum_names.hpp" namespace cldnn { - -primitive_type_id roi_align::type_id() { - static primitive_type_base instance; - return &instance; -} +GPU_DEFINE_PRIMITIVE_TYPE_ID(roi_align) roi_align_inst::typed_primitive_inst(network& network, roi_align_node const& node) : parent(network, node) {} diff --git a/src/plugins/intel_gpu/src/graph/roi_pooling.cpp b/src/plugins/intel_gpu/src/graph/roi_pooling.cpp index e5684408cbb2ba..c64146fc1d1d7d 100644 --- a/src/plugins/intel_gpu/src/graph/roi_pooling.cpp +++ b/src/plugins/intel_gpu/src/graph/roi_pooling.cpp @@ -9,10 +9,7 @@ #include namespace cldnn { -primitive_type_id roi_pooling::type_id() { - static primitive_type_base instance; - return &instance; -} +GPU_DEFINE_PRIMITIVE_TYPE_ID(roi_pooling) layout roi_pooling_inst::calc_output_layout(roi_pooling_node const& node, kernel_impl_params const& impl_param) { assert(static_cast(impl_param.desc->output_data_type) == false && diff --git a/src/plugins/intel_gpu/src/graph/roll.cpp b/src/plugins/intel_gpu/src/graph/roll.cpp index fa64d0d2bb421a..e42c3302c5c080 100644 --- a/src/plugins/intel_gpu/src/graph/roll.cpp +++ b/src/plugins/intel_gpu/src/graph/roll.cpp @@ -9,11 +9,7 @@ #include "roll_inst.hpp" namespace cldnn { - -primitive_type_id roll::type_id() { - static primitive_type_base instance; - return &instance; -} +GPU_DEFINE_PRIMITIVE_TYPE_ID(roll) layout roll_inst::calc_output_layout(const roll_node& node, kernel_impl_params const& impl_param) { return impl_param.get_input_layout(); diff --git a/src/plugins/intel_gpu/src/graph/scatter_elements_update.cpp b/src/plugins/intel_gpu/src/graph/scatter_elements_update.cpp index 06b3d23fd40d55..cd60b1539ba46a 100644 --- a/src/plugins/intel_gpu/src/graph/scatter_elements_update.cpp +++ b/src/plugins/intel_gpu/src/graph/scatter_elements_update.cpp @@ -10,10 +10,7 @@ #include namespace cldnn { -primitive_type_id scatter_elements_update::type_id() { - static primitive_type_base instance; - return &instance; -} +GPU_DEFINE_PRIMITIVE_TYPE_ID(scatter_elements_update) layout scatter_elements_update_inst::calc_output_layout(scatter_elements_update_node const& node, kernel_impl_params const& impl_param) { auto desc = impl_param.typed_desc(); diff --git a/src/plugins/intel_gpu/src/graph/scatter_nd_update.cpp b/src/plugins/intel_gpu/src/graph/scatter_nd_update.cpp index b54b9c61d09fb9..c9ae82a5ba2c4b 100644 --- a/src/plugins/intel_gpu/src/graph/scatter_nd_update.cpp +++ b/src/plugins/intel_gpu/src/graph/scatter_nd_update.cpp @@ -10,11 +10,7 @@ #include namespace cldnn { -primitive_type_id scatter_nd_update::type_id() { - static primitive_type_base instance; - return &instance; -} - +GPU_DEFINE_PRIMITIVE_TYPE_ID(scatter_nd_update) layout scatter_nd_update_inst::calc_output_layout(scatter_nd_update_node const& node, kernel_impl_params const& impl_param) { auto input_layout = impl_param.get_input_layout(); diff --git a/src/plugins/intel_gpu/src/graph/scatter_update.cpp b/src/plugins/intel_gpu/src/graph/scatter_update.cpp index c4fc63a191730a..1b72ab9ca2355f 100644 --- a/src/plugins/intel_gpu/src/graph/scatter_update.cpp +++ b/src/plugins/intel_gpu/src/graph/scatter_update.cpp @@ -10,10 +10,7 @@ #include namespace cldnn { -primitive_type_id scatter_update::type_id() { - static primitive_type_base instance; - return &instance; -} +GPU_DEFINE_PRIMITIVE_TYPE_ID(scatter_update) layout scatter_update_inst::calc_output_layout(scatter_update_node const& node, kernel_impl_params const& impl_param) { auto desc = impl_param.typed_desc(); diff --git a/src/plugins/intel_gpu/src/graph/select.cpp b/src/plugins/intel_gpu/src/graph/select.cpp index d58b9080822147..9d46fa91e63c11 100644 --- a/src/plugins/intel_gpu/src/graph/select.cpp +++ b/src/plugins/intel_gpu/src/graph/select.cpp @@ -12,10 +12,7 @@ #include "select_shape_inference.hpp" namespace cldnn { -primitive_type_id select::type_id() { - static primitive_type_base