Skip to content

Commit 5f11917

Browse files
Add build_locally args for AMD build
1 parent 72bc4d4 commit 5f11917

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

scripts/build_locally.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ def run(
3939
verbose=False,
4040
cmake_opts="",
4141
target="intel",
42+
arch=None,
4243
onemkl_interfaces=False,
4344
onemkl_interfaces_dir=None,
4445
):
@@ -104,6 +105,16 @@ def run(
104105
# Always builds using oneMKL interfaces for the cuda target
105106
onemkl_interfaces = True
106107

108+
if target == "hip":
109+
if not arch:
110+
raise ValueError("--arch is required when --target=hip")
111+
cmake_args += [
112+
"-DDPNP_TARGET_HIP=ON",
113+
f"-DHIP_TARGETS={arch}",
114+
]
115+
# Always builds using oneMKL interfaces for the hip target
116+
onemkl_interfaces = True
117+
107118
if onemkl_interfaces:
108119
cmake_args += [
109120
"-DDPNP_USE_ONEMKL_INTERFACES=ON",
@@ -177,6 +188,12 @@ def run(
177188
default="intel",
178189
type=str,
179190
)
191+
driver.add_argument(
192+
"--arch",
193+
help="Architecture for HIP target",
194+
dest="arch",
195+
type=str,
196+
)
180197
driver.add_argument(
181198
"--onemkl-interfaces",
182199
help="Build using oneMKL Interfaces",
@@ -244,6 +261,7 @@ def run(
244261
verbose=args.verbose,
245262
cmake_opts=args.cmake_opts,
246263
target=args.target,
264+
arch=args.arch,
247265
onemkl_interfaces=args.onemkl_interfaces,
248266
onemkl_interfaces_dir=args.onemkl_interfaces_dir,
249267
)

0 commit comments

Comments
 (0)