aboutsummaryrefslogtreecommitdiff
path: root/compute_kernel_writer/prototype/examples/add_exp_store.cpp
diff options
context:
space:
mode:
authorNikolaj Jensen <nikolaj.jensen@arm.com>2023-06-27 14:13:24 +0100
committerNikolaj Jensen <nikolaj.jensen@arm.com>2023-07-10 16:04:14 +0000
commit5ff480265a110ea1f2ce24491e082f52348b0f92 (patch)
tree438268e9c4465213d57477104620a260d59ae33a /compute_kernel_writer/prototype/examples/add_exp_store.cpp
parent4c0a38a33046416a8f8fd779a467502b98311bcd (diff)
downloadComputeLibrary-5ff480265a110ea1f2ce24491e082f52348b0f92.tar.gz
Port operations to CKW prototype
Resolves: COMPMID-6334 Signed-off-by: Nikolaj Jensen <nikolaj.jensen@arm.com> Change-Id: I500d30f09daec4087eb3e7aecd1de77dc8fd53b4 Signed-off-by: Nikolaj Jensen <nikolaj.jensen@arm.com> Reviewed-on: https://review.mlplatform.org/c/ml/ComputeLibrary/+/9828 Tested-by: Arm Jenkins <bsgcomp@arm.com> Reviewed-by: Gunes Bayir <gunes.bayir@arm.com> Reviewed-by: Jakub Sujak <jakub.sujak@arm.com> Comments-Addressed: Arm Jenkins <bsgcomp@arm.com> Benchmark: Arm Jenkins <bsgcomp@arm.com>
Diffstat (limited to 'compute_kernel_writer/prototype/examples/add_exp_store.cpp')
-rw-r--r--compute_kernel_writer/prototype/examples/add_exp_store.cpp11
1 files changed, 5 insertions, 6 deletions
diff --git a/compute_kernel_writer/prototype/examples/add_exp_store.cpp b/compute_kernel_writer/prototype/examples/add_exp_store.cpp
index a9be0495ec..9529268c9a 100644
--- a/compute_kernel_writer/prototype/examples/add_exp_store.cpp
+++ b/compute_kernel_writer/prototype/examples/add_exp_store.cpp
@@ -27,7 +27,6 @@
#include "ckw/TensorOperand.h"
#include "ckw/TensorTileSampler.h"
#include "ckw/TileOperand.h"
-#include "ckw/Types.h"
#include "common/ExampleComponentArgument.h"
#include "common/ExampleKernelWriter.h"
@@ -110,7 +109,7 @@ void op_binary_elementwise(ExampleScopedKernelWriter writer, std::vector<Example
auto &dst_tile = dst->tile();
// Perform the operation.
- writer->op_binary_expression(dst_tile, lhs_tile, rhs_tile, BinaryOp::Add);
+ writer->op_binary_expression(dst_tile, lhs_tile, BinaryOp::Add, rhs_tile);
}
void op_exp(ExampleScopedKernelWriter writer, std::vector<ExampleComponentArgument *> operands)
@@ -138,7 +137,7 @@ void op_exp(ExampleScopedKernelWriter writer, std::vector<ExampleComponentArgume
auto &dst_tile = dst->tile();
// Perform the operation.
- writer->op_scalar_function(dst_tile, src_tile, ScalarUnaryFunction::Exp);
+ writer->op_unary_elementwise_function(dst_tile, UnaryFunction::Exp, src_tile);
}
void op_store(ExampleScopedKernelWriter writer, std::vector<ExampleComponentArgument *> operands)
@@ -164,9 +163,9 @@ int main()
const TensorInfo src1_info(DataType::Fp32, TensorShape({ 3, 10, 20, 1, 1 }), TensorDataLayout::Nhwc, 1);
const TensorInfo dst_info(DataType::Fp32, TensorShape({ 3, 10, 20, 1, 1 }), TensorDataLayout::Nhwc, 2);
- ExampleComponentArgument src0(writer->create_tensor_argument("src0", src0_info));
- ExampleComponentArgument src1(writer->create_tensor_argument("src1", src1_info));
- ExampleComponentArgument dst(writer->create_tensor_argument("dst", dst_info));
+ ExampleComponentArgument src0(writer->declare_tensor_argument("src0", src0_info));
+ ExampleComponentArgument src1(writer->declare_tensor_argument("src1", src1_info));
+ ExampleComponentArgument dst(writer->declare_tensor_argument("dst", dst_info));
ExampleComponentArgument ans;