Publishing 2019 R1 content
[platform/upstream/dldt.git] / inference-engine / thirdparty / clDNN / src / include / primitive_type.h
1 /*
2 // Copyright (c) 2016 Intel Corporation
3 //
4 // Licensed under the Apache License, Version 2.0 (the "License");
5 // you may not use this file except in compliance with the License.
6 // You may obtain a copy of the License at
7 //
8 //      http://www.apache.org/licenses/LICENSE-2.0
9 //
10 // Unless required by applicable law or agreed to in writing, software
11 // distributed under the License is distributed on an "AS IS" BASIS,
12 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 // See the License for the specific language governing permissions and
14 // limitations under the License.
15 */
16
17 ///////////////////////////////////////////////////////////////////////////////////////////////////
18 #pragma once
19 #include "api/CPP/memory.hpp"
20 #include "api/CPP/primitive.hpp"
21 #include "api/CPP/program.hpp"
22
23 #include "topology_impl.h"
24
25 #include <memory>
26
27 namespace cldnn {
28     struct network_impl;
29     struct engine_impl;
30     struct program_node;
31     struct primitive_impl;
32     class primitive_inst;
33     struct program_impl;
34 }
35 struct cldnn_primitive_type
36 {
37     virtual ~cldnn_primitive_type() = default;
38
39     virtual std::shared_ptr<cldnn::primitive> from_dto(const CLDNN_PRIMITIVE_DESC(primitive)* dto) const = 0;
40     virtual std::shared_ptr<cldnn::program_node> create_node(cldnn::program_impl& program, const std::shared_ptr<cldnn::primitive> prim) const = 0;
41     virtual std::shared_ptr<cldnn::primitive_inst> create_instance(cldnn::network_impl& network, const cldnn::program_node& node) const = 0;
42     virtual std::unique_ptr<cldnn::primitive_impl> choose_impl(cldnn::engine_impl& engine, const cldnn::program_node& node) const = 0;    
43     virtual bool does_an_implementation_exist(cldnn::engine_impl& engine, const cldnn::program_node& node) const = 0;
44     virtual bool does_possible_implementation_exist(cldnn::engine_impl& engine, const cldnn::program_node& node) const = 0;
45     virtual cldnn::layout calc_output_layout(const cldnn::program_node& node) const = 0;
46     virtual std::string to_string(const cldnn::program_node& node) const = 0;
47
48     virtual bool is_internal_type() const { return false; }
49 };