ONE - On-device Neural Engine
Loading...
Searching...
No Matches
IR.h
Go to the documentation of this file.
1/*
2 * Copyright (c) 2018 Samsung Electronics Co., Ltd. All Rights Reserved
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#ifndef __ENCO_COEX_IR_H__
18#define __ENCO_COEX_IR_H__
19
20#include <coco/IR.h>
21
28{
29public:
30 ANNConv2D() : _ofm{this}, _ifm{this}, _ker{this}, _bias{this}
31 {
32 // DO NOTHING
33 }
34
35public:
36 coco::Instr *loc(void) override { return this; }
37
38public:
39 coco::Object *ofm(void) const { return _ofm.value(); }
40 void ofm(coco::Object *o) { _ofm.value(o); }
41
42 coco::Object *ifm(void) const { return _ifm.value(); }
43 void ifm(coco::Object *o) { _ifm.value(o); }
44
45 coco::Object *ker(void) const { return _ker.value(); }
46 void ker(coco::Object *o) { _ker.value(o); }
47
53 coco::Object *bias(void) const { return _bias.value(); }
54 void bias(coco::Object *o) { _bias.value(o); }
55
56public:
57 coco::Padding2D *pad(void) { return &_pad; }
58 const coco::Padding2D *pad(void) const { return &_pad; }
59
60 coco::Stride2D *stride(void) { return &_stride; }
61 const coco::Stride2D *stride(void) const { return &_stride; }
62
63private:
64 coco::Def _ofm;
65
66 coco::Use _ifm;
67 coco::Use _ker;
68 coco::Use _bias;
69
70private:
71 coco::Padding2D _pad;
72 coco::Stride2D _stride;
73};
74
81{
82public:
83 ANNDepthConcatF() : _out{this}, _fst{this}, _snd{this}
84 {
85 // DO NOTHING
86 }
87
88public:
89 coco::Instr *loc(void) override { return this; }
90
91public:
92 coco::Object *out(void) const { return _out.value(); }
93 void out(coco::Object *o) { _out.value(o); }
94
95 coco::Object *fst(void) const { return _fst.value(); }
96 void fst(coco::Object *o) { _fst.value(o); }
97
98 coco::Object *snd(void) const { return _snd.value(); }
99 void snd(coco::Object *o) { _snd.value(o); }
100
101private:
102 coco::Def _out;
103
104 // TODO Support variadic-length inputs
105 coco::Use _fst;
106 coco::Use _snd;
107};
108
109#endif // __ENCO_COEX_IR_H__
2D Convolution through Andoird NN API
Definition IR.h:28
void bias(coco::Object *o)
Definition IR.h:54
ANNConv2D()
Definition IR.h:30
const coco::Padding2D * pad(void) const
Definition IR.h:58
coco::Object * ifm(void) const
Definition IR.h:42
coco::Object * ker(void) const
Definition IR.h:45
coco::Stride2D * stride(void)
Definition IR.h:60
void ifm(coco::Object *o)
Definition IR.h:43
coco::Padding2D * pad(void)
Definition IR.h:57
const coco::Stride2D * stride(void) const
Definition IR.h:61
coco::Object * ofm(void) const
Definition IR.h:39
coco::Object * bias(void) const
Definition IR.h:53
coco::Instr * loc(void) override
Definition IR.h:36
void ker(coco::Object *o)
Definition IR.h:46
void ofm(coco::Object *o)
Definition IR.h:40
Concatenate feature maps along "depth" dimension through Andoird NN API.
Definition IR.h:81
coco::Object * fst(void) const
Definition IR.h:95
coco::Object * snd(void) const
Definition IR.h:98
coco::Object * out(void) const
Definition IR.h:92
void snd(coco::Object *o)
Definition IR.h:99
coco::Instr * loc(void) override
Definition IR.h:89
void out(coco::Object *o)
Definition IR.h:93
void fst(coco::Object *o)
Definition IR.h:96
ANNDepthConcatF()
Definition IR.h:83
Object * value(void) const
Definition Def.h:37
Base interface on explicit computation steps in coco IR.
Definition Instr.h:57
Base interface on all typed NN values.
Definition Object.h:38
Object * value(void) const
Definition Use.h:37