11
11
#include < executorch/runtime/kernel/kernel_includes.h>
12
12
#include < executorch/runtime/kernel/operator_registry.h>
13
13
14
- using OpArrayRef = ::torch::executor::ArrayRef<::torch::executor::Operator >;
14
+ using KernelArrayRef = ::torch::executor::ArrayRef<::torch::executor::Kernel >;
15
15
using torch::executor::function::et_copy_index;
16
16
17
17
namespace torch {
@@ -20,9 +20,9 @@ namespace function {
20
20
21
21
namespace {
22
22
23
- static Operator prim_ops[] = {
23
+ static Kernel prim_ops[] = {
24
24
// aten::sym_size.int(Tensor self, int dim) -> SymInt
25
- Operator (
25
+ Kernel (
26
26
" aten::sym_size.int" ,
27
27
[](RuntimeContext& context, EValue** stack) {
28
28
(void )context;
@@ -35,7 +35,7 @@ static Operator prim_ops[] = {
35
35
out = EValue (size);
36
36
}),
37
37
// aten::sym_numel(Tensor self) -> SymInt
38
- Operator (
38
+ Kernel (
39
39
" aten::sym_numel" ,
40
40
[](RuntimeContext& context, EValue** stack) {
41
41
(void )context;
@@ -46,7 +46,7 @@ static Operator prim_ops[] = {
46
46
out = EValue (numel);
47
47
}),
48
48
// executorch_prim::add.Scalar(Scalar, Scalar) -> Scalar
49
- Operator (
49
+ Kernel (
50
50
" executorch_prim::add.Scalar" ,
51
51
[](RuntimeContext& context, EValue** stack) {
52
52
(void )context;
@@ -64,7 +64,7 @@ static Operator prim_ops[] = {
64
64
}),
65
65
66
66
// executorch_prim::sub.Scalar(Scalar, Scalar) -> Scalar
67
- Operator (
67
+ Kernel (
68
68
" executorch_prim::sub.Scalar" ,
69
69
[](RuntimeContext& context, EValue** stack) {
70
70
(void )context;
@@ -82,7 +82,7 @@ static Operator prim_ops[] = {
82
82
}),
83
83
84
84
// executorch_prim::mul.Scalar(Scalar, Scalar) -> Scalar
85
- Operator (
85
+ Kernel (
86
86
" executorch_prim::mul.Scalar" ,
87
87
[](RuntimeContext& context, EValue** stack) {
88
88
(void )context;
@@ -100,7 +100,7 @@ static Operator prim_ops[] = {
100
100
}),
101
101
102
102
// executorch_prim::floordiv.Scalar(Scalar, Scalar) -> Scalar
103
- Operator (
103
+ Kernel (
104
104
" executorch_prim::floordiv.Scalar" ,
105
105
[](RuntimeContext& context, EValue** stack) {
106
106
(void )context;
@@ -118,7 +118,7 @@ static Operator prim_ops[] = {
118
118
}),
119
119
120
120
// executorch_prim::eq.Scalar(Scalar, Scalar) -> bool
121
- Operator (
121
+ Kernel (
122
122
" executorch_prim::eq.Scalar" ,
123
123
[](RuntimeContext& context, EValue** stack) {
124
124
(void )context;
@@ -138,7 +138,7 @@ static Operator prim_ops[] = {
138
138
}),
139
139
140
140
// executorch_prim::gt.Scalar(Scalar, Scalar) -> bool
141
- Operator (
141
+ Kernel (
142
142
" executorch_prim::gt.Scalar" ,
143
143
[](RuntimeContext& context, EValue** stack) {
144
144
(void )context;
@@ -158,7 +158,7 @@ static Operator prim_ops[] = {
158
158
}),
159
159
160
160
// executorch_prim::lt.Scalar(Scalar, Scalar) -> bool
161
- Operator (
161
+ Kernel (
162
162
" executorch_prim::lt.Scalar" ,
163
163
[](RuntimeContext& context, EValue** stack) {
164
164
(void )context;
@@ -178,7 +178,7 @@ static Operator prim_ops[] = {
178
178
}),
179
179
180
180
// executorch_prim::ge.Scalar(Scalar, Scalar) -> bool
181
- Operator (
181
+ Kernel (
182
182
" executorch_prim::ge.Scalar" ,
183
183
[](RuntimeContext& context, EValue** stack) {
184
184
(void )context;
@@ -198,7 +198,7 @@ static Operator prim_ops[] = {
198
198
}),
199
199
200
200
// executorch_prim::le.Scalar(Scalar, Scalar) -> bool
201
- Operator (
201
+ Kernel (
202
202
" executorch_prim::le.Scalar" ,
203
203
[](RuntimeContext& context, EValue** stack) {
204
204
(void )context;
@@ -220,7 +220,7 @@ static Operator prim_ops[] = {
220
220
// TODO(T159977211): wait a little bit so older models with these ops are
221
221
// regenerated and then delete them
222
222
// executorch_prim::add.int(int, int) -> int
223
- Operator (
223
+ Kernel (
224
224
" executorch_prim::add.int" ,
225
225
[](RuntimeContext& context, EValue** stack) {
226
226
(void )context;
@@ -231,7 +231,7 @@ static Operator prim_ops[] = {
231
231
}),
232
232
233
233
// executorch_prim::sub.int(int, int) -> int
234
- Operator (
234
+ Kernel (
235
235
" executorch_prim::sub.int" ,
236
236
[](RuntimeContext& context, EValue** stack) {
237
237
(void )context;
@@ -242,7 +242,7 @@ static Operator prim_ops[] = {
242
242
}),
243
243
244
244
// executorch_prim::mul.int(int, int) -> int
245
- Operator (
245
+ Kernel (
246
246
" executorch_prim::mul.int" ,
247
247
[](RuntimeContext& context, EValue** stack) {
248
248
(void )context;
@@ -253,7 +253,7 @@ static Operator prim_ops[] = {
253
253
}),
254
254
255
255
// executorch_prim::floordiv.int(int, int) -> int
256
- Operator (
256
+ Kernel (
257
257
" executorch_prim::floordiv.int" ,
258
258
[](RuntimeContext& context, EValue** stack) {
259
259
(void )context;
@@ -264,7 +264,7 @@ static Operator prim_ops[] = {
264
264
}),
265
265
266
266
// executorch_prim::eq.int(int, int) -> bool
267
- Operator (
267
+ Kernel (
268
268
" executorch_prim::eq.int" ,
269
269
[](RuntimeContext& context, EValue** stack) {
270
270
(void )context;
@@ -275,7 +275,7 @@ static Operator prim_ops[] = {
275
275
}),
276
276
277
277
// executorch_prim::gt.int(int, int) -> bool
278
- Operator (
278
+ Kernel (
279
279
" executorch_prim::gt.int" ,
280
280
[](RuntimeContext& context, EValue** stack) {
281
281
(void )context;
@@ -286,7 +286,7 @@ static Operator prim_ops[] = {
286
286
}),
287
287
288
288
// executorch_prim::lt.int(int, int) -> bool
289
- Operator (
289
+ Kernel (
290
290
" executorch_prim::lt.int" ,
291
291
[](RuntimeContext& context, EValue** stack) {
292
292
(void )context;
@@ -297,7 +297,7 @@ static Operator prim_ops[] = {
297
297
}),
298
298
299
299
// executorch_prim::ge.int(int, int) -> bool
300
- Operator (
300
+ Kernel (
301
301
" executorch_prim::ge.int" ,
302
302
[](RuntimeContext& context, EValue** stack) {
303
303
(void )context;
@@ -308,7 +308,7 @@ static Operator prim_ops[] = {
308
308
}),
309
309
310
310
// executorch_prim::le.int(int, int) -> bool
311
- Operator (
311
+ Kernel (
312
312
" executorch_prim::le.int" ,
313
313
[](RuntimeContext& context, EValue** stack) {
314
314
(void )context;
@@ -319,17 +319,17 @@ static Operator prim_ops[] = {
319
319
}),
320
320
321
321
// executorch_prim::et_copy_index.tensor(tensor, tensor) -> tensor
322
- Operator (" executorch_prim::et_copy_index.tensor" , &et_copy_index),
322
+ Kernel (" executorch_prim::et_copy_index.tensor" , &et_copy_index),
323
323
324
324
};
325
325
326
- static OpArrayRef op_array_ref (
326
+ static KernelArrayRef kernel_array_ref (
327
327
prim_ops,
328
- prim_ops + sizeof (prim_ops) / sizeof(Operator ));
328
+ prim_ops + sizeof (prim_ops) / sizeof(Kernel ));
329
329
330
330
// Return value not used. Keep the static variable assignment to register
331
331
// operators in static initialization time.
332
- static auto success_with_op_reg = register_operators(op_array_ref );
332
+ static auto success_with_kernel_reg = register_kernels(kernel_array_ref );
333
333
334
334
} // namespace
335
335
} // namespace function
0 commit comments