aboutsummaryrefslogtreecommitdiff
path: root/compute_kernel_writer/include
AgeCommit message (Collapse)Author
2024-02-01Use the stable CKW API in the GPU dynamic fusion backendGunes Bayir
- Refactor all kernels to work with the CKW stable API - Add support for sub-tile in the op_load/op_store CKW operator - Fix mismatch in resize - Add comments in all kernels written with CKW to help developers understand the structure of the code - Add texture image support in depthwise convolution written with CKW - Add support for different block sizes in depthwise convolution - Remove the use of the dynamic fusion helper functions. - Add support for floor in the op_unary() of CKW Resolves: COMPMID-6708, COMPMID-6743, COMPMID-6530 Signed-off-by: Gian Marco Iodice <gianmarco.iodice@arm.com> Signed-off-by: Gunes Bayir <gunes.bayir@arm.com> Signed-off-by: Viet-Hoa Do <viet-hoa.do@arm.com> Signed-off-by: Jakub Sujak <jakub.sujak@arm.com> Change-Id: I8104ce4d04a3138a1aeb0b84940e1f1c89e76069 Reviewed-on: https://review.mlplatform.org/c/ml/ComputeLibrary/+/10914 Tested-by: Arm Jenkins <bsgcomp@arm.com> Reviewed-by: Jakub Sujak <jakub.sujak@arm.com> Reviewed-by: Gunes Bayir <gunes.bayir@arm.com> Comments-Addressed: Arm Jenkins <bsgcomp@arm.com> Benchmark: Arm Jenkins <bsgcomp@arm.com>
2023-09-28Apply clang-format on repositoryFelix Thomasmathibalan
Code is formatted as per a revised clang format configuration file(not part of this delivery). Version 14.0.6 is used. Exclusion List: - files with .cl extension - files that are not strictly C/C++ (e.g. Android.bp, Sconscript ...) And the following directories - compute_kernel_writer/validation/ - tests/ - include/ - src/core/NEON/kernels/convolution/ - src/core/NEON/kernels/arm_gemm/ - src/core/NEON/kernels/arm_conv/ - data/ There will be a follow up for formatting of .cl files and the files under tests/ and compute_kernel_writer/validation/. Signed-off-by: Felix Thomasmathibalan <felixjohnny.thomasmathibalan@arm.com> Change-Id: Ib7eb1fcf4e7537b9feaefcfc15098a804a3fde0a Reviewed-on: https://review.mlplatform.org/c/ml/ComputeLibrary/+/10391 Benchmark: Arm Jenkins <bsgcomp@arm.com> Tested-by: Arm Jenkins <bsgcomp@arm.com> Reviewed-by: Gunes Bayir <gunes.bayir@arm.com>
2023-09-22Add row vector and scalar access support to tile operandViet-Hoa Do
* Add the concept of tile view which refers to a specific rectangular area of the tile object. - The active area is added to TileOperand so that the user can access part of the tile. - Currently only row vector and scalar access are exposed to the user. - All writing operations except load/store op support sub-tile. * Add tests for sub-tile access. Resolves: COMPMID-6557 Signed-off-by: Mohammed Suhail Munshi <MohammedSuhail.Munshi@arm.com> Signed-off-by: Viet-Hoa Do <viet-hoa.do@arm.com> Change-Id: Ica3f9eaf17f06e080c495d36c572f623b62c2910 Reviewed-on: https://review.mlplatform.org/c/ml/ComputeLibrary/+/10354 Reviewed-by: Gunes Bayir <gunes.bayir@arm.com> Tested-by: Arm Jenkins <bsgcomp@arm.com> Comments-Addressed: Arm Jenkins <bsgcomp@arm.com> Benchmark: Arm Jenkins <bsgcomp@arm.com>
2023-08-30Implement indirect load for buffer and CLImageGunes Bayir
Add KernelWriter API functions for loading from an indirect buffer Resolves: COMPMID-6390 Signed-off-by: Gunes Bayir <gunes.bayir@arm.com> Change-Id: I45dbf88b25ec5caf2b458657ef20aacac9924745 Reviewed-on: https://review.mlplatform.org/c/ml/ComputeLibrary/+/10192 Reviewed-by: Viet-Hoa Do <viet-hoa.do@arm.com> Reviewed-by: Gian Marco Iodice <gianmarco.iodice@arm.com> Tested-by: Arm Jenkins <bsgcomp@arm.com> Comments-Addressed: Arm Jenkins <bsgcomp@arm.com> Benchmark: Arm Jenkins <bsgcomp@arm.com>
2023-08-30Add get_global_id and printf for CKWViet-Hoa Do
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>
2023-08-29Add CKW flow control writing methodsViet-Hoa Do
* Structures: if/else/else if, for, return. * Add corresponding tests. Partially resolves: COMPMID-6387 Signed-off-by: Viet-Hoa Do <viet-hoa.do@arm.com> Change-Id: I2912ccaf46f836907f21bb53fa82bcc1f48dd224 Reviewed-on: https://review.mlplatform.org/c/ml/ComputeLibrary/+/10199 Tested-by: Arm Jenkins <bsgcomp@arm.com> Reviewed-by: SiCong Li <sicong.li@arm.com> Reviewed-by: Gunes Bayir <gunes.bayir@arm.com> Comments-Addressed: Arm Jenkins <bsgcomp@arm.com> Benchmark: Arm Jenkins <bsgcomp@arm.com>
2023-08-29Add declare_constant_tile API function in CKWGunes Bayir
Resolves: COMPMID-6535 Change-Id: I07d8aca96a0fcbd624f828b24513ee0500a14a74 Signed-off-by: Gunes Bayir <gunes.bayir@arm.com> Reviewed-on: https://review.mlplatform.org/c/ml/ComputeLibrary/+/10200 Reviewed-by: Viet-Hoa Do <viet-hoa.do@arm.com> Comments-Addressed: Arm Jenkins <bsgcomp@arm.com> Tested-by: Arm Jenkins <bsgcomp@arm.com> Benchmark: Arm Jenkins <bsgcomp@arm.com>
2023-08-24Add CKW binary and ternary statementsViet-Hoa Do
Resolves: COMPMID-6388 Signed-off-by: Viet-Hoa Do <viet-hoa.do@arm.com> Change-Id: Ia0cd1486f368af54053066f489cac83b9de01789 Reviewed-on: https://review.mlplatform.org/c/ml/ComputeLibrary/+/10182 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>
2023-08-22Add CKW writing methods for CL unary opsViet-Hoa Do
* Add writing methods for: - Assignment. - Cast. - Unary expression. * Add corresponding tests. Partially resolves: COMPMID-6388. Signed-off-by: Viet-Hoa Do <viet-hoa.do@arm.com> Change-Id: Ia654173e2e1ee9cddb7819980251e0591934439f Reviewed-on: https://review.mlplatform.org/c/ml/ComputeLibrary/+/10155 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>
2023-08-18Implement load/store API functionsGunes Bayir
Add KernelWriter API functions for loading and storing tiles with and without dilations. Resolves: COMPMID-5791, COMPMID-6389 Change-Id: I9b1f5b2f081fa54e7bda488aac69ed8d43d1d35c Signed-off-by: Gunes Bayir <gunes.bayir@arm.com> Reviewed-on: https://review.mlplatform.org/c/ml/ComputeLibrary/+/10152 Tested-by: Arm Jenkins <bsgcomp@arm.com> Reviewed-by: Jakub Sujak <jakub.sujak@arm.com> Reviewed-by: Viet-Hoa Do <viet-hoa.do@arm.com> Comments-Addressed: Arm Jenkins <bsgcomp@arm.com> Benchmark: Arm Jenkins <bsgcomp@arm.com>
2023-08-07Add kernel argument emittingViet-Hoa Do
Resolves: COMPMID-6391 Signed-off-by: Viet-Hoa Do <viet-hoa.do@arm.com> Change-Id: I0d54d99ffad275400c6da7fe16deb544553060eb Reviewed-on: https://review.mlplatform.org/c/ml/ComputeLibrary/+/10004 Reviewed-by: Anitha Raj <Anitha.Raj@arm.com> Reviewed-by: Gunes Bayir <gunes.bayir@arm.com> Tested-by: Arm Jenkins <bsgcomp@arm.com> Comments-Addressed: Arm Jenkins <bsgcomp@arm.com> Benchmark: Arm Jenkins <bsgcomp@arm.com>
2023-08-07Add Memory Operation enum and helper base classGunes Bayir
This type and class will be used by OpenCL specific helper classes for buffer and texture storage types. Partially Resolves: COMPMID-5791 Signed-off-by: Gunes Bayir <gunes.bayir@arm.com> Change-Id: Ie077e6d8a8d23d1edfc7bb4c19a6d1a98a44e36f Reviewed-on: https://review.mlplatform.org/c/ml/ComputeLibrary/+/10000 Comments-Addressed: Arm Jenkins <bsgcomp@arm.com> Reviewed-by: Jakub Sujak <jakub.sujak@arm.com> Tested-by: Arm Jenkins <bsgcomp@arm.com> Benchmark: Arm Jenkins <bsgcomp@arm.com>
2023-08-07Add Tensor3dMapper to CKWGunes Bayir
In CKW, tensors are assumed to be 3d, except the batch dimension. Tensor3dMapper class defines how an Nd tensor is mapped to 3d. It also provides utility functions to access certain dimensions and the associated strides. Partially Resolves: COMPMID-5791 Signed-off-by: Gunes Bayir <gunes.bayir@arm.com> Change-Id: I17c176220201ff92954ab5808fa1c1f29966d4e9 Reviewed-on: https://review.mlplatform.org/c/ml/ComputeLibrary/+/9993 Benchmark: Arm Jenkins <bsgcomp@arm.com> Reviewed-by: Jakub Sujak <jakub.sujak@arm.com> Comments-Addressed: Arm Jenkins <bsgcomp@arm.com> Tested-by: Arm Jenkins <bsgcomp@arm.com>
2023-08-02Add op_write_raw_code to KernelWriter classesGunes Bayir
op_write_raw_code helps writing plain text to kernel body. It's used to address the cases where the user needs to explicitly add a code where it's not (yet) supported by the kernel writer utility calls. Partially Resolves: COMPMID-5791 Signed-off-by: Gunes Bayir <gunes.bayir@arm.com> Change-Id: I04288457ac1871aea8bf10276bf9f078e17fc4b4 Reviewed-on: https://review.mlplatform.org/c/ml/ComputeLibrary/+/9996 Tested-by: Arm Jenkins <bsgcomp@arm.com> Reviewed-by: Gian Marco Iodice <gianmarco.iodice@arm.com> Comments-Addressed: Arm Jenkins <bsgcomp@arm.com>
2023-07-27Add TensorOperand and declare tensor argumentViet-Hoa Do
Partially resolves: COMPMID-6391 Signed-off-by: Viet-Hoa Do <viet-hoa.do@arm.com> Change-Id: I849d486401f99a93919015f2e173559dca5bffa2 Reviewed-on: https://review.mlplatform.org/c/ml/ComputeLibrary/+/9972 Tested-by: Arm Jenkins <bsgcomp@arm.com> Reviewed-by: Gunes Bayir <gunes.bayir@arm.com> Reviewed-by: Gian Marco Iodice <gianmarco.iodice@arm.com> Comments-Addressed: Arm Jenkins <bsgcomp@arm.com> Benchmark: Arm Jenkins <bsgcomp@arm.com>
2023-07-27Add TensorSampler to CKWGunes Bayir
Partially Resolves: COMPMID-5791 Signed-off-by: Gunes Bayir <gunes.bayir@arm.com> Change-Id: Ib9af89d218c8b69ac683ef202401786a807c51b3 Reviewed-on: https://review.mlplatform.org/c/ml/ComputeLibrary/+/9969 Reviewed-by: Viet-Hoa Do <viet-hoa.do@arm.com> Reviewed-by: Anitha Raj <Anitha.Raj@arm.com> Reviewed-by: Gian Marco Iodice <gianmarco.iodice@arm.com> Tested-by: Arm Jenkins <bsgcomp@arm.com> Comments-Addressed: Arm Jenkins <bsgcomp@arm.com> Benchmark: Arm Jenkins <bsgcomp@arm.com>
2023-07-21Change TileOperand to a view of a tile objectViet-Hoa Do
* TileOperand instead of being the tile object now is only a view of a tile object. - declare_tile now returns a TileOperand object, not a reference to a TileOperand object. - This is to prepare for the posibility that the users need to perform operations on part of a tile (e.g. a scalar value, a vector, a sub-tile). Partially resolves: COMPMID-6391 Signed-off-by: Viet-Hoa Do <viet-hoa.do@arm.com> Change-Id: I35c08b22a384a756d99dcd04cbe66fc57bd548d2 Reviewed-on: https://review.mlplatform.org/c/ml/ComputeLibrary/+/9958 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>
2023-07-20Integrate CLTensorArgumentGian Marco Iodice
- Add CLTensorArgument to query the components and storages as OpenCL variables (or by values when possible) - Add caching mechanism in CLTensorArgument to keep track of the components and storages used - Add unit tests Resolves COMPMID-5787 Signed-off-by: Gian Marco Iodice <gianmarco.iodice@arm.com> Signed-off-by: Viet-Hoa Do <viet-hoa.do@arm.com> Change-Id: Ib39e1f77b097e5b907a296fe6b0d41bb4bcd4ffc Reviewed-on: https://review.mlplatform.org/c/ml/ComputeLibrary/+/9908 Comments-Addressed: Arm Jenkins <bsgcomp@arm.com> Benchmark: Arm Jenkins <bsgcomp@arm.com> Tested-by: Arm Jenkins <bsgcomp@arm.com> Reviewed-by: Gunes Bayir <gunes.bayir@arm.com> Reviewed-by: Jakub Sujak <jakub.sujak@arm.com>
2023-07-12Rename ITileOperand and introduce vector/scalar interfaces in CKWGunes Bayir
Partially Resolves: COMPMID-5788 This patch - renames ITileOperand to TileOperand, which seems to be a more intuitive name for the prospective users of Compute Kernel Writer - provides IScalarAccess and IVectorAccess interfaces to be used by Tile classes. It replaces the current IScalarTile and IVectorTile, and forms a more intuitive inheritance hierarchy where each subclass "is a" member of the parent class semantically. Signed-off-by: Gunes Bayir <gunes.bayir@arm.com> Change-Id: I2b5253b0595e63f8ff3047c608d593b3b364634d Reviewed-on: https://review.mlplatform.org/c/ml/ComputeLibrary/+/9910 Reviewed-by: Jakub Sujak <jakub.sujak@arm.com> Reviewed-by: Viet-Hoa Do <viet-hoa.do@arm.com> Comments-Addressed: Arm Jenkins <bsgcomp@arm.com> Benchmark: Arm Jenkins <bsgcomp@arm.com> Tested-by: Arm Jenkins <bsgcomp@arm.com>
2023-07-12Add tile declaration capability in KernelWriterGunes Bayir
Resolves: COMPMID-5816 Signed-off-by: Gunes Bayir <gunes.bayir@arm.com> Change-Id: Ibd885707a842550a058252f9d01e072129896055 Reviewed-on: https://review.mlplatform.org/c/ml/ComputeLibrary/+/9901 Tested-by: Arm Jenkins <bsgcomp@arm.com> Reviewed-by: Viet-Hoa Do <viet-hoa.do@arm.com> Comments-Addressed: Arm Jenkins <bsgcomp@arm.com> Benchmark: Arm Jenkins <bsgcomp@arm.com>
2023-07-11Add kernel and kernel writer skeletonsViet-Hoa Do
* Add the skeleton for kernel, kernel writer and their respective OpenCL implementation. * Add method to write code comment and its test. Resolves: COMPMID-6343 Signed-off-by: Viet-Hoa Do <viet-hoa.do@arm.com> Change-Id: Ib986228154f7a00da7a5fd3b7105941325fe13b1 Reviewed-on: https://review.mlplatform.org/c/ml/ComputeLibrary/+/9889 Tested-by: Arm Jenkins <bsgcomp@arm.com> Reviewed-by: Gunes Bayir <gunes.bayir@arm.com> Comments-Addressed: Arm Jenkins <bsgcomp@arm.com> Benchmark: Arm Jenkins <bsgcomp@arm.com>
2023-07-10Port operations to CKW prototypeNikolaj Jensen
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>
2023-07-07Fix code formatting in CKWNikolaj Jensen
Signed-off-by: Nikolaj Jensen <nikolaj.jensen@arm.com> Change-Id: I8064b345c1efd243f8bded12ed5d561afe7c339a Reviewed-on: https://review.mlplatform.org/c/ml/ComputeLibrary/+/9854 Benchmark: Arm Jenkins <bsgcomp@arm.com> Tested-by: Arm Jenkins <bsgcomp@arm.com> Reviewed-by: Jakub Sujak <jakub.sujak@arm.com> Comments-Addressed: Arm Jenkins <bsgcomp@arm.com>
2023-07-06Implement ITileOperand and set the relationship to CLTileGunes Bayir
Partially Resolves: COMPMID-5788 Signed-off-by: Gunes Bayir <gunes.bayir@arm.com> Change-Id: I268cf02e4b1802b1718b39f251e42042e79e7443 Reviewed-on: https://review.mlplatform.org/c/ml/ComputeLibrary/+/9869 Tested-by: Arm Jenkins <bsgcomp@arm.com> Comments-Addressed: Arm Jenkins <bsgcomp@arm.com> Reviewed-by: Gian Marco Iodice <gianmarco.iodice@arm.com>
2023-07-06Move CKW prototype to separate directoryViet-Hoa Do
Partially resolves: COMPMID-6283 Signed-off-by: Viet-Hoa Do <viet-hoa.do@arm.com> Change-Id: I7596e3dc357d6f0b9cbe66534523943a73c26d81 Reviewed-on: https://review.mlplatform.org/c/ml/ComputeLibrary/+/9864 Reviewed-by: SiCong Li <sicong.li@arm.com> Reviewed-by: Jakub Sujak <jakub.sujak@arm.com> Comments-Addressed: Arm Jenkins <bsgcomp@arm.com> Tested-by: Arm Jenkins <bsgcomp@arm.com> Benchmark: Arm Jenkins <bsgcomp@arm.com>
2023-06-28Fix compute kernel writer build warningsViet-Hoa Do
Partially resolves: COMPMID-6283 Signed-off-by: Viet-Hoa Do <viet-hoa.do@arm.com> Change-Id: I40cdbfd30abca2016f4caaa41a24350d1ff35c4c Reviewed-on: https://review.mlplatform.org/c/ml/ComputeLibrary/+/9830 Reviewed-by: Jakub Sujak <jakub.sujak@arm.com> Comments-Addressed: Arm Jenkins <bsgcomp@arm.com> Benchmark: Arm Jenkins <bsgcomp@arm.com> Tested-by: Arm Jenkins <bsgcomp@arm.com>
2023-06-27Compute kernel writer API and prototypeViet-Hoa Do
* Add the public API for compute kernel writer. * Use the prototype as the implementation of the public API. Resolves: COMPMID-5790 Signed-off-by: Viet-Hoa Do <viet-hoa.do@arm.com> Change-Id: I9d80e15325e1d953feb87c1f2eb61a587bb9ab5e Reviewed-on: https://review.mlplatform.org/c/ml/ComputeLibrary/+/9814 Reviewed-by: Jakub Sujak <jakub.sujak@arm.com> Tested-by: Arm Jenkins <bsgcomp@arm.com> Comments-Addressed: Arm Jenkins <bsgcomp@arm.com> Benchmark: Arm Jenkins <bsgcomp@arm.com>
2023-06-26Add helpers to set CKW tensor components as OpenCL kernel argumentsJakub Sujak
* Define ckw::TensorStorage. The tensor storage represents the type of tensor memory object. * Add helper functions for setting the CKW TensorComponent and TensorStorage as OpenCL kernel arguments. * Refactor CL Image2D method for simpler image object creation. Resolves: COMPMID-5784 Change-Id: I2d37d06783c1dc55f3b5692b44eb49b151f2401c Signed-off-by: Jakub Sujak <jakub.sujak@arm.com> Reviewed-on: https://review.mlplatform.org/c/ml/ComputeLibrary/+/9807 Tested-by: Arm Jenkins <bsgcomp@arm.com> Reviewed-by: SiCong Li <sicong.li@arm.com> Comments-Addressed: Arm Jenkins <bsgcomp@arm.com> Benchmark: Arm Jenkins <bsgcomp@arm.com>
2023-06-20Implement CLConstantTileGian Marco Iodice
- Create tile object to store constant variables - Add unit tests for the CLConstantTile - Extend unit test for CLTile Resolves COMPMID-5786 Signed-off-by: Gian Marco Iodice <gianmarco.iodice@arm.com> Change-Id: I351d8b88327e071791b781a04a6ab4990c89c04d Reviewed-on: https://review.mlplatform.org/c/ml/ComputeLibrary/+/9794 Benchmark: Arm Jenkins <bsgcomp@arm.com> Tested-by: Arm Jenkins <bsgcomp@arm.com> Reviewed-by: Viet-Hoa Do <viet-hoa.do@arm.com>
2023-05-24Prepare the basic types for the compute kernel writer (CKW)Gian Marco Iodice
- Add TensorInfo - Add TileInfo - Add CLTile - Add basic utility methods to get tensor components - Add unit tests Resolves COMPMID-5782, COMPMID-5785 Signed-off-by: Gian Marco Iodice <gianmarco.iodice@arm.com> Change-Id: I5e590bddd240d2f1fc876cac7129947558d7d53b Reviewed-on: https://eu-gerrit-1.euhpc.arm.com/c/VisualCompute/ComputeLibrary/+/486221 Tested-by: bsgcomp <bsgcomp@arm.com> Reviewed-by: Jakub Sujak <jakub.sujak@arm.com> Reviewed-by: Pablo Tello <pablo.tello@arm.com> Comments-Addressed: bsgcomp <bsgcomp@arm.com> Reviewed-on: https://review.mlplatform.org/c/ml/ComputeLibrary/+/9687 Reviewed-by: Viet-Hoa Do <viet-hoa.do@arm.com> Reviewed-by: Pablo Marquez Tello <pablo.tello@arm.com> Comments-Addressed: Arm Jenkins <bsgcomp@arm.com> Tested-by: Arm Jenkins <bsgcomp@arm.com> Benchmark: Arm Jenkins <bsgcomp@arm.com>