1 // Copyright (C) 2019 Intel Corporation
2 // SPDX-License-Identifier: Apache-2.0
13 #include <ie_iextension.h>
14 #include "details/caseless.hpp"
15 #include <description_buffer.hpp>
16 #include "ie_const_infer_impl.hpp"
18 namespace InferenceEngine {
19 namespace ShapeInfer {
22 *@brief Holder of const infer implementations for build-in IE layers, that plugins support out-of-the-box
24 class INFERENCE_ENGINE_API_CLASS(ConstInferHolder) {
26 using Ptr = std::shared_ptr<ImplsHolder>;
27 InferenceEngine::details::caseless_map<std::string, IConstInferImpl::Ptr> list;
30 std::list<std::string> getConstInferTypes();
32 IConstInferImpl::Ptr getConstInferImpl(const std::string& type);
34 static void AddImpl(const std::string& name, const IConstInferImpl::Ptr& impl);
37 static ImplsHolder::Ptr GetImplsHolder();
40 template<typename Impl>
41 class ImplRegisterBase {
43 explicit ImplRegisterBase(const std::string& type) {
44 ConstInferHolder::AddImpl(type, std::make_shared<Impl>(type));
48 #define REG_CONST_INFER_FOR_TYPE(__prim, __type) \
49 static ImplRegisterBase<__prim> __ci_reg__##__type(#__type)
51 } // namespace ShapeInfer
52 } // namespace InferenceEngine