Skip to content

Commit

Permalink
Use lambda on all kernel prim ops
Browse files Browse the repository at this point in the history
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 <zingo.andersen@arm.com>
Change-Id: Icc2623c5fe730483ddb21f041fe52de03f63a953
  • Loading branch information
zingo authored and freddan80 committed Nov 13, 2024
1 parent 73893e1 commit 4f2ac7e
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions kernels/prim_ops/register_prim_ops.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -363,9 +363,17 @@ static Kernel prim_ops[] = {
}),

// executorch_prim::et_copy_index.tensor(tensor, tensor) -> tensor
Kernel("executorch_prim::et_copy_index.tensor", &et_copy_index),
Kernel(
"executorch_prim::et_copy_index.tensor",
[](KernelRuntimeContext& context, EValue** stack) {
et_copy_index(context, stack);
}),
// executorch_prim::et_view.default(Tensor, int[]) -> Tensor
Kernel("executorch_prim::et_view.default", &et_view),
Kernel(
"executorch_prim::et_view.default",
[](KernelRuntimeContext& context, EValue** stack) {
et_view(context, stack);
}),

};

Expand Down

0 comments on commit 4f2ac7e

Please sign in to comment.