-
Notifications
You must be signed in to change notification settings - Fork 8
/
CMakeLists.txt
167 lines (145 loc) · 4.27 KB
/
CMakeLists.txt
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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
# Copyright 2024 The IREE Authors
#
# Licensed under the Apache License v2.0 with LLVM Exceptions.
# See https://llvm.org/LICENSE.txt for license information.
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
cmake_minimum_required(VERSION 3.21...3.24)
#-------------------------------------------------------------------------------
# Project configuration
#-------------------------------------------------------------------------------
project(iree-test-suites-linalg C CXX)
set(CMAKE_C_STANDARD 11)
set(CMAKE_CXX_STANDARD 17)
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
# Baseline requirements.
find_package(Python3 COMPONENTS Interpreter REQUIRED)
#-------------------------------------------------------------------------------
# Core project dependency
#-------------------------------------------------------------------------------
option(IREE_USE_LOCAL_REPO "Uses a local repository instead of fetching on-demand." OFF)
set(IREE_LOCAL_REPO_PATH "" CACHE STRING "Local repository path")
set(IREE_PACKAGE_ROOT_DIR "${CMAKE_CURRENT_LIST_DIR}")
set(IREE_PACKAGE_ROOT_PREFIX "iree-test-suites")
set(IREE_BUILD_COMPILER OFF)
set(IREE_BUILD_SAMPLES OFF)
set(IREE_BUILD_TESTS OFF)
if(IREE_USE_LOCAL_REPO)
message(STATUS "Using IREE repo at path '${IREE_LOCAL_REPO_PATH}'")
list(APPEND CMAKE_MESSAGE_INDENT " ")
add_subdirectory(${IREE_LOCAL_REPO_PATH} ${CMAKE_CURRENT_BINARY_DIR}/iree EXCLUDE_FROM_ALL)
list(POP_BACK CMAKE_MESSAGE_INDENT)
else()
message(STATUS "Fetching the core IREE repo (this may take a few minutes)...")
list(APPEND CMAKE_MESSAGE_INDENT " ")
# Note: for log output, set -DFETCHCONTENT_QUIET=OFF,
# see https://gitlab.kitware.com/cmake/cmake/-/issues/18238#note_440475
include(FetchContent)
FetchContent_Declare(
iree
GIT_REPOSITORY https://github.com/iree-org/iree.git
GIT_TAG candidate-20240828.999
GIT_SUBMODULES_RECURSE OFF
GIT_SHALLOW OFF
GIT_PROGRESS ON
USES_TERMINAL_DOWNLOAD ON
EXCLUDE_FROM_ALL
)
FetchContent_MakeAvailable(iree)
FetchContent_GetProperties(iree SOURCE_DIR IREE_SOURCE_DIR)
list(POP_BACK CMAKE_MESSAGE_INDENT)
endif()
#-------------------------------------------------------------------------------
# Test code
#-------------------------------------------------------------------------------
enable_testing(iree-test-suites-linalg-ops)
add_custom_target(iree-test-suites-linalg-ops-deps
COMMENT
"Building linalg operator test suite deps"
)
iree_cc_library(
NAME
test_utils
HDRS
"test_utils.h"
SRCS
"test_utils.c"
DEPS
iree::base
iree::base::internal
iree::base::internal::cpu
iree::base::internal::flags
iree::base::internal::path
iree::hal
iree::modules::hal
iree::tooling::context_util
iree::tooling::device_util
iree::vm
iree::vm::cc
PUBLIC
)
iree_cc_binary(
NAME
iree-e2e-matmul-test
SRCS
"iree-e2e-matmul-test.cc"
DEPS
::test_utils
iree::base
iree::base::internal
iree::base::internal::cpu
iree::base::internal::flags
iree::base::internal::path
iree::hal
iree::modules::hal
iree::tooling::context_util
iree::tooling::device_util
iree::vm
iree::vm::cc
)
iree_cc_binary(
NAME
iree-e2e-conv2d-test
SRCS
"iree-e2e-conv2d-test.cc"
DEPS
::test_utils
iree::base
iree::base::internal
iree::base::internal::cpu
iree::base::internal::flags
iree::base::internal::path
iree::hal
iree::modules::hal
iree::tooling::context_util
iree::tooling::device_util
iree::vm
iree::vm::cc
)
iree_cc_binary(
NAME
iree-e2e-attention-test
SRCS
"iree-e2e-attention-test.cc"
DEPS
::test_utils
iree::base
iree::base::internal
iree::base::internal::cpu
iree::base::internal::flags
iree::base::internal::path
iree::hal
iree::modules::hal
iree::tooling::context_util
iree::tooling::device_util
iree::vm
iree::vm::cc
)
#-------------------------------------------------------------------------------
# Tests
#-------------------------------------------------------------------------------
list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR})
include(iree_test_suites_native_test)
include(iree_test_suites_runner_test)
add_subdirectory(matmul)
add_subdirectory(convolution)
add_subdirectory(attention)