diff options
author | Viet-Hoa Do <viet-hoa.do@arm.com> | 2023-08-30 10:12:22 +0100 |
---|---|---|
committer | Viet-Hoa Do <viet-hoa.do@arm.com> | 2023-08-30 11:10:17 +0000 |
commit | 98901e44d15864cb0c7ccd5febb60491569915f0 (patch) | |
tree | 2b478a24056105974c71eb3b3a5400ec7d0e107d /compute_kernel_writer/src | |
parent | b1fcb411b3552e09af07ab06b5a49769e30bf047 (diff) | |
download | ComputeLibrary-98901e44d15864cb0c7ccd5febb60491569915f0.tar.gz |
Minor fixes in CKW
* Address some outstanding issues from previous commits.
Resolves: COMPMID-6387
Signed-off-by: Viet-Hoa Do <viet-hoa.do@arm.com>
Change-Id: Iab504c20e9b30601b8745c092259a74ccfedf804
Reviewed-on: https://review.mlplatform.org/c/ml/ComputeLibrary/+/10215
Benchmark: Arm Jenkins <bsgcomp@arm.com>
Tested-by: Arm Jenkins <bsgcomp@arm.com>
Reviewed-by: Gunes Bayir <gunes.bayir@arm.com>
Comments-Addressed: Arm Jenkins <bsgcomp@arm.com>
Diffstat (limited to 'compute_kernel_writer/src')
-rw-r--r-- | compute_kernel_writer/src/cl/CLKernelWriter.cpp | 18 | ||||
-rw-r--r-- | compute_kernel_writer/src/cl/CLKernelWriter.h | 12 |
2 files changed, 15 insertions, 15 deletions
diff --git a/compute_kernel_writer/src/cl/CLKernelWriter.cpp b/compute_kernel_writer/src/cl/CLKernelWriter.cpp index c64b7415ff..4284388c0b 100644 --- a/compute_kernel_writer/src/cl/CLKernelWriter.cpp +++ b/compute_kernel_writer/src/cl/CLKernelWriter.cpp @@ -314,7 +314,7 @@ void CLKernelWriter::op_ternary(const TileOperand &dst, TernaryOp op, const Tile } } -void CLKernelWriter::op_if_generic(bool is_else, const TileOperand &lhs, BinaryOp op, const TileOperand &rhs, const std::function<void()> &body) +void CLKernelWriter::op_if_generic(const TileOperand &lhs, BinaryOp op, const TileOperand &rhs, const std::function<void()> &body, bool is_else_if) { const auto &lhs_tile = to_cl_tile(lhs); const auto &rhs_tile = to_cl_tile(rhs); @@ -325,7 +325,7 @@ void CLKernelWriter::op_if_generic(bool is_else, const TileOperand &lhs, BinaryO CKW_ASSERT(lhs_tile.is_scalar()); CKW_ASSERT(rhs_tile.is_scalar()); - if(is_else) + if(is_else_if) { append_code("else "); } @@ -337,12 +337,12 @@ void CLKernelWriter::op_if_generic(bool is_else, const TileOperand &lhs, BinaryO void CLKernelWriter::op_if(const TileOperand &lhs, BinaryOp op, const TileOperand &rhs, const std::function<void()> &body) { - op_if_generic(false, lhs, op, rhs, body); + op_if_generic(lhs, op, rhs, body, false /* is_else_if */); } void CLKernelWriter::op_else_if(const TileOperand &lhs, BinaryOp op, const TileOperand &rhs, const std::function<void()> &body) { - op_if_generic(true, lhs, op, rhs, body); + op_if_generic(lhs, op, rhs, body, true /* is_else_if */); } void CLKernelWriter::op_else(const std::function<void()> &body) @@ -453,7 +453,7 @@ TileOperand CLKernelWriter::declare_tile(const std::string &name, const TileInfo TileOperand CLKernelWriter::declare_constant_tile(const ConstantData &data) { - auto tile = std::make_unique<CLTile>(get_values(data), get_data_type(data)); + auto tile = std::make_unique<CLTile>(get_values(data), get_data_type(data)); const TileOperand operand = create_tile_operand(*tile); _constant_tiles.insert(std::move(tile)); @@ -525,8 +525,8 @@ const CLTile &CLKernelWriter::to_cl_tile(const TileOperand &operand) const void CLKernelWriter::op_load(const TileOperand &tile_op, const TensorOperand &tensor_op, TensorSampler &sampler, const TileOperand &x, const TileOperand &y, const TileOperand &z, const TileOperand &batch) { - const CLTile dilation_x({{"1"}}, DataType::Int32); - const CLTile dilation_y({{"1"}}, DataType::Int32); + const CLTile dilation_x({ { "1" } }, DataType::Int32); + const CLTile dilation_y({ { "1" } }, DataType::Int32); op_load_store(MemoryOperation::Load, tile_op, tensor_op, sampler, x, y, z, batch, dilation_x, dilation_y); } @@ -544,8 +544,8 @@ void CLKernelWriter::op_load_dilated(const TileOperand &tile_op, const TensorOpe void CLKernelWriter::op_store(const TensorOperand &tensor_op, const TileOperand &tile_op, TensorSampler &sampler, const TileOperand &x, const TileOperand &y, const TileOperand &z, const TileOperand &batch) { - const CLTile dilation_x({{"1"}}, DataType::Int32); - const CLTile dilation_y({{"1"}}, DataType::Int32); + const CLTile dilation_x({ { "1" } }, DataType::Int32); + const CLTile dilation_y({ { "1" } }, DataType::Int32); op_load_store(MemoryOperation::Store, tile_op, tensor_op, sampler, x, y, z, batch, dilation_x, dilation_y); } diff --git a/compute_kernel_writer/src/cl/CLKernelWriter.h b/compute_kernel_writer/src/cl/CLKernelWriter.h index 9fc7e550a7..9458ced916 100644 --- a/compute_kernel_writer/src/cl/CLKernelWriter.h +++ b/compute_kernel_writer/src/cl/CLKernelWriter.h @@ -198,13 +198,13 @@ private: * * It is used for both @ref CLKernelWriter::op_if and @ref CLKernelWriter::op_else_if. * - * @param[in] is_else True if this is an `else if` block, otherwise this is an `if` block. - * @param[in] lhs The LHS tile of the condition. - * @param[in] op The relational binary operator. - * @param[in] rhs The RHS tile of the condition. - * @param[in] body The function that writes the body of the else-if block. + * @param[in] lhs The LHS tile of the condition. + * @param[in] op The relational binary operator. + * @param[in] rhs The RHS tile of the condition. + * @param[in] body The function that writes the body of the else-if block. + * @param[in] is_else_if True if this is an `else if` block, otherwise this is an `if` block. */ - void op_if_generic(bool is_else, const TileOperand &lhs, BinaryOp op, const TileOperand &rhs, const std::function<void()> &body); + void op_if_generic(const TileOperand &lhs, BinaryOp op, const TileOperand &rhs, const std::function<void()> &body, bool is_else_if); // For attributes private: |