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 | |
| 46 | # --------------------------------------------------------------------- |
| 47 | # Backends |
| 48 | |
David Svantesson | b5d6c28 | 2023-04-24 16:47:04 +0000 | [diff] [blame] | 49 | option(ARM_COMPUTE_ENABLE_BF16_VALIDATION "" OFF) |
| 50 | option(ARM_COMPUTE_ENABLE_SVE_VALIDATION "" OFF) |
| 51 | |
David Svantesson | e0c42ef | 2022-12-15 16:25:57 +0000 | [diff] [blame] | 52 | option(ENABLE_NEON "Enable Arm® Neon™ support" ON) |
| 53 | option(ARM_COMPUTE_CPU_ENABLED "" ON) |
| 54 | option(ARM_COMPUTE_ENABLE_NEON "" ON) |
| 55 | option(ARM_COMPUTE_ENABLE_FP16 "" ON) |
| 56 | option(ARM_COMPUTE_ENABLE_I8MM "" ON) |
| 57 | option(ENABLE_FP16_KERNELS "" ON) |
| 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) |
| 68 | |
David Svantesson | e0c42ef | 2022-12-15 16:25:57 +0000 | [diff] [blame] | 69 | if(ENABLE_NEON) |
| 70 | add_definitions(-DENABLE_NEON) |
| 71 | endif() |
| 72 | if(ARM_COMPUTE_CPU_ENABLED) |
| 73 | add_definitions(-DARM_COMPUTE_CPU_ENABLED) |
| 74 | endif() |
| 75 | if(ARM_COMPUTE_ENABLE_NEON) |
| 76 | add_definitions(-DARM_COMPUTE_ENABLE_NEON) |
| 77 | endif() |
| 78 | if(ARM_COMPUTE_ENABLE_FP16) |
| 79 | add_definitions(-DARM_COMPUTE_ENABLE_FP16) |
| 80 | endif() |
| 81 | if(ARM_COMPUTE_ENABLE_I8MM) |
| 82 | add_definitions(-DARM_COMPUTE_ENABLE_I8MM) |
| 83 | endif() |
| 84 | if(ENABLE_FP16_KERNELS) |
| 85 | add_definitions(-DENABLE_FP16_KERNELS) |
| 86 | endif() |
| 87 | if(ENABLE_FP32_KERNELS) |
| 88 | add_definitions(-DENABLE_FP32_KERNELS) |
| 89 | endif() |
| 90 | if(ENABLE_QASYMM8_KERNELS) |
| 91 | add_definitions(-DENABLE_QASYMM8_KERNELS) |
| 92 | endif() |
| 93 | if(ENABLE_QASYMM8_SIGNED_KERNELS) |
| 94 | add_definitions(-DENABLE_QASYMM8_SIGNED_KERNELS) |
| 95 | endif() |
| 96 | if(ENABLE_QSYMM16_KERNELS) |
| 97 | add_definitions(-DENABLE_QSYMM16_KERNELS) |
| 98 | endif() |
| 99 | if(ENABLE_INTEGER_KERNELS) |
| 100 | add_definitions(-DENABLE_INTEGER_KERNELS) |
| 101 | endif() |
| 102 | if(ENABLE_NHWC_KERNELS) |
| 103 | add_definitions(-DENABLE_NHWC_KERNELS) |
| 104 | endif() |
| 105 | if(ENABLE_NCHW_KERNELS) |
| 106 | add_definitions(-DENABLE_NCHW_KERNELS) |
| 107 | endif() |
| 108 | if(ARM_COMPUTE_GRAPH_ENABLED) |
| 109 | add_definitions(-DARM_COMPUTE_GRAPH_ENABLED) |
| 110 | endif() |
David Svantesson | e0c42ef | 2022-12-15 16:25:57 +0000 | [diff] [blame] | 111 | if(ARM_COMPUTE_ENABLE_SVEF32MM) |
| 112 | add_definitions(-DARM_COMPUTE_ENABLE_SVEF32MM) |
| 113 | endif() |
| 114 | if(ARM_COMPUTE_ENABLE_FIXED_FORMAT_KERNELS) |
| 115 | add_definitions(-DARM_COMPUTE_ENABLE_FIXED_FORMAT_KERNELS) |
| 116 | endif() |
David Svantesson | 4537089 | 2023-02-22 11:08:57 +0000 | [diff] [blame] | 117 | add_definitions(-D_GLIBCXX_USE_NANOSLEEP) |