David Svantesson | e0c42ef | 2022-12-15 16:25:57 +0000 | [diff] [blame] | 1 | # 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 | |
| 23 | include(CMakeDependentOption) |
| 24 | |
| 25 | # --------------------------------------------------------------------- |
| 26 | |
| 27 | option(BUILD_SHARED_LIBS "Build shared libraries" ON) |
| 28 | |
David Svantesson | b5d6c28 | 2023-04-24 16:47:04 +0000 | [diff] [blame] | 29 | option(ARM_COMPUTE_WERROR "Enable the -Werror compilation flag" OFF) |
| 30 | option(ARM_COMPUTE_EXCEPTIONS "Enable C++ exception support" ON) |
| 31 | option(ARM_COMPUTE_LOGGING "Enable logging" OFF) |
| 32 | option(ARM_COMPUTE_BUILD_EXAMPLES "Build example programs" OFF) |
| 33 | option(ARM_COMPUTE_BUILD_TESTING "Build tests" OFF) |
| 34 | option(ARM_COMPUTE_CPPTHREADS "Enable C++11 threads backend" OFF) |
| 35 | option(ARM_COMPUTE_OPENMP "Enable OpenMP backend" ON) |
David Svantesson | e0c42ef | 2022-12-15 16:25:57 +0000 | [diff] [blame] | 36 | |
| 37 | # |
David Svantesson | b5d6c28 | 2023-04-24 16:47:04 +0000 | [diff] [blame] | 38 | if(ARM_COMPUTE_CPPTHREADS) |
David Svantesson | e0c42ef | 2022-12-15 16:25:57 +0000 | [diff] [blame] | 39 | add_definitions(-DARM_COMPUTE_CPP_SCHEDULER) |
| 40 | endif() |
| 41 | # |
David Svantesson | b5d6c28 | 2023-04-24 16:47:04 +0000 | [diff] [blame] | 42 | if(ARM_COMPUTE_LOGGING) |
David Svantesson | e0c42ef | 2022-12-15 16:25:57 +0000 | [diff] [blame] | 43 | add_definitions(-DARM_COMPUTE_LOGGING_ENABLED) |
| 44 | endif() |
| 45 | |
David Svantesson | 90d15b9 | 2023-06-08 10:05:59 +0000 | [diff] [blame] | 46 | set(ARM_COMPUTE_ARCH armv8-a CACHE STRING "Architecture to use") |
| 47 | |
David Svantesson | e0c42ef | 2022-12-15 16:25:57 +0000 | [diff] [blame] | 48 | # --------------------------------------------------------------------- |
| 49 | # Backends |
| 50 | |
David Svantesson | b5d6c28 | 2023-04-24 16:47:04 +0000 | [diff] [blame] | 51 | option(ARM_COMPUTE_ENABLE_BF16_VALIDATION "" OFF) |
| 52 | option(ARM_COMPUTE_ENABLE_SVE_VALIDATION "" OFF) |
| 53 | |
David Svantesson | e0c42ef | 2022-12-15 16:25:57 +0000 | [diff] [blame] | 54 | option(ENABLE_NEON "Enable Arm® Neon™ support" ON) |
| 55 | option(ARM_COMPUTE_CPU_ENABLED "" ON) |
| 56 | option(ARM_COMPUTE_ENABLE_NEON "" ON) |
David Svantesson | e0c42ef | 2022-12-15 16:25:57 +0000 | [diff] [blame] | 57 | option(ARM_COMPUTE_ENABLE_I8MM "" ON) |
David Svantesson | e0c42ef | 2022-12-15 16:25:57 +0000 | [diff] [blame] | 58 | option(ENABLE_FP32_KERNELS "" ON) |
| 59 | option(ENABLE_QASYMM8_KERNELS "" ON) |
| 60 | option(ENABLE_QASYMM8_SIGNED_KERNELS "" ON) |
| 61 | option(ENABLE_QSYMM16_KERNELS "" ON) |
| 62 | option(ENABLE_INTEGER_KERNELS "" ON) |
| 63 | option(ENABLE_NHWC_KERNELS "" ON) |
| 64 | option(ENABLE_NCHW_KERNELS "" ON) |
| 65 | option(ARM_COMPUTE_GRAPH_ENABLED "" ON) |
David Svantesson | e0c42ef | 2022-12-15 16:25:57 +0000 | [diff] [blame] | 66 | option(ARM_COMPUTE_ENABLE_SVEF32MM "" ON) |
| 67 | option(ARM_COMPUTE_ENABLE_FIXED_FORMAT_KERNELS "" ON) |
David Svantesson | 90d15b9 | 2023-06-08 10:05:59 +0000 | [diff] [blame] | 68 | option(ENABLE_FP16_KERNELS "" OFF) |
| 69 | option(ARM_COMPUTE_ENABLE_FP16 "" OFF) |
David Svantesson | e0c42ef | 2022-12-15 16:25:57 +0000 | [diff] [blame] | 70 | |
David Svantesson | e0c42ef | 2022-12-15 16:25:57 +0000 | [diff] [blame] | 71 | if(ENABLE_NEON) |
| 72 | add_definitions(-DENABLE_NEON) |
| 73 | endif() |
| 74 | if(ARM_COMPUTE_CPU_ENABLED) |
| 75 | add_definitions(-DARM_COMPUTE_CPU_ENABLED) |
| 76 | endif() |
| 77 | if(ARM_COMPUTE_ENABLE_NEON) |
| 78 | add_definitions(-DARM_COMPUTE_ENABLE_NEON) |
| 79 | endif() |
| 80 | if(ARM_COMPUTE_ENABLE_FP16) |
| 81 | add_definitions(-DARM_COMPUTE_ENABLE_FP16) |
| 82 | endif() |
| 83 | if(ARM_COMPUTE_ENABLE_I8MM) |
| 84 | add_definitions(-DARM_COMPUTE_ENABLE_I8MM) |
| 85 | endif() |
| 86 | if(ENABLE_FP16_KERNELS) |
| 87 | add_definitions(-DENABLE_FP16_KERNELS) |
| 88 | endif() |
| 89 | if(ENABLE_FP32_KERNELS) |
| 90 | add_definitions(-DENABLE_FP32_KERNELS) |
| 91 | endif() |
| 92 | if(ENABLE_QASYMM8_KERNELS) |
| 93 | add_definitions(-DENABLE_QASYMM8_KERNELS) |
| 94 | endif() |
| 95 | if(ENABLE_QASYMM8_SIGNED_KERNELS) |
| 96 | add_definitions(-DENABLE_QASYMM8_SIGNED_KERNELS) |
| 97 | endif() |
| 98 | if(ENABLE_QSYMM16_KERNELS) |
| 99 | add_definitions(-DENABLE_QSYMM16_KERNELS) |
| 100 | endif() |
| 101 | if(ENABLE_INTEGER_KERNELS) |
| 102 | add_definitions(-DENABLE_INTEGER_KERNELS) |
| 103 | endif() |
| 104 | if(ENABLE_NHWC_KERNELS) |
| 105 | add_definitions(-DENABLE_NHWC_KERNELS) |
| 106 | endif() |
| 107 | if(ENABLE_NCHW_KERNELS) |
| 108 | add_definitions(-DENABLE_NCHW_KERNELS) |
| 109 | endif() |
| 110 | if(ARM_COMPUTE_GRAPH_ENABLED) |
| 111 | add_definitions(-DARM_COMPUTE_GRAPH_ENABLED) |
| 112 | endif() |
David Svantesson | e0c42ef | 2022-12-15 16:25:57 +0000 | [diff] [blame] | 113 | if(ARM_COMPUTE_ENABLE_SVEF32MM) |
| 114 | add_definitions(-DARM_COMPUTE_ENABLE_SVEF32MM) |
| 115 | endif() |
| 116 | if(ARM_COMPUTE_ENABLE_FIXED_FORMAT_KERNELS) |
| 117 | add_definitions(-DARM_COMPUTE_ENABLE_FIXED_FORMAT_KERNELS) |
| 118 | endif() |
David Svantesson | ded5b18 | 2023-08-02 14:23:00 +0000 | [diff] [blame] | 119 | add_definitions(-D_GLIBCXX_USE_NANOSLEEP) |