primitives_priority_attribute.hpp
Go to the documentation of this file.
1 // Copyright (C) 2018-2021 Intel Corporation
2 // SPDX-License-Identifier: Apache-2.0
3 //
4 
5 /**
6  * @brief Defines primitives priority attribute
7  * @file primitives_priority_attribute.hpp
8  */
9 
10 #pragma once
11 
12 #include <assert.h>
13 #include <functional>
14 #include <memory>
15 #include <string>
16 #include <set>
17 
18 #include <ngraph/node.hpp>
19 #include <ngraph/variant.hpp>
20 #include <transformations_visibility.hpp>
21 
22 namespace ngraph {
23 
24 /**
25  * @ingroup ie_runtime_attr_api
26  * @brief PrimitivesPriority class represents runtime info attribute that
27  * can be used for plugins specific primitive choice.
28  */
29 class TRANSFORMATIONS_API PrimitivesPriority {
30 private:
31  std::string primitives_priority;
32 
33 public:
34  /**
35  * A default constructor
36  */
37  PrimitivesPriority() = default;
38 
39  /**
40  * @brief Constructs a new object consisting of a single name *
41  * @param[in] name The primitives priority value
42  */
43  explicit PrimitivesPriority(const std::string &primitives_priority) : primitives_priority(primitives_priority) {}
44 
45  /**
46  * @brief return string with primitives priority value
47  */
48  std::string getPrimitivesPriority() const;
49 };
50 
51 extern template class TRANSFORMATIONS_API VariantImpl<PrimitivesPriority>;
52 
53 template<>
54 class TRANSFORMATIONS_API VariantWrapper<PrimitivesPriority> : public VariantImpl<PrimitivesPriority> {
55 public:
56  static constexpr VariantTypeInfo type_info{"Variant::RuntimeAttribute::PrimitivesPriority", 0};
57 
58  const VariantTypeInfo &get_type_info() const override {
59  return type_info;
60  }
61 
62  VariantWrapper(const value_type &value) : VariantImpl<value_type>(value) {}
63 
64  std::shared_ptr<ngraph::Variant> merge(const ngraph::NodeVector & nodes) override;
65 
66  std::shared_ptr<ngraph::Variant> init(const std::shared_ptr<ngraph::Node> & node) override;
67 };
68 
69 /**
70  * @ingroup ie_runtime_attr_api
71  * @brief getPrimitivesPriority return string with primitive priorities value
72  * @param[in] node The node will be used to get PrimitivesPriority attribute
73  */
74 TRANSFORMATIONS_API std::string getPrimitivesPriority(const std::shared_ptr<ngraph::Node> & node);
75 
76 } // namespace ngraph
PrimitivesPriority class represents runtime info attribute that can be used for plugins specific prim...
Definition: primitives_priority_attribute.hpp:29
PrimitivesPriority(const std::string &primitives_priority)
Constructs a new object consisting of a single name *.
Definition: primitives_priority_attribute.hpp:43
std::string getPrimitivesPriority() const
return string with primitives priority value
Definition: primitives_priority_attribute.hpp:54
ngraph namespace
Definition: add_fake_quantize_fusion.hpp:14
std::string getPrimitivesPriority(const std::shared_ptr< ngraph::Node > &node)
getPrimitivesPriority return string with primitive priorities value