aboutsummaryrefslogtreecommitdiff
path: root/reference_model/CMakeLists.txt
diff options
context:
space:
mode:
authorJeremy Johnson <jeremy.johnson@arm.com>2023-09-12 14:52:34 +0100
committerEric Kunze <eric.kunze@arm.com>2023-09-13 22:51:30 +0000
commit48df8c7509f51b145e97619a45aa25836e702767 (patch)
treef6a31e55503147a5c46e09705ffd0e84bcae42e0 /reference_model/CMakeLists.txt
parent51779fdc58b76f416ba22272d822642af417c04c (diff)
downloadreference_model-48df8c7509f51b145e97619a45aa25836e702767.tar.gz
Build compliance verifier library with a python interface.
Build steps to create tosa_reference_verify_lib.so New python class to handle loading and calling verifier with pytests. Signed-off-by: Jeremy Johnson <jeremy.johnson@arm.com> Change-Id: Id42c71c398ed7364742b4a039977412ef3081c4a
Diffstat (limited to 'reference_model/CMakeLists.txt')
-rw-r--r--reference_model/CMakeLists.txt66
1 files changed, 34 insertions, 32 deletions
diff --git a/reference_model/CMakeLists.txt b/reference_model/CMakeLists.txt
index 227d19f..88192bf 100644
--- a/reference_model/CMakeLists.txt
+++ b/reference_model/CMakeLists.txt
@@ -91,14 +91,11 @@ set(CXX_SOURCE
src/ops/control_flow.cc
)
-# Build TOSA Reference Model library
-add_library(tosa_reference_model_lib ${CXX_SOURCE})
-
-target_include_directories(tosa_reference_model_lib
- PUBLIC
+set(PUBLIC_INCLUDE_DIRS
$<INSTALL_INTERFACE:include>
$<BUILD_INTERFACE:${CMAKE_CURRENT_SRC_DIR}/include>
- PRIVATE
+)
+set(PRIVATE_INCLUDE_DIRS
${CMAKE_CURRENT_SOURCE_DIR}/src
${FLATBUFFERS_DIR}/include
${EIGEN_DIR}
@@ -108,6 +105,16 @@ target_include_directories(tosa_reference_model_lib
${JSON_DIR}/single_include
)
+# Build TOSA Reference Model library
+add_library(tosa_reference_model_lib STATIC ${CXX_SOURCE})
+
+target_include_directories(tosa_reference_model_lib
+ PUBLIC
+ ${PUBLIC_INCLUDE_DIRS}
+ PRIVATE
+ ${PRIVATE_INCLUDE_DIRS}
+)
+
target_link_libraries(tosa_reference_model_lib
PRIVATE
${SERIALIZATION_LIB}
@@ -130,6 +137,21 @@ list(APPEND PUBLIC_HEADERS
set_target_properties(tosa_reference_model_lib PROPERTIES PUBLIC_HEADER "${PUBLIC_HEADERS}")
+# Build TOSA verification library
+add_library(tosa_reference_verify_lib SHARED
+ src/verify/verify_dot_product.cc
+ src/verify/verify_entry.cc
+ src/verify/verify_utils.cc
+ src/verify/verify_config.cc
+ src/func_debug.cc
+)
+target_include_directories(tosa_reference_verify_lib
+ PUBLIC
+ ${PUBLIC_INCLUDE_DIRS}
+ PRIVATE
+ ${PRIVATE_INCLUDE_DIRS}
+)
+
# Build TOSA Refererence Model executable
if(BUILD_TOSA_REFERENCE_MODEL_EXECUTABLE)
set(CXX_SOURCE_EX src/main.cpp)
@@ -139,16 +161,9 @@ if(BUILD_TOSA_REFERENCE_MODEL_EXECUTABLE)
target_include_directories(tosa_reference_model
PUBLIC
- $<INSTALL_INTERFACE:include>
- $<BUILD_INTERFACE:${CMAKE_CURRENT_SRC_DIR}/include>
+ ${PUBLIC_INCLUDE_DIRS}
PRIVATE
- ${CMAKE_CURRENT_SOURCE_DIR}/src
- ${FLATBUFFERS_DIR}/include
- ${EIGEN_DIR}
- ${EIGEN_DIR}/unsupported/
- ${SERIALIZATION_DIR}/include
- ${HALF_DIR}/include
- ${JSON_DIR}/single_include
+ ${PRIVATE_INCLUDE_DIRS}
)
target_link_libraries(tosa_reference_model
@@ -183,17 +198,10 @@ if(BUILD_TOSA_REFERENCE_MODEL_TESTS)
target_include_directories(unit_tests
PUBLIC
- $<INSTALL_INTERFACE:include>
- $<BUILD_INTERFACE:${CMAKE_CURRENT_SRC_DIR}/include>
+ ${PUBLIC_INCLUDE_DIRS}
PRIVATE
- ${CMAKE_CURRENT_SOURCE_DIR}/src
- ${FLATBUFFERS_DIR}/include
- ${EIGEN_DIR}
- ${EIGEN_DIR}/unsupported/
- ${SERIALIZATION_DIR}/include
- ${HALF_DIR}/include
+ ${PRIVATE_INCLUDE_DIRS}
${DOCTEST_DIR}
- ${JSON_DIR}/single_include
)
target_link_libraries(unit_tests
@@ -217,15 +225,9 @@ if(BUILD_MODEL_RUNNER_SAMPLE)
target_include_directories(model_runner_sample
PUBLIC
- $<INSTALL_INTERFACE:include>
- $<BUILD_INTERFACE:${CMAKE_CURRENT_SRC_DIR}/include>
+ ${PUBLIC_INCLUDE_DIRS}
PRIVATE
- ${CMAKE_CURRENT_SOURCE_DIR}/src
- ${FLATBUFFERS_DIR}/include
- ${EIGEN_DIR}
- ${EIGEN_DIR}/unsupported/
- ${SERIALIZATION_DIR}/include
- ${HALF_DIR}/include
+ ${PRIVATE_INCLUDE_DIRS}
)
target_link_libraries(model_runner_sample