xref: /aosp_15_r20/external/ComputeLibrary/cmake/Options.cmake (revision c217d954acce2dbc11938adb493fc0abd69584f3)
1*c217d954SCole Faust# Copyright (c) 2023 Arm Limited.
2*c217d954SCole Faust#
3*c217d954SCole Faust# SPDX-License-Identifier: MIT
4*c217d954SCole Faust#
5*c217d954SCole Faust# Permission is hereby granted, free of charge, to any person obtaining a copy
6*c217d954SCole Faust# of this software and associated documentation files (the "Software"), to
7*c217d954SCole Faust# deal in the Software without restriction, including without limitation the
8*c217d954SCole Faust# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
9*c217d954SCole Faust# sell copies of the Software, and to permit persons to whom the Software is
10*c217d954SCole Faust# furnished to do so, subject to the following conditions:
11*c217d954SCole Faust#
12*c217d954SCole Faust# The above copyright notice and this permission notice shall be included in all
13*c217d954SCole Faust# copies or substantial portions of the Software.
14*c217d954SCole Faust#
15*c217d954SCole Faust# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16*c217d954SCole Faust# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17*c217d954SCole Faust# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18*c217d954SCole Faust# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19*c217d954SCole Faust# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20*c217d954SCole Faust# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21*c217d954SCole Faust# SOFTWARE.
22*c217d954SCole Faust
23*c217d954SCole Faustinclude(CMakeDependentOption)
24*c217d954SCole Faust
25*c217d954SCole Faust# ---------------------------------------------------------------------
26*c217d954SCole Faust
27*c217d954SCole Faustoption(BUILD_SHARED_LIBS "Build shared libraries" ON)
28*c217d954SCole Faust
29*c217d954SCole Faustoption(DEBUG "Enable ['-O0','-g','-gdwarf-2'] compilation flags" OFF)
30*c217d954SCole Faustoption(WERROR "Enable the -Werror compilation flag" OFF)
31*c217d954SCole Faustoption(EXCEPTIONS "Enable C++ exception support" ON)
32*c217d954SCole Faustoption(LOGGING "Enable logging" OFF)
33*c217d954SCole Faust
34*c217d954SCole Faustoption(GEMM_TUNER "Build gemm_tuner programs" OFF) # Not used atm
35*c217d954SCole Faustoption(BUILD_EXAMPLES "Build example programs" OFF)
36*c217d954SCole Faust
37*c217d954SCole Faustoption(BUILD_TESTING "Build tests" OFF)
38*c217d954SCole Faustoption(CPPTHREADS "Enable C++11 threads backend" OFF)
39*c217d954SCole Faustoption(OPENMP "Enable OpenMP backend" ON)
40*c217d954SCole Faust
41*c217d954SCole Faust#
42*c217d954SCole Faustif(CPPTHREADS)
43*c217d954SCole Faust  add_definitions(-DARM_COMPUTE_CPP_SCHEDULER)
44*c217d954SCole Faustendif()
45*c217d954SCole Faust#
46*c217d954SCole Faustif(LOGGING)
47*c217d954SCole Faust  add_definitions(-DARM_COMPUTE_LOGGING_ENABLED)
48*c217d954SCole Faustendif()
49*c217d954SCole Faust
50*c217d954SCole Faust# ---------------------------------------------------------------------
51*c217d954SCole Faust# Backends
52*c217d954SCole Faust
53*c217d954SCole Faustoption(ENABLE_NEON "Enable Arm® Neon™ support" ON)
54*c217d954SCole Faustoption(ARM_COMPUTE_CPU_ENABLED "" ON)
55*c217d954SCole Faustoption(ARM_COMPUTE_ENABLE_NEON "" ON)
56*c217d954SCole Faustoption(ARM_COMPUTE_ENABLE_FP16 "" ON)
57*c217d954SCole Faustoption(ARM_COMPUTE_ENABLE_I8MM "" ON)
58*c217d954SCole Faustoption(ENABLE_FP16_KERNELS "" ON)
59*c217d954SCole Faustoption(ENABLE_FP32_KERNELS "" ON)
60*c217d954SCole Faustoption(ENABLE_QASYMM8_KERNELS "" ON)
61*c217d954SCole Faustoption(ENABLE_QASYMM8_SIGNED_KERNELS "" ON)
62*c217d954SCole Faustoption(ENABLE_QSYMM16_KERNELS "" ON)
63*c217d954SCole Faustoption(ENABLE_INTEGER_KERNELS "" ON)
64*c217d954SCole Faustoption(ENABLE_NHWC_KERNELS "" ON)
65*c217d954SCole Faustoption(ENABLE_NCHW_KERNELS "" ON)
66*c217d954SCole Faustoption(ARM_COMPUTE_GRAPH_ENABLED "" ON)
67*c217d954SCole Faustoption(ARM_COMPUTE_ENABLE_SVEF32MM "" ON)
68*c217d954SCole Faustoption(ARM_COMPUTE_ENABLE_FIXED_FORMAT_KERNELS "" ON)
69*c217d954SCole Faustoption(ENABLE_SVE "" ON)
70*c217d954SCole Faustoption(ARM_COMPUTE_ENABLE_SVE "" ON)
71*c217d954SCole Faustoption(ENABLE_BF16_VALIDATION "" OFF)
72*c217d954SCole Faust
73*c217d954SCole Faustif(ENABLE_NEON)
74*c217d954SCole Faust  add_definitions(-DENABLE_NEON)
75*c217d954SCole Faustendif()
76*c217d954SCole Faustif(ARM_COMPUTE_CPU_ENABLED)
77*c217d954SCole Faust  add_definitions(-DARM_COMPUTE_CPU_ENABLED)
78*c217d954SCole Faustendif()
79*c217d954SCole Faustif(ARM_COMPUTE_ENABLE_NEON)
80*c217d954SCole Faust  add_definitions(-DARM_COMPUTE_ENABLE_NEON)
81*c217d954SCole Faustendif()
82*c217d954SCole Faustif(ARM_COMPUTE_ENABLE_FP16)
83*c217d954SCole Faust  add_definitions(-DARM_COMPUTE_ENABLE_FP16)
84*c217d954SCole Faustendif()
85*c217d954SCole Faustif(ARM_COMPUTE_ENABLE_I8MM)
86*c217d954SCole Faust  add_definitions(-DARM_COMPUTE_ENABLE_I8MM)
87*c217d954SCole Faustendif()
88*c217d954SCole Faustif(ENABLE_FP16_KERNELS)
89*c217d954SCole Faust  add_definitions(-DENABLE_FP16_KERNELS)
90*c217d954SCole Faustendif()
91*c217d954SCole Faustif(ENABLE_FP32_KERNELS)
92*c217d954SCole Faust  add_definitions(-DENABLE_FP32_KERNELS)
93*c217d954SCole Faustendif()
94*c217d954SCole Faustif(ENABLE_QASYMM8_KERNELS)
95*c217d954SCole Faust  add_definitions(-DENABLE_QASYMM8_KERNELS)
96*c217d954SCole Faustendif()
97*c217d954SCole Faustif(ENABLE_QASYMM8_SIGNED_KERNELS)
98*c217d954SCole Faust  add_definitions(-DENABLE_QASYMM8_SIGNED_KERNELS)
99*c217d954SCole Faustendif()
100*c217d954SCole Faustif(ENABLE_QSYMM16_KERNELS)
101*c217d954SCole Faust  add_definitions(-DENABLE_QSYMM16_KERNELS)
102*c217d954SCole Faustendif()
103*c217d954SCole Faustif(ENABLE_INTEGER_KERNELS)
104*c217d954SCole Faust  add_definitions(-DENABLE_INTEGER_KERNELS)
105*c217d954SCole Faustendif()
106*c217d954SCole Faustif(ENABLE_NHWC_KERNELS)
107*c217d954SCole Faust  add_definitions(-DENABLE_NHWC_KERNELS)
108*c217d954SCole Faustendif()
109*c217d954SCole Faustif(ENABLE_NCHW_KERNELS)
110*c217d954SCole Faust  add_definitions(-DENABLE_NCHW_KERNELS)
111*c217d954SCole Faustendif()
112*c217d954SCole Faustif(ARM_COMPUTE_GRAPH_ENABLED)
113*c217d954SCole Faust  add_definitions(-DARM_COMPUTE_GRAPH_ENABLED)
114*c217d954SCole Faustendif()
115*c217d954SCole Faustif(ARM_COMPUTE_ENABLE_BF16)
116*c217d954SCole Faust  add_definitions(-DARM_COMPUTE_ENABLE_BF16)
117*c217d954SCole Faustendif()
118*c217d954SCole Faustif(ARM_COMPUTE_ENABLE_SVEF32MM)
119*c217d954SCole Faust  add_definitions(-DARM_COMPUTE_ENABLE_SVEF32MM)
120*c217d954SCole Faustendif()
121*c217d954SCole Faustif(ARM_COMPUTE_ENABLE_FIXED_FORMAT_KERNELS)
122*c217d954SCole Faust  add_definitions(-DARM_COMPUTE_ENABLE_FIXED_FORMAT_KERNELS)
123*c217d954SCole Faustendif()
124*c217d954SCole Faustif(ENABLE_SVE)
125*c217d954SCole Faust  add_definitions(-DENABLE_SVE)
126*c217d954SCole Faustendif()
127*c217d954SCole Faustif(ARM_COMPUTE_ENABLE_SVE)
128*c217d954SCole Faust  add_definitions(-DARM_COMPUTE_ENABLE_SVE)
129*c217d954SCole Faustendif()
130*c217d954SCole Faustadd_definitions(-D_GLIBCXX_USE_NANOSLEEP)