diff options
author | Viet-Hoa Do <viet-hoa.do@arm.com> | 2023-08-29 16:01:13 +0100 |
---|---|---|
committer | Viet-Hoa Do <viet-hoa.do@arm.com> | 2023-08-30 12:32:10 +0000 |
commit | d0d8f2e61039826685aa076347eacce526e8c74b (patch) | |
tree | b655ee0c07c8c87ce387c370d20494169ae86d5c /compute_kernel_writer/include | |
parent | 87706692252b0746e882a9dd34ae64dc60acd767 (diff) | |
download | ComputeLibrary-d0d8f2e61039826685aa076347eacce526e8c74b.tar.gz |
Add get_global_id and printf for CKW
Resolves: COMPMID-6387
Signed-off-by: Viet-Hoa Do <viet-hoa.do@arm.com>
Change-Id: I5bedb2fdb658a6eb5f1d5053b3840ca81cf75d03
Reviewed-on: https://review.mlplatform.org/c/ml/ComputeLibrary/+/10214
Reviewed-by: Gunes Bayir <gunes.bayir@arm.com>
Comments-Addressed: Arm Jenkins <bsgcomp@arm.com>
Tested-by: Arm Jenkins <bsgcomp@arm.com>
Benchmark: Arm Jenkins <bsgcomp@arm.com>
Diffstat (limited to 'compute_kernel_writer/include')
-rw-r--r-- | compute_kernel_writer/include/ckw/KernelWriter.h | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/compute_kernel_writer/include/ckw/KernelWriter.h b/compute_kernel_writer/include/ckw/KernelWriter.h index 23237ace28..0c8f3de0a1 100644 --- a/compute_kernel_writer/include/ckw/KernelWriter.h +++ b/compute_kernel_writer/include/ckw/KernelWriter.h @@ -175,6 +175,13 @@ public: // Misc // ============================================================================================= + /** Write the statement to get the global ID of the specified dimension. + * + * @param[in] dst The tile to write the global ID into. + * @param[in] dim The dimension. + */ + virtual void op_get_global_id(const TileOperand &dst, int32_t dim) = 0; + /** Write the line comment in debug build. * * This function does not take effect on release build. @@ -185,6 +192,23 @@ public: */ virtual void op_comment(const std::string &text) = 0; + /** Write the statement to print out the value of all the specified tiles. + * + * The printing statement is constructed so that the prefix and each of the operand are printed in separate lines. + * The format for each operand varies depending on whether it is a 2D tile, a vector or a scalar value. + * + * Example output of the printing statement when it is executed: + * + * prefix + * scalar_name = scalar_value + * vector_name = [vector_value_0, vector_value_1, vector_value_2] + * tile_name = [[tile_value_00, tile_value_01], [tile_value_10, tile_value_11]] + * + * @param[in] prefix The first string to be printed out before the list of operands. + * @param[in] operands The list of tiles to be included in the printing statement. + */ + virtual void op_print(const std::string &prefix, const std::vector<TileOperand> &operands) = 0; + /** Write the given raw code to kernel source code * It's used to address the cases where the user needs to * explicitly add a code where it's not (yet) supported by |