aboutsummaryrefslogtreecommitdiff
path: root/reference_model/CMakeLists.txt
blob: 0ba8afb1e1e3099ad5049311906f832a628fc999 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
cmake_minimum_required (VERSION 3.4)

# Copyright (c) 2020, ARM Limited.
#
#    Licensed under the Apache License, Version 2.0 (the "License");
#    you may not use this file except in compliance with the License.
#    You may obtain a copy of the License at
#
#         http://www.apache.org/licenses/LICENSE-2.0
#
#    Unless required by applicable law or agreed to in writing, software
#    distributed under the License is distributed on an "AS IS" BASIS,
#    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
#    See the License for the specific language governing permissions and
#    limitations under the License.


project(tosa_reference_model LANGUAGES CXX)

set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)

if(CMAKE_CXX_COMPILER_ID STREQUAL GNU)
  set(CMAKE_CXX_FLAGS "-Wall -Wno-ignored-attributes -Wno-format-truncation")
else()
  set(CMAKE_CXX_FLAGS "-Wall -Wno-ignored-attributes")
endif()

set(FLATBUFFERS_DIR "../thirdparty/flatbuffers/")
set(SERIALIZATION_DIR "../serialization")

set (CXX_SOURCE
     src/main.cpp
     src/tensor.cc
     src/graph_node.cc
     src/subgraph_traverser.cc
     src/func_debug.cc
     src/func_config.cc
     src/ops/op_factory.cc
     src/ops/tensor_ops.cc
     src/ops/activation_funcs.cc
     src/ops/ewise_binary.cc
     src/ops/ewise_unary.cc
     src/ops/ewise_ternary.cc
     src/ops/comparison.cc
     src/ops/reduction.cc
     src/ops/data_layout.cc
     src/ops/scatter_gather.cc
     src/ops/image.cc
     src/ops/type_conversion.cc
     src/ops/data_nodes.cc
     src/ops/custom.cc
     src/ops/control_flow.cc
)

add_executable(tosa_reference_model ${CXX_SOURCE})

target_include_directories(tosa_reference_model
  PUBLIC
    $<INSTALL_INTERFACE:include>
    $<BUILD_INTERFACE:${CMAKE_CURRENT_SRC_DIR}/include>
  PRIVATE
    ${CMAKE_CURRENT_SOURCE_DIR}/src
    ${FLATBUFFERS_DIR}/include
    ../thirdparty/eigen/
    ../thirdparty/eigen/unsupported/
    ${SERIALIZATION_DIR}
)

target_link_libraries(tosa_reference_model
  PRIVATE
    flatbuffers
    tosa_serialization
)

install (TARGETS tosa_reference_model DESTINATION bin)