Skip to content

Commit 7f14078

Browse files
authored
Adding build config for HSA runtime headers. (#18909)
1 parent 9731fed commit 7f14078

File tree

5 files changed

+53
-1
lines changed

5 files changed

+53
-1
lines changed

build_tools/bazel/workspace.bzl

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,13 @@ def configure_iree_submodule_deps(iree_repo_alias = "@", iree_path = "./"):
147147
path = paths.join(iree_path, "third_party/nccl"),
148148
)
149149

150+
maybe(
151+
native.new_local_repository,
152+
name = "hsa_runtime_headers",
153+
build_file = iree_repo_alias + "//:build_tools/third_party/hsa-runtime-headers/BUILD.overlay",
154+
path = paths.join(iree_path, "third_party/hsa-runtime-headers"),
155+
)
156+
150157
maybe(
151158
native.new_local_repository,
152159
name = "webgpu_headers",

build_tools/bazel_to_cmake/bazel_to_cmake_targets.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,7 @@ def __init__(self, repo_map: Dict[str, str]):
113113
"@com_google_googletest//:gtest": ["gmock", "gtest"],
114114
"@spirv_cross//:spirv_cross_lib": ["spirv-cross-msl"],
115115
"@cpuinfo": ["${IREE_CPUINFO_TARGET}"],
116+
"@hsa_runtime_headers": ["hsa_runtime::headers"],
116117
"@webgpu_headers": [],
117118
}
118119
)
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# Copyright 2024 The IREE Authors
2+
#
3+
# Licensed under the Apache License v2.0 with LLVM Exceptions.
4+
# See https://llvm.org/LICENSE.txt for license information.
5+
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6+
7+
package(default_visibility = ["//visibility:public"])
8+
9+
cc_library(
10+
name = "hsa_runtime_headers",
11+
hdrs = glob([
12+
"include/hsa/*.h",
13+
]),
14+
include_prefix = "third_party/hsa-runtime-headers/",
15+
includes = ["include"],
16+
)
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# Copyright 2024 The IREE Authors
2+
#
3+
# Licensed under the Apache License v2.0 with LLVM Exceptions.
4+
# See https://llvm.org/LICENSE.txt for license information.
5+
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6+
7+
set(HSA_RUNTIME_HEADERS_ROOT "${IREE_ROOT_DIR}/third_party/hsa-runtime-headers/")
8+
9+
external_cc_library(
10+
PACKAGE
11+
hsa_runtime
12+
NAME
13+
headers
14+
ROOT
15+
${HSA_RUNTIME_HEADERS_ROOT}
16+
SYSTEM_INCLUDES
17+
${HSA_RUNTIME_HEADERS_ROOT}/include/
18+
PUBLIC
19+
)
20+
21+
iree_install_targets(
22+
TARGETS
23+
hsa_runtime_headers
24+
COMPONENT
25+
IREEBundledLibraries
26+
EXPORT_SET
27+
Runtime
28+
)

0 commit comments

Comments
 (0)