Skip to content

Commit 4f2ac7e

Browse files
zingofreddan80
authored andcommitted
Use lambda on all kernel prim ops
This makes executorch_prim::et_copy_index.tensor and executorch_prim::et_view.default also use a lamba function like the rest. This fixes a problem where the functions pointers didn't get proper values for this two ops. Signed-off-by: Zingo Andersen <[email protected]> Change-Id: Icc2623c5fe730483ddb21f041fe52de03f63a953
1 parent 73893e1 commit 4f2ac7e

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

kernels/prim_ops/register_prim_ops.cpp

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -363,9 +363,17 @@ static Kernel prim_ops[] = {
363363
}),
364364

365365
// executorch_prim::et_copy_index.tensor(tensor, tensor) -> tensor
366-
Kernel("executorch_prim::et_copy_index.tensor", &et_copy_index),
366+
Kernel(
367+
"executorch_prim::et_copy_index.tensor",
368+
[](KernelRuntimeContext& context, EValue** stack) {
369+
et_copy_index(context, stack);
370+
}),
367371
// executorch_prim::et_view.default(Tensor, int[]) -> Tensor
368-
Kernel("executorch_prim::et_view.default", &et_view),
372+
Kernel(
373+
"executorch_prim::et_view.default",
374+
[](KernelRuntimeContext& context, EValue** stack) {
375+
et_view(context, stack);
376+
}),
369377

370378
};
371379

0 commit comments

Comments
 (0)