Skip to content

Commit 6529a90

Browse files
zonglinpengmeta-codesync[bot]
authored andcommitted
Create im2row hifi cpp kernel tests (#15123)
Summary: Pull Request resolved: #15123 ### Summary This diff adds a new test for the `im2row_out` operator in the Cadence HiFi backend. The test is added in the `test_op_im2row_out.cpp` file and is compilable on both fbcode and xplat. The test includes a new function `im2row_out` in the `operators.h` file, which is declared but not defined. The definition of this function is not provided in this diff. The test file `test_op_im2row_out.cpp` includes the necessary headers and uses the `gtest` framework for testing. It also includes some utility functions from the `executorch` library. Overall, this diff adds a new test for the `im2row_out` operator in the Cadence HiFi backend, but does not provide the implementation of the operator itself. Reviewed By: mcremon-meta Differential Revision: D84639802
1 parent aeef01a commit 6529a90

File tree

2 files changed

+461
-0
lines changed

2 files changed

+461
-0
lines changed

backends/cadence/hifi/operators/operators.h

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,28 @@ void quantized_add_asym8uxasym8u_asym8u_per_tensor_out(
191191
int64_t out_zero_point,
192192
::executorch::aten::Tensor& out);
193193

194+
void im2row_out(
195+
::executorch::runtime::KernelRuntimeContext& ctx,
196+
const ::executorch::aten::Tensor& input,
197+
::executorch::aten::IntArrayRef kernel_size,
198+
::executorch::aten::IntArrayRef dilation,
199+
::executorch::aten::IntArrayRef padding,
200+
::executorch::aten::IntArrayRef stride,
201+
const ::executorch::aten::Tensor& in_zero_point,
202+
bool channel_last,
203+
::executorch::aten::Tensor& out);
204+
205+
void im2row_per_tensor_out(
206+
::executorch::runtime::KernelRuntimeContext& ctx,
207+
const ::executorch::aten::Tensor& input,
208+
::executorch::aten::IntArrayRef kernel_size,
209+
::executorch::aten::IntArrayRef dilation,
210+
::executorch::aten::IntArrayRef padding,
211+
::executorch::aten::IntArrayRef stride,
212+
int64_t in_zero_point,
213+
bool channel_last,
214+
::executorch::aten::Tensor& out);
215+
194216
} // namespace native
195217
} // namespace HiFi
196218
} // namespace impl

0 commit comments

Comments
 (0)