forked from iree-org/iree
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCMakeLists.txt
114 lines (107 loc) · 2.49 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
# Copyright 2021 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
set(IREE_PACKAGE_ROOT_DIR ${CMAKE_CURRENT_LIST_DIR}/../..)
# Canonicalize path.
cmake_path(ABSOLUTE_PATH IREE_PACKAGE_ROOT_DIR
BASE_DIRECTORY ${IREE_PACKAGE_ROOT_DIR}
NORMALIZE
OUTPUT_VARIABLE IREE_PACKAGE_ROOT_DIR)
set(IREE_PACKAGE_ROOT_PREFIX iree)
iree_add_all_subdirs()
if(NOT ROCM_HEADERS_API_ROOT)
set(ROCM_HEADERS_API_ROOT "/opt/rocm/include")
endif()
if(EXISTS ${ROCM_HEADERS_API_ROOT})
message(STATUS "ROCm Header Path: ${ROCM_HEADERS_API_ROOT}")
else()
message(SEND_ERROR "Could not locate ROCm: ${ROCM_HEADERS_API_ROOT}")
endif()
iree_cc_library(
NAME
rocm
HDRS
"api.h"
SRCS
"api.h"
"context_wrapper.h"
"rocm_allocator.c"
"rocm_allocator.h"
"rocm_buffer.c"
"rocm_buffer.h"
"rocm_device.c"
"rocm_device.h"
"rocm_driver.c"
"rocm_event.c"
"rocm_event.h"
"event_semaphore.c"
"event_semaphore.h"
"direct_command_buffer.c"
"direct_command_buffer.h"
"native_executable.c"
"native_executable.h"
"nop_executable_cache.c"
"nop_executable_cache.h"
"pipeline_layout.c"
"pipeline_layout.h"
"status_util.c"
"status_util.h"
INCLUDES
"${CMAKE_CURRENT_LIST_DIR}/../.."
"${PROJECT_BINARY_DIR}"
"${ROCM_HEADERS_API_ROOT}"
DEPS
::dynamic_symbols
iree::base
iree::base::core_headers
iree::base::internal
iree::base::internal::arena
iree::base::internal::flatcc::parsing
iree::base::internal::synchronization
iree::base::tracing
iree::hal
iree::hal::utils::buffer_transfer
iree::hal::utils::semaphore_base
iree::schemas::rocm_executable_def_c_fbs
COPTS
"-D__HIP_PLATFORM_HCC__=1"
PUBLIC
)
iree_cc_library(
NAME
dynamic_symbols
HDRS
"dynamic_symbols.h"
TEXTUAL_HDRS
"dynamic_symbol_tables.h"
SRCS
"rocm_headers.h"
"dynamic_symbols.c"
INCLUDES
"${ROCM_HEADERS_API_ROOT}"
"${CMAKE_CURRENT_LIST_DIR}/../.."
COPTS
"-D__HIP_PLATFORM_HCC__=1"
DEPS
iree::base::core_headers
iree::base::internal::dynamic_library
iree::base::tracing
PUBLIC
)
iree_cc_test(
NAME
dynamic_symbols_test
SRCS
"dynamic_symbols_test.cc"
DEPS
::dynamic_symbols
iree::base
iree::testing::gtest
iree::testing::gtest_main
LABELS
"driver=rocm"
COPTS
"-D__HIP_PLATFORM_HCC__=1"
)