Compress OpenCL kernel files using zlib for Android
authorGeorgios Pinitas <georgios.pinitas@arm.com>
Fri, 22 Jan 2021 05:47:37 +0000 (05:47 +0000)
committerGeorgios Pinitas <georgios.pinitas@arm.com>
Mon, 1 Feb 2021 16:51:44 +0000 (16:51 +0000)
commitea857273d8b4a94fb7f1e63ce9068a60259fb9d3
treee4d7a90f28d4ba4d218e77343c107afa137d7cec
parent655e8c6334580a570008243af1896d269fdd60ad
Compress OpenCL kernel files using zlib for Android

Kernel files are embedded into the binary as the default option when
building which leads to binary size bloating.

Add `compress_kernels` option and utilize zlib for further compressing
the text kernel files and reduce the overall binary size. We use a
base64 encoding/decoding to ensure that the strings can be easily
embedded. This adds to the binary size but still the overall reduction
is significant.
Maximum compression level 9 is used.

Option is currently restricted to Android builds as android toolchain
provides a zlib library.

Initial experimentations indicate a binary size reduction of 50%

Resolves: COMPMID-4017

Signed-off-by: Georgios Pinitas <georgios.pinitas@arm.com>
Change-Id: Iee81b8c00391b26a5f41642699692928a4d6bd6e
Reviewed-on: https://review.mlplatform.org/c/ml/ComputeLibrary/+/4958
Comments-Addressed: Arm Jenkins <bsgcomp@arm.com>
Tested-by: Arm Jenkins <bsgcomp@arm.com>
Reviewed-by: Gian Marco Iodice <gianmarco.iodice@arm.com>
SConscript
SConstruct
arm_compute/core/CL/CLKernelLibrary.h
docs/00_introduction.dox
src/core/CL/CLKernelLibrary.cpp