Eric Kunze | e5e2676 | 2020-10-13 16:11:07 -0700 | [diff] [blame] | 1 | cmake_minimum_required (VERSION 3.4) |
| 2 | |
| 3 | # Copyright (c) 2020, ARM Limited. |
| 4 | # |
| 5 | # Licensed under the Apache License, Version 2.0 (the "License"); |
| 6 | # you may not use this file except in compliance with the License. |
| 7 | # You may obtain a copy of the License at |
| 8 | # |
| 9 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 10 | # |
| 11 | # Unless required by applicable law or agreed to in writing, software |
| 12 | # distributed under the License is distributed on an "AS IS" BASIS, |
| 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 14 | # See the License for the specific language governing permissions and |
| 15 | # limitations under the License. |
| 16 | |
| 17 | |
| 18 | project(tosa_reference_model LANGUAGES CXX) |
| 19 | |
| 20 | set(CMAKE_CXX_STANDARD 17) |
| 21 | set(CMAKE_CXX_STANDARD_REQUIRED ON) |
| 22 | |
| 23 | if(CMAKE_CXX_COMPILER_ID STREQUAL GNU) |
| 24 | set(CMAKE_CXX_FLAGS "-Wall -Wno-ignored-attributes -Wno-format-truncation") |
| 25 | else() |
| 26 | set(CMAKE_CXX_FLAGS "-Wall -Wno-ignored-attributes") |
| 27 | endif() |
| 28 | |
Kevin Cheng | 550ccc5 | 2021-03-03 11:21:43 -0800 | [diff] [blame] | 29 | set(FLATBUFFERS_DIR "../thirdparty/serialization_lib/third_party/flatbuffers/") |
| 30 | set(SERIALIZATION_DIR "../thirdparty/serialization_lib/") |
Eric Kunze | e5e2676 | 2020-10-13 16:11:07 -0700 | [diff] [blame] | 31 | |
| 32 | set (CXX_SOURCE |
| 33 | src/main.cpp |
| 34 | src/tensor.cc |
| 35 | src/graph_node.cc |
| 36 | src/subgraph_traverser.cc |
| 37 | src/func_debug.cc |
| 38 | src/func_config.cc |
| 39 | src/ops/op_factory.cc |
| 40 | src/ops/tensor_ops.cc |
| 41 | src/ops/activation_funcs.cc |
| 42 | src/ops/ewise_binary.cc |
| 43 | src/ops/ewise_unary.cc |
| 44 | src/ops/ewise_ternary.cc |
| 45 | src/ops/comparison.cc |
| 46 | src/ops/reduction.cc |
| 47 | src/ops/data_layout.cc |
| 48 | src/ops/scatter_gather.cc |
| 49 | src/ops/image.cc |
| 50 | src/ops/type_conversion.cc |
| 51 | src/ops/data_nodes.cc |
| 52 | src/ops/custom.cc |
| 53 | src/ops/control_flow.cc |
| 54 | ) |
| 55 | |
| 56 | add_executable(tosa_reference_model ${CXX_SOURCE}) |
| 57 | |
| 58 | target_include_directories(tosa_reference_model |
| 59 | PUBLIC |
| 60 | $<INSTALL_INTERFACE:include> |
| 61 | $<BUILD_INTERFACE:${CMAKE_CURRENT_SRC_DIR}/include> |
| 62 | PRIVATE |
| 63 | ${CMAKE_CURRENT_SOURCE_DIR}/src |
| 64 | ${FLATBUFFERS_DIR}/include |
| 65 | ../thirdparty/eigen/ |
| 66 | ../thirdparty/eigen/unsupported/ |
Kevin Cheng | 550ccc5 | 2021-03-03 11:21:43 -0800 | [diff] [blame] | 67 | ${SERIALIZATION_DIR}/include |
Eric Kunze | e5e2676 | 2020-10-13 16:11:07 -0700 | [diff] [blame] | 68 | ) |
| 69 | |
| 70 | target_link_libraries(tosa_reference_model |
| 71 | PRIVATE |
Kevin Cheng | 550ccc5 | 2021-03-03 11:21:43 -0800 | [diff] [blame] | 72 | tosa_serialization_lib |
Kevin Cheng | cd79f0e | 2021-06-03 15:00:34 -0700 | [diff] [blame] | 73 | nlohmann_json::nlohmann_json |
Eric Kunze | 286f834 | 2022-06-22 11:30:23 -0700 | [diff] [blame] | 74 | cxxopts |
Eric Kunze | e5e2676 | 2020-10-13 16:11:07 -0700 | [diff] [blame] | 75 | ) |
| 76 | |
| 77 | install (TARGETS tosa_reference_model DESTINATION bin) |