blob: 3d8f56610b5bbd2b0f5e7a0a97b133e214b4816e [file] [log] [blame]
Anthony Barbier6ff3b192017-09-04 18:44:23 +01001# Copyright (c) 2017 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.
22cmake_minimum_required (VERSION 3.1)
23
24add_library(openvx SHARED IMPORTED)
25set_target_properties(openvx PROPERTIES
26 IMPORTED_LOCATION "${CMAKE_SOURCE_DIR}/../3rdparty/linux/armv7a/libopenvx.so"
27)
28
29add_library(vxu SHARED IMPORTED)
30set_target_properties(vxu PROPERTIES
31 IMPORTED_LOCATION "${CMAKE_SOURCE_DIR}/../3rdparty/linux/armv7a/libvxu.so"
32)
33
34add_library(OpenCL SHARED IMPORTED)
35set_target_properties(OpenCL PROPERTIES
36 IMPORTED_LOCATION "${CMAKE_SOURCE_DIR}/../build/opencl-1.2-stubs/libOpenCL.so"
37 IMPORTED_NO_SONAME 1
38)
39
40add_definitions(-DBOOST)
41
42set(ARM_COMPUTE_TARGETS_TO_VALIDATE "all" CACHE STRING "Semicolon-separated list of targets to include in validation.")
43
44set(ARM_COMPUTE_ALL_TARGETS
45 NEON
46 CL
47 UNIT
48 VX
49)
50
51if(ARM_COMPUTE_TARGETS_TO_VALIDATE STREQUAL "all")
52 set(ARM_COMPUTE_TARGETS_TO_VALIDATE ${ARM_COMPUTE_ALL_TARGETS})
53endif()
54
55list(REMOVE_DUPLICATES ARM_COMPUTE_TARGETS_TO_VALIDATE)
56
57foreach(TARGET ${ARM_COMPUTE_TARGETS_TO_VALIDATE})
58 list(FIND ARM_COMPUTE_ALL_TARGETS ${TARGET} idx)
59
60 if(${idx} LESS 0)
61 message(FATAL_ERROR "The target '${TARGET}' does not exist. It should be one of\n${ARM_COMPUTE_ALL_TARGETS}")
62 else()
63 add_subdirectory(${TARGET})
64 endif()
65endforeach()
66
67set(arm_compute_test_validation_SOURCE_FILES
68 ${CMAKE_CURRENT_SOURCE_DIR}/main.cpp
69 ${CMAKE_CURRENT_SOURCE_DIR}/Datasets.h
70 ${CMAKE_CURRENT_SOURCE_DIR}/Reference.h
71 ${CMAKE_CURRENT_SOURCE_DIR}/Reference.cpp
72 ${CMAKE_CURRENT_SOURCE_DIR}/ReferenceCPP.h
73 ${CMAKE_CURRENT_SOURCE_DIR}/ReferenceCPP.cpp
74 ${CMAKE_CURRENT_SOURCE_DIR}/Validation.h
75 ${CMAKE_CURRENT_SOURCE_DIR}/Validation.cpp
76 ${CMAKE_CURRENT_SOURCE_DIR}/ValidationProgramOptions.h
77 ${CMAKE_CURRENT_SOURCE_DIR}/ValidationUserConfiguration.h
78)
79
80add_library(arm_compute_test_validation OBJECT
81 ${arm_compute_test_validation_SOURCE_FILES}
82)
83
84add_executable(arm_compute_validation
85 $<TARGET_OBJECTS:arm_compute_test_validation>
86 ${arm_compute_test_validation_TARGET_OBJECTS}
87 $<TARGET_OBJECTS:tensor_library>
88 $<TARGET_OBJECTS:arm_compute_test>
89)
90
91target_link_libraries(arm_compute_validation
92 boost_unit_test_framework
93 boost_program_options
94 arm_compute
95 ${arm_compute_test_validation_TARGET_LIBRARIES}
96)