blob: 2e351fde7d46d4ee5267247fce5cae7b5ca4dcd9 [file] [log] [blame]
Renato Arantes36a75da2024-01-26 17:31:18 +00001# Copyright (c) 2023-2024 Arm Limited.
David Svantessone0c42ef2022-12-15 16:25:57 +00002#
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
David Svantesson90d15b92023-06-08 10:05:59 +000046set(ARM_COMPUTE_ARCH armv8-a CACHE STRING "Architecture to use")
47
David Svantessone0c42ef2022-12-15 16:25:57 +000048# ---------------------------------------------------------------------
49# Backends
50
Renato Arantes36a75da2024-01-26 17:31:18 +000051option(ARM_COMPUTE_ENABLE_BF16_VALIDATION "" ON)
David Svantessonb5d6c282023-04-24 16:47:04 +000052option(ARM_COMPUTE_ENABLE_SVE_VALIDATION "" OFF)
53
David Svantessone0c42ef2022-12-15 16:25:57 +000054option(ENABLE_NEON "Enable Arm® Neon™ support" ON)
55option(ARM_COMPUTE_CPU_ENABLED "" ON)
56option(ARM_COMPUTE_ENABLE_NEON "" ON)
David Svantessone0c42ef2022-12-15 16:25:57 +000057option(ARM_COMPUTE_ENABLE_I8MM "" ON)
David Svantessone0c42ef2022-12-15 16:25:57 +000058option(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)
David Svantesson90d15b92023-06-08 10:05:59 +000068option(ENABLE_FP16_KERNELS "" OFF)
69option(ARM_COMPUTE_ENABLE_FP16 "" OFF)
David Svantessone0c42ef2022-12-15 16:25:57 +000070
David Svantessone0c42ef2022-12-15 16:25:57 +000071if(ENABLE_NEON)
72 add_definitions(-DENABLE_NEON)
73endif()
74if(ARM_COMPUTE_CPU_ENABLED)
75 add_definitions(-DARM_COMPUTE_CPU_ENABLED)
76endif()
77if(ARM_COMPUTE_ENABLE_NEON)
78 add_definitions(-DARM_COMPUTE_ENABLE_NEON)
79endif()
80if(ARM_COMPUTE_ENABLE_FP16)
81 add_definitions(-DARM_COMPUTE_ENABLE_FP16)
82endif()
83if(ARM_COMPUTE_ENABLE_I8MM)
84 add_definitions(-DARM_COMPUTE_ENABLE_I8MM)
85endif()
86if(ENABLE_FP16_KERNELS)
87 add_definitions(-DENABLE_FP16_KERNELS)
88endif()
89if(ENABLE_FP32_KERNELS)
90 add_definitions(-DENABLE_FP32_KERNELS)
91endif()
92if(ENABLE_QASYMM8_KERNELS)
93 add_definitions(-DENABLE_QASYMM8_KERNELS)
94endif()
95if(ENABLE_QASYMM8_SIGNED_KERNELS)
96 add_definitions(-DENABLE_QASYMM8_SIGNED_KERNELS)
97endif()
98if(ENABLE_QSYMM16_KERNELS)
99 add_definitions(-DENABLE_QSYMM16_KERNELS)
100endif()
101if(ENABLE_INTEGER_KERNELS)
102 add_definitions(-DENABLE_INTEGER_KERNELS)
103endif()
104if(ENABLE_NHWC_KERNELS)
105 add_definitions(-DENABLE_NHWC_KERNELS)
106endif()
107if(ENABLE_NCHW_KERNELS)
108 add_definitions(-DENABLE_NCHW_KERNELS)
109endif()
110if(ARM_COMPUTE_GRAPH_ENABLED)
111 add_definitions(-DARM_COMPUTE_GRAPH_ENABLED)
112endif()
David Svantessone0c42ef2022-12-15 16:25:57 +0000113if(ARM_COMPUTE_ENABLE_SVEF32MM)
114 add_definitions(-DARM_COMPUTE_ENABLE_SVEF32MM)
115endif()
116if(ARM_COMPUTE_ENABLE_FIXED_FORMAT_KERNELS)
117 add_definitions(-DARM_COMPUTE_ENABLE_FIXED_FORMAT_KERNELS)
118endif()
David Svantessonded5b182023-08-02 14:23:00 +0000119add_definitions(-D_GLIBCXX_USE_NANOSLEEP)