blob: 0ba8afb1e1e3099ad5049311906f832a628fc999 [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
29set(FLATBUFFERS_DIR "../thirdparty/flatbuffers/")
30set(SERIALIZATION_DIR "../serialization")
31
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/
67 ${SERIALIZATION_DIR}
68)
69
70target_link_libraries(tosa_reference_model
71 PRIVATE
72 flatbuffers
73 tosa_serialization
74)
75
76install (TARGETS tosa_reference_model DESTINATION bin)