distributed.hpp
1 //*****************************************************************************
2 // Copyright 2017-2020 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 #pragma once
18 
19 #include <cstddef>
20 #include <memory>
21 #include <string>
22 
23 #include "ngraph/attribute_visitor.hpp"
24 #include "ngraph/type.hpp"
25 #include "ngraph/type/element_type.hpp"
26 
27 namespace ngraph
28 {
29  namespace reduction
30  {
31  enum class Type
32  {
33  SUM,
34  PROD,
35  MIN,
36  MAX,
37  };
38 
39  NGRAPH_API
40  std::ostream& operator<<(std::ostream& out, const Type& obj);
41  }
42 
43  template <>
44  class NGRAPH_API AttributeAdapter<reduction::Type>
45  : public EnumAttributeAdapterBase<reduction::Type>
46  {
47  public:
48  AttributeAdapter(reduction::Type& value)
49  : EnumAttributeAdapterBase<reduction::Type>(value)
50  {
51  }
52 
53  static constexpr DiscreteTypeInfo type_info{"AttributeAdapter<reduction::Type>", 0};
54  const DiscreteTypeInfo& get_type_info() const override { return type_info; }
55  };
56 }
ngraph::DiscreteTypeInfo
Definition: type.hpp:39
ngraph
The Intel nGraph C++ API.
Definition: attribute_adapter.hpp:28