diff options
author | David Svantesson <david.svantesson@arm.com> | 2022-12-15 16:25:57 +0000 |
---|---|---|
committer | David Svantesson <david.svantesson@arm.com> | 2023-01-31 14:57:06 +0000 |
commit | e0c42ef651709fd284da3bedd2c98d420bd6fd1a (patch) | |
tree | 6c154adf5937946b85fd46a30e3b3ce4c3ea5717 /cmake/Options.cmake | |
parent | 54eafd86fdeb19f2117271805a01da4395f9ef16 (diff) | |
download | ComputeLibrary-e0c42ef651709fd284da3bedd2c98d420bd6fd1a.tar.gz |
Bazel and CMake builds
Resolves: ONCPUML-1110, ONCPUML-1109
Co-authored-by: Georgios Pinitas <georgios.pinitas@arm.com>
Co-authored-by: Joe Ramsay <joe.ramsay@arm.com>
Signed-off-by: David Svantesson <david.svantesson@arm.com>
Change-Id: Iea693dbe53bf0af87867d6a9e0d1fd9fbe59ef3a
Reviewed-on: https://review.mlplatform.org/c/ml/ComputeLibrary/+/8981
Benchmark: Arm Jenkins <bsgcomp@arm.com>
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>
Diffstat (limited to 'cmake/Options.cmake')
-rw-r--r-- | cmake/Options.cmake | 123 |
1 files changed, 123 insertions, 0 deletions
diff --git a/cmake/Options.cmake b/cmake/Options.cmake new file mode 100644 index 0000000000..20cf0e42c8 --- /dev/null +++ b/cmake/Options.cmake @@ -0,0 +1,123 @@ +# Copyright (c) 2023 Arm Limited. +# +# SPDX-License-Identifier: MIT +# +# Permission is hereby granted, free of charge, to any person obtaining a copy +# of this software and associated documentation files (the "Software"), to +# deal in the Software without restriction, including without limitation the +# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +# sell copies of the Software, and to permit persons to whom the Software is +# furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in all +# copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. + +include(CMakeDependentOption) + +# --------------------------------------------------------------------- + +option(BUILD_SHARED_LIBS "Build shared libraries" ON) + +option(DEBUG "Enable ['-O0','-g','-gdwarf-2'] compilation flags" OFF) +option(WERROR "Enable the -Werror compilation flag" OFF) +option(EXCEPTIONS "Enable C++ exception support" ON) +option(LOGGING "Enable logging" OFF) + +option(GEMM_TUNER "Build gemm_tuner programs" OFF) # Not used atm +option(BUILD_EXAMPLES "Build example programs" OFF) + +option(BUILD_TESTING "Build tests" OFF) +option(CPPTHREADS "Enable C++11 threads backend" OFF) +option(OPENMP "Enable OpenMP backend" ON) + +# +if(CPPTHREADS) + add_definitions(-DARM_COMPUTE_CPP_SCHEDULER) +endif() +# +if(LOGGING) + add_definitions(-DARM_COMPUTE_LOGGING_ENABLED) +endif() + +# --------------------------------------------------------------------- +# Backends + +# TODO Add help string for each setting (Should user be able to ) +option(ENABLE_NEON "Enable Arm® Neon™ support" ON) +option(ARM_COMPUTE_CPU_ENABLED "" ON) +option(ARM_COMPUTE_ENABLE_NEON "" ON) +option(ARM_COMPUTE_ENABLE_FP16 "" ON) +option(ARM_COMPUTE_ENABLE_I8MM "" ON) +option(ENABLE_FP16_KERNELS "" ON) +option(ENABLE_FP32_KERNELS "" ON) +option(ENABLE_QASYMM8_KERNELS "" ON) +option(ENABLE_QASYMM8_SIGNED_KERNELS "" ON) +option(ENABLE_QSYMM16_KERNELS "" ON) +option(ENABLE_INTEGER_KERNELS "" ON) +option(ENABLE_NHWC_KERNELS "" ON) +option(ENABLE_NCHW_KERNELS "" ON) +option(ARM_COMPUTE_GRAPH_ENABLED "" ON) +option(ARM_COMPUTE_ENABLE_BF16 "" ON) +option(ARM_COMPUTE_ENABLE_SVEF32MM "" ON) +option(ARM_COMPUTE_ENABLE_FIXED_FORMAT_KERNELS "" ON) + +# TODO Check if this is required +if(ENABLE_NEON) + add_definitions(-DENABLE_NEON) +endif() +if(ARM_COMPUTE_CPU_ENABLED) + add_definitions(-DARM_COMPUTE_CPU_ENABLED) +endif() +if(ARM_COMPUTE_ENABLE_NEON) + add_definitions(-DARM_COMPUTE_ENABLE_NEON) +endif() +if(ARM_COMPUTE_ENABLE_FP16) + add_definitions(-DARM_COMPUTE_ENABLE_FP16) +endif() +if(ARM_COMPUTE_ENABLE_I8MM) + add_definitions(-DARM_COMPUTE_ENABLE_I8MM) +endif() +if(ENABLE_FP16_KERNELS) + add_definitions(-DENABLE_FP16_KERNELS) +endif() +if(ENABLE_FP32_KERNELS) + add_definitions(-DENABLE_FP32_KERNELS) +endif() +if(ENABLE_QASYMM8_KERNELS) + add_definitions(-DENABLE_QASYMM8_KERNELS) +endif() +if(ENABLE_QASYMM8_SIGNED_KERNELS) + add_definitions(-DENABLE_QASYMM8_SIGNED_KERNELS) +endif() +if(ENABLE_QSYMM16_KERNELS) + add_definitions(-DENABLE_QSYMM16_KERNELS) +endif() +if(ENABLE_INTEGER_KERNELS) + add_definitions(-DENABLE_INTEGER_KERNELS) +endif() +if(ENABLE_NHWC_KERNELS) + add_definitions(-DENABLE_NHWC_KERNELS) +endif() +if(ENABLE_NCHW_KERNELS) + add_definitions(-DENABLE_NCHW_KERNELS) +endif() +if(ARM_COMPUTE_GRAPH_ENABLED) + add_definitions(-DARM_COMPUTE_GRAPH_ENABLED) +endif() +if(ARM_COMPUTE_ENABLE_BF16) + add_definitions(-DARM_COMPUTE_ENABLE_BF16) +endif() +if(ARM_COMPUTE_ENABLE_SVEF32MM) + add_definitions(-DARM_COMPUTE_ENABLE_SVEF32MM) +endif() +if(ARM_COMPUTE_ENABLE_FIXED_FORMAT_KERNELS) + add_definitions(-DARM_COMPUTE_ENABLE_FIXED_FORMAT_KERNELS) +endif() |