Scanner C++ API
op_info.h
1 /* Copyright 2016 Carnegie Mellon University
2  *
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at
6  *
7  * http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14  */
15 
16 #pragma once
17 
18 #include "scanner/api/op.h"
19 #include "scanner/util/common.h"
20 
21 #include <vector>
22 
23 namespace scanner {
24 namespace internal {
25 
26 class OpInfo {
27  public:
28  OpInfo(const std::string& name, bool variadic_inputs,
29  const std::vector<Column>& input_columns,
30  const std::vector<Column>& output_columns, bool can_stencil,
31  const std::vector<i32> preferred_stencil, bool bounded_state,
32  i32 warmup, bool unbounded_state, const std::string& protobuf_name,
33  const std::string& stream_protobuf_name)
34  : name_(name),
35  variadic_inputs_(variadic_inputs),
36  input_columns_(input_columns),
37  output_columns_(output_columns),
38  can_stencil_(can_stencil),
39  preferred_stencil_(preferred_stencil),
40  bounded_state_(bounded_state),
41  warmup_(warmup),
42  unbounded_state_(unbounded_state),
43  protobuf_name_(protobuf_name),
44  stream_protobuf_name_(stream_protobuf_name) {}
45 
46  const std::string& name() const { return name_; }
47 
48  const bool variadic_inputs() const { return variadic_inputs_; }
49 
50  const std::vector<Column>& input_columns() const { return input_columns_; }
51 
52  const std::vector<Column>& output_columns() const { return output_columns_; }
53 
54  const bool can_stencil() const { return can_stencil_; }
55 
56  const std::vector<i32>& preferred_stencil() const {
57  return preferred_stencil_;
58  }
59 
60  const bool has_bounded_state() const { return bounded_state_; }
61 
62  const i32 warmup() const {
63  return warmup_;
64  }
65 
66  const bool has_unbounded_state() const { return unbounded_state_; }
67 
68  const std::string& protobuf_name() const { return protobuf_name_; }
69 
70  const std::string& stream_protobuf_name() const { return stream_protobuf_name_; }
71 
72  private:
73  std::string name_;
74  bool variadic_inputs_;
75  std::vector<Column> input_columns_;
76  std::vector<Column> output_columns_;
77  bool can_stencil_;
78  std::vector<i32> preferred_stencil_;
79  bool bounded_state_;
80  i32 warmup_;
81  bool unbounded_state_;
82  std::string protobuf_name_;
83  std::string stream_protobuf_name_;
84 };
85 }
86 }
Definition: op_info.h:26
Definition: database.cpp:36