Skip to content
Prev Previous commit
Add validation --target-cuda/--target-hip to avoid ambiguity with CMa…
…ke options
  • Loading branch information
vlad-perevezentsev committed Jul 28, 2025
commit f0c7c427ab9e7522ef103553f25a3abd31f3a3f6
12 changes: 12 additions & 0 deletions scripts/build_locally.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,12 @@ def run(
"--target-cuda can not be an empty string. "
"Use --target-cuda=<arch> or --target-cuda"
)
if any(opt.startswith("-DDPCTL_TARGET_CUDA=") for opt in cmake_args):
raise ValueError(
"Both --target-cuda and -DDPCTL_TARGET_CUDA in --cmake-opts "
"were specified. Please use only one method "
"to avoid ambiguity"
)
cmake_args += [
f"-DDPCTL_TARGET_CUDA={target_cuda}",
]
Comment thread
ndgrigorian marked this conversation as resolved.
Expand All @@ -81,6 +87,12 @@ def run(
raise ValueError(
"--target-hip requires an architecture (e.g., gfx90a)"
)
if any(opt.startswith("-DDPCTL_TARGET_HIP=") for opt in cmake_args):
raise ValueError(
"Both --target-hip and -DDPCTL_TARGET_HIP in --cmake-opts "
"were specified. Please use only one method "
"to avoid ambiguity"
)
cmake_args += [
f"-DDPCTL_TARGET_HIP={target_hip}",
]
Expand Down
Loading