Skip to content

Commit 782d742

Browse files
Extend build_locally.py with --target-hip to simplify passing HIP target
1 parent eea46c7 commit 782d742

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

scripts/build_locally.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ def run(
3131
verbose=False,
3232
cmake_opts="",
3333
target_cuda=None,
34+
target_hip=None,
3435
):
3536
build_system = None
3637

@@ -75,6 +76,14 @@ def run(
7576
cmake_args += [
7677
f"-DDPCTL_TARGET_CUDA={target_cuda}",
7778
]
79+
if target_hip is not None:
80+
if not target_hip.strip():
81+
raise ValueError(
82+
"--target-hip requires an architecture (e.g., gfx90a)"
83+
)
84+
cmake_args += [
85+
f"-DDPCTL_TARGET_HIP={target_hip}",
86+
]
7887
subprocess.check_call(
7988
cmake_args, shell=False, cwd=setup_dir, env=os.environ
8089
)
@@ -150,6 +159,13 @@ def run(
150159
default=None,
151160
type=str,
152161
)
162+
driver.add_argument(
163+
"--target-hip",
164+
required=False,
165+
help="Enable HIP target for build. "
166+
"Must specify HIP architecture (e.g., --target-hip=gfx90a)",
167+
type=str,
168+
)
153169
args = parser.parse_args()
154170

155171
args_to_validate = [
@@ -206,4 +222,5 @@ def run(
206222
verbose=args.verbose,
207223
cmake_opts=args.cmake_opts,
208224
target_cuda=args.target_cuda,
225+
target_hip=args.target_hip,
209226
)

0 commit comments

Comments
 (0)