Build the Compute Library

The Compute Library is a machine learning library that provides a set of functions that are optimized for both Arm CPUs and GPUs. The Compute Library is used directly by Arm NN to optimize the running of machine learning workloads on Arm CPUs and GPUs.

To build the Compute Library on your platform or board,  open a terminal or bash screen, go to the Compute Library directory, and follow the instructions below.

For example:

$ cd $BASEDIR/ComputeLibrary

Compile the Compute Library using SCons. To do this, change your directory to the Compute Library git repository on your machine, and enter for Arm7-A:

$ scons extra_cxx_flags="-fPIC" benchmark_tests=0 validation_tests=0

Enter for Armv8-A:

$ scons arch=arm64-v8a extra_cxx_flags="-fPIC" benchmark_tests=0 validation_tests=0

Duration: About 15-20 minutes.

If you want to enable benchmark tests, set benchmark_tests to 1. If you want to enable validation tests, set validation_tests to 1.

You can enable support for Neon on the CPU, and support for OpenCL on an Arm Mali GPU if you have one.

If you want to support OpenCL for your Arm Mali GPU, add these arguments to the SCons command:

opencl=1 embed_kernels=1

If you want to support Neon, add this argument to your SCons command:

Previous Next