From 14c86a9246202c0c928c03cf6886dde134fba525 Mon Sep 17 00:00:00 2001 From: Anthony Barbier Date: Thu, 14 Dec 2017 16:27:41 +0000 Subject: COMPMID-557 Added some GLES documentation and rework following OOB testing Change-Id: I56333ed23d30c5ec3094f64b78a023589064fe06 Reviewed-on: https://eu-gerrit-1.euhpc.arm.com/113375 Tested-by: BSG Visual Compute Jenkins server to access repositories on http://mpd-gerrit.cambridge.arm.com Reviewed-by: Jim He Reviewed-by: Anthony Barbier --- docs/00_introduction.dox | 107 ++++++++++++++++++++++++++++++++++------------- docs/01_library.dox | 2 +- 2 files changed, 79 insertions(+), 30 deletions(-) (limited to 'docs') diff --git a/docs/00_introduction.dox b/docs/00_introduction.dox index 9740f05ec8..4c6b8f38db 100644 --- a/docs/00_introduction.dox +++ b/docs/00_introduction.dox @@ -19,6 +19,18 @@ In order to facilitate the work of the support team please provide the build inf $ strings android-armv7a-cl-asserts/libarm_compute.so | grep arm_compute_version arm_compute_version=v16.12 Build options: {'embed_kernels': '1', 'opencl': '1', 'arch': 'armv7a', 'neon': '0', 'asserts': '1', 'debug': '0', 'os': 'android', 'Werror': '1'} Git hash=f51a545d4ea12a9059fe4e598a092f1fd06dc858 +@section S0_2_prebuilt_binaries Pre-built binaries + +For each release we provide some pre-built binaries of the library [here](https://github.com/ARM-software/ComputeLibrary/releases) + +These binaries have been built using the following toolchains: + - Linux armv7a: gcc-linaro-arm-linux-gnueabihf-4.9-2014.07_linux + - Linux arm64-v8a: gcc-linaro-4.9-2016.02-x86_64_aarch64-linux-gnu + - Android armv7a: clang++ / gnustl NDK r14 + - Android am64-v8a: clang++ / gnustl NDK r14 + +@warning Make sure to use a compatible toolchain to build your application or you will get some std::bad_alloc errors at runtime. + @section S1_file_organisation File organisation This archive contains: @@ -102,6 +114,7 @@ You should have the following file organisation: ├── documentation.xhtml -> documentation/index.xhtml ├── examples │   ├── cl_*.cpp --> OpenCL examples + │   ├── gc_*.cpp --> GLES compute shaders examples │   ├── graph_*.cpp --> Graph examples │   ├── neoncl_*.cpp --> NEON / OpenCL interoperability examples │   └── neon_*.cpp --> NEON examples @@ -109,16 +122,14 @@ You should have the following file organisation: │   ├── CL │   │ └── Khronos OpenCL C headers and C++ wrapper │   ├── half --> FP16 library available from http://half.sourceforge.net - │  └── libnpy --> Library to load / write npy buffers, available from https://github.com/llohse/libnpy + │   ├── libnpy --> Library to load / write npy buffers, available from https://github.com/llohse/libnpy + │  └── linux --> Headers only needed for Linux builds + │   └── Khronos EGL and OpenGLES headers ├── opencl-1.2-stubs - │ └── opencl_stubs.c - ├── opengles-3.1 - │ ├── include - │   │ └── Khronos EGL and GLES C headers - │ ├── mali_include - │   │ └── EGL - │   │ └── fbdev_windows.h - │   └── stubs + │ └── opencl_stubs.c --> OpenCL stubs implementation + ├── opengles-3.1-stubs + │   ├── EGL.c --> EGL stubs implementation + │   └── GLESv2.c --> GLESv2 stubs implementation ├── scripts │   ├── caffe_data_extractor.py --> Basic script to export weights from Caffe to npy files │   └── tensorflow_data_extractor.py --> Basic script to export weights from Tensor Flow to npy files @@ -594,15 +605,23 @@ To cross compile an OpenCL example for Linux 64bit: aarch64-linux-gnu-g++ examples/cl_convolution.cpp utils/Utils.cpp -I. -Iinclude -std=c++11 -L. -larm_compute -larm_compute_core -lOpenCL -o cl_convolution -DARM_COMPUTE_CL +To cross compile a GLES example for Linux 32bit: + + arm-linux-gnueabihf-g++ examples/gc_absdiff.cpp utils/Utils.cpp -I. -Iinclude/ -L. -larm_compute -larm_compute_core -std=c++11 -mfpu=neon -DARM_COMPUTE_GC -Iinclude/linux/ -o gc_absdiff + +To cross compile a GLES example for Linux 64bit: + + aarch64-linux-gnu-g++ examples/gc_absdiff.cpp utils/Utils.cpp -I. -Iinclude/ -L. -larm_compute -larm_compute_core -std=c++11 -DARM_COMPUTE_GC -Iinclude/linux/ -o gc_absdiff + (notice the only difference with the 32 bit command is that we don't need the -mfpu option and the compiler's name is different) -To cross compile the examples with the Graph API, such as graph_lenet.cpp, you need to link the library arm_compute_graph.so also. -(notice the compute library has to be built with both neon and opencl enabled - neon=1 and opencl=1) +To cross compile the examples with the Graph API, such as graph_lenet.cpp, you need to link the examples against arm_compute_graph.so too. + +@note The compute library must currently be built with both neon and opencl enabled - neon=1 and opencl=1 i.e. to cross compile the "graph_lenet" example for Linux 32bit: - arm-linux-gnueabihf-g++ examples/graph_lenet.cpp utils/Utils.cpp utils/GraphUtils.cpp -I. -Iinclude -std=c++11 -mfpu=neon -L. -larm_compute_graph -larm_compute -larm_compute_core -Wl,--allow-shlib-undefined - -o graph_lenet + arm-linux-gnueabihf-g++ examples/graph_lenet.cpp utils/Utils.cpp utils/GraphUtils.cpp -I. -Iinclude -std=c++11 -mfpu=neon -L. -larm_compute_graph -larm_compute -larm_compute_core -Wl,--allow-shlib-undefined -o graph_lenet i.e. to cross compile the "graph_lenet" example for Linux 64bit: @@ -626,14 +645,18 @@ To compile natively (i.e directly on an ARM device) for OpenCL for Linux 32bit o g++ examples/cl_convolution.cpp utils/Utils.cpp -I. -Iinclude -std=c++11 -larm_compute -larm_compute_core -lOpenCL -o cl_convolution -DARM_COMPUTE_CL -To compile natively (i.e directly on an ARM device) the examples with the Graph API, such as graph_lenet.cpp, you need to link the library arm_compute_graph.so also. -(notice the compute library has to be built with both neon and opencl enabled - neon=1 and opencl=1) +To compile natively (i.e directly on an ARM device) for GLES for Linux 32bit or Linux 64bit: -i.e. to cross compile the "graph_lenet" example for Linux 32bit: + g++ examples/gc_absdiff.cpp utils/Utils.cpp -I. -Iinclude/ -L. -larm_compute -larm_compute_core -std=c++11 -DARM_COMPUTE_GC -Iinclude/linux/ -o gc_absdiff + +To compile natively the examples with the Graph API, such as graph_lenet.cpp, you need to link the examples against arm_compute_graph.so too. +@note The compute library must currently be built with both neon and opencl enabled - neon=1 and opencl=1 + +i.e. to natively compile the "graph_lenet" example for Linux 32bit: g++ examples/graph_lenet.cpp utils/Utils.cpp utils/GraphUtils.cpp -I. -Iinclude -std=c++11 -mfpu=neon -L. -larm_compute_graph -larm_compute -larm_compute_core -Wl,--allow-shlib-undefined -o graph_lenet -i.e. to cross compile the "graph_lenet" example for Linux 64bit: +i.e. to natively compile the "graph_lenet" example for Linux 64bit: g++ examples/graph_lenet.cpp utils/Utils.cpp utils/GraphUtils.cpp -I. -Iinclude -std=c++11 L. -larm_compute_graph -larm_compute -larm_compute_core -Wl,--allow-shlib-undefined -o graph_lenet @@ -651,13 +674,11 @@ or LD_LIBRARY_PATH=build ./cl_convolution -@note If you built the library with support for both OpenCL and NEON you will need to link against OpenCL even if your application only uses NEON. - @subsection S3_3_android Building for Android For Android, the library was successfully built and tested using Google's standalone toolchains: - - arm-linux-androideabi-4.9 for armv7a (clang++) - - aarch64-linux-android-4.9 for arm64-v8a (g++) + - NDK r14 arm-linux-androideabi-4.9 for armv7a (clang++) + - NDK r14 aarch64-linux-android-4.9 for arm64-v8a (clang++) Here is a guide to create your Android standalone toolchains from the NDK @@ -669,7 +690,7 @@ Here is a guide to