blob: 6fdaa1c9aa7720f0dc1539819085a0438377ac72 [file] [log] [blame]
Eric Kunzee5e26762020-10-13 16:11:07 -07001cmake_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
18project(tosa_reference_model LANGUAGES CXX)
19
20set(CMAKE_CXX_STANDARD 17)
21set(CMAKE_CXX_STANDARD_REQUIRED ON)
22
23if(CMAKE_CXX_COMPILER_ID STREQUAL GNU)
24 set(CMAKE_CXX_FLAGS "-Wall -Wno-ignored-attributes -Wno-format-truncation")
25else()
26 set(CMAKE_CXX_FLAGS "-Wall -Wno-ignored-attributes")
27endif()
28
Kevin Cheng550ccc52021-03-03 11:21:43 -080029set(FLATBUFFERS_DIR "../thirdparty/serialization_lib/third_party/flatbuffers/")
30set(SERIALIZATION_DIR "../thirdparty/serialization_lib/")
Eric Kunzee5e26762020-10-13 16:11:07 -070031
32set (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
56add_executable(tosa_reference_model ${CXX_SOURCE})
57
58target_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 Cheng550ccc52021-03-03 11:21:43 -080067 ${SERIALIZATION_DIR}/include
Eric Kunzee5e26762020-10-13 16:11:07 -070068)
69
70target_link_libraries(tosa_reference_model
71 PRIVATE
Kevin Cheng550ccc52021-03-03 11:21:43 -080072 tosa_serialization_lib
Kevin Chengcd79f0e2021-06-03 15:00:34 -070073 nlohmann_json::nlohmann_json
Eric Kunze286f8342022-06-22 11:30:23 -070074 cxxopts
Eric Kunzee5e26762020-10-13 16:11:07 -070075)
76
77install (TARGETS tosa_reference_model DESTINATION bin)