Elffuss BraidHub

kikocis/ncnn public

master · 2.6 KiBRawPermalink
1/* Copyright 2020 The TensorFlow Authors. All Rights Reserved.
2
3Licensed under the Apache License, Version 2.0 (the "License");
4you may not use this file except in compliance with the License.
5You may obtain a copy of the License at
6
7 http://www.apache.org/licenses/LICENSE-2.0
8
9Unless required by applicable law or agreed to in writing, software
10distributed under the License is distributed on an "AS IS" BASIS,
11WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12See the License for the specific language governing permissions and
13limitations under the License.
14==============================================================================*/
15
16// This is the side effect definition file for TensorFlow.
17#ifndef TENSORFLOW_COMPILER_MLIR_TENSORFLOW_IR_TF_SIDE_EFFECTS_H_
18#define TENSORFLOW_COMPILER_MLIR_TENSORFLOW_IR_TF_SIDE_EFFECTS_H_
19
20#include "mlir/Interfaces/SideEffectInterfaces.h" // from @llvm-project
21
22namespace mlir {
23namespace TF {
24namespace ResourceEffects {
25
26struct Variable : ::mlir::SideEffects::Resource::Base<Variable>
27{
28 StringRef getName() final
29 {
30 return "Variable";
31 }
32};
33
34struct Stack : ::mlir::SideEffects::Resource::Base<Stack>
35{
36 StringRef getName() final
37 {
38 return "Stack";
39 }
40};
41
42struct TensorArray : ::mlir::SideEffects::Resource::Base<TensorArray>
43{
44 StringRef getName() final
45 {
46 return "TensorArray";
47 }
48};
49
50struct Summary : ::mlir::SideEffects::Resource::Base<Summary>
51{
52 StringRef getName() final
53 {
54 return "Summary";
55 }
56};
57
58struct LookupTable : ::mlir::SideEffects::Resource::Base<LookupTable>
59{
60 StringRef getName() final
61 {
62 return "LookupTable";
63 }
64};
65
66struct DatasetSeedGenerator
67 : ::mlir::SideEffects::Resource::Base<DatasetSeedGenerator>
68{
69 StringRef getName() final
70 {
71 return "DatasetSeedGenerator";
72 }
73};
74
75struct DatasetMemoryCache
76 : ::mlir::SideEffects::Resource::Base<DatasetMemoryCache>
77{
78 StringRef getName() final
79 {
80 return "DatasetMemoryCache";
81 }
82};
83
84struct DatasetIterator : ::mlir::SideEffects::Resource::Base<DatasetIterator>
85{
86 StringRef getName() final
87 {
88 return "DatasetIterator";
89 }
90};
91
92// Special resource type to track TPU Embedding specific ops, which must execute
93// but do not have side effects with one another or with resource variable ops.
94struct TPUEmbedding : ::mlir::SideEffects::Resource::Base<TPUEmbedding>
95{
96 StringRef getName() final
97 {
98 return "TPUEmbedding";
99 }
100};
101
102} // namespace ResourceEffects
103} // namespace TF
104} // namespace mlir
105
106#endif // TENSORFLOW_COMPILER_MLIR_TENSORFLOW_IR_TF_SIDE_EFFECTS_H_