blob: a4ef135bdfc1eb0c16b60dc404d84f1e6bbcaebb [file] [log] [blame]
David Svantessone0c42ef2022-12-15 16:25:57 +00001# Copyright (c) 2023 Arm Limited.
2#
3# SPDX-License-Identifier: MIT
4#
5# Permission is hereby granted, free of charge, to any person obtaining a copy
6# of this software and associated documentation files (the "Software"), to
7# deal in the Software without restriction, including without limitation the
8# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
9# sell copies of the Software, and to permit persons to whom the Software is
10# furnished to do so, subject to the following conditions:
11#
12# The above copyright notice and this permission notice shall be included in all
13# copies or substantial portions of the Software.
14#
15# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21# SOFTWARE.
22
23include(CMakeDependentOption)
24
25# ---------------------------------------------------------------------
26
27option(BUILD_SHARED_LIBS "Build shared libraries" ON)
28
David Svantessonb5d6c282023-04-24 16:47:04 +000029option(ARM_COMPUTE_WERROR "Enable the -Werror compilation flag" OFF)
30option(ARM_COMPUTE_EXCEPTIONS "Enable C++ exception support" ON)
31option(ARM_COMPUTE_LOGGING "Enable logging" OFF)
32option(ARM_COMPUTE_BUILD_EXAMPLES "Build example programs" OFF)
33option(ARM_COMPUTE_BUILD_TESTING "Build tests" OFF)
34option(ARM_COMPUTE_CPPTHREADS "Enable C++11 threads backend" OFF)
35option(ARM_COMPUTE_OPENMP "Enable OpenMP backend" ON)
David Svantessone0c42ef2022-12-15 16:25:57 +000036
37#
David Svantessonb5d6c282023-04-24 16:47:04 +000038if(ARM_COMPUTE_CPPTHREADS)
David Svantessone0c42ef2022-12-15 16:25:57 +000039 add_definitions(-DARM_COMPUTE_CPP_SCHEDULER)
40endif()
41#
David Svantessonb5d6c282023-04-24 16:47:04 +000042if(ARM_COMPUTE_LOGGING)
David Svantessone0c42ef2022-12-15 16:25:57 +000043 add_definitions(-DARM_COMPUTE_LOGGING_ENABLED)
44endif()
45
46# ---------------------------------------------------------------------
47# Backends
48
David Svantessonb5d6c282023-04-24 16:47:04 +000049option(ARM_COMPUTE_ENABLE_BF16_VALIDATION "" OFF)
50option(ARM_COMPUTE_ENABLE_SVE_VALIDATION "" OFF)
51
David Svantessone0c42ef2022-12-15 16:25:57 +000052option(ENABLE_NEON "Enable Arm® Neon™ support" ON)
53option(ARM_COMPUTE_CPU_ENABLED "" ON)
54option(ARM_COMPUTE_ENABLE_NEON "" ON)
55option(ARM_COMPUTE_ENABLE_FP16 "" ON)
56option(ARM_COMPUTE_ENABLE_I8MM "" ON)
57option(ENABLE_FP16_KERNELS "" ON)
58option(ENABLE_FP32_KERNELS "" ON)
59option(ENABLE_QASYMM8_KERNELS "" ON)
60option(ENABLE_QASYMM8_SIGNED_KERNELS "" ON)
61option(ENABLE_QSYMM16_KERNELS "" ON)
62option(ENABLE_INTEGER_KERNELS "" ON)
63option(ENABLE_NHWC_KERNELS "" ON)
64option(ENABLE_NCHW_KERNELS "" ON)
65option(ARM_COMPUTE_GRAPH_ENABLED "" ON)
David Svantessone0c42ef2022-12-15 16:25:57 +000066option(ARM_COMPUTE_ENABLE_SVEF32MM "" ON)
67option(ARM_COMPUTE_ENABLE_FIXED_FORMAT_KERNELS "" ON)
68
David Svantessone0c42ef2022-12-15 16:25:57 +000069if(ENABLE_NEON)
70 add_definitions(-DENABLE_NEON)
71endif()
72if(ARM_COMPUTE_CPU_ENABLED)
73 add_definitions(-DARM_COMPUTE_CPU_ENABLED)
74endif()
75if(ARM_COMPUTE_ENABLE_NEON)
76 add_definitions(-DARM_COMPUTE_ENABLE_NEON)
77endif()
78if(ARM_COMPUTE_ENABLE_FP16)
79 add_definitions(-DARM_COMPUTE_ENABLE_FP16)
80endif()
81if(ARM_COMPUTE_ENABLE_I8MM)
82 add_definitions(-DARM_COMPUTE_ENABLE_I8MM)
83endif()
84if(ENABLE_FP16_KERNELS)
85 add_definitions(-DENABLE_FP16_KERNELS)
86endif()
87if(ENABLE_FP32_KERNELS)
88 add_definitions(-DENABLE_FP32_KERNELS)
89endif()
90if(ENABLE_QASYMM8_KERNELS)
91 add_definitions(-DENABLE_QASYMM8_KERNELS)
92endif()
93if(ENABLE_QASYMM8_SIGNED_KERNELS)
94 add_definitions(-DENABLE_QASYMM8_SIGNED_KERNELS)
95endif()
96if(ENABLE_QSYMM16_KERNELS)
97 add_definitions(-DENABLE_QSYMM16_KERNELS)
98endif()
99if(ENABLE_INTEGER_KERNELS)
100 add_definitions(-DENABLE_INTEGER_KERNELS)
101endif()
102if(ENABLE_NHWC_KERNELS)
103 add_definitions(-DENABLE_NHWC_KERNELS)
104endif()
105if(ENABLE_NCHW_KERNELS)
106 add_definitions(-DENABLE_NCHW_KERNELS)
107endif()
108if(ARM_COMPUTE_GRAPH_ENABLED)
109 add_definitions(-DARM_COMPUTE_GRAPH_ENABLED)
110endif()
David Svantessone0c42ef2022-12-15 16:25:57 +0000111if(ARM_COMPUTE_ENABLE_SVEF32MM)
112 add_definitions(-DARM_COMPUTE_ENABLE_SVEF32MM)
113endif()
114if(ARM_COMPUTE_ENABLE_FIXED_FORMAT_KERNELS)
115 add_definitions(-DARM_COMPUTE_ENABLE_FIXED_FORMAT_KERNELS)
116endif()
David Svantesson45370892023-02-22 11:08:57 +0000117add_definitions(-D_GLIBCXX_USE_NANOSLEEP)