Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions src/aedifix/packages/cuda.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
from __future__ import annotations

import os
import re
import shutil
from argparse import Action, ArgumentParser, Namespace
from pathlib import Path
Expand Down Expand Up @@ -55,7 +56,7 @@ def map_cuda_arch_names(in_arch: str) -> list[str]:
# TODO(jfaibussowit): rubin?
}
arch = []
for sub_arch in in_arch.split(","):
for sub_arch in re.split(r"[;,]", in_arch):
# support Turing, TURING, and, if the user is feeling spicy, tUrInG
sub_arch_lo = sub_arch.strip().casefold()
if not sub_arch_lo:
Expand Down Expand Up @@ -131,7 +132,9 @@ class CUDA(Package):
spec=ArgSpec(
dest="cuda_arch",
required=False,
default=_guess_cuda_architecture(),
default=CudaArchAction.map_cuda_arch_names(
_guess_cuda_architecture()
),
action=CudaArchAction,
help=(
"Specify the target GPU architecture. Available choices are: "
Expand Down
2 changes: 2 additions & 0 deletions tests/packages/test_cuda.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
("turing,hopper", ["75", "90"]),
("volta,60,all-major", ["70", "60", "all-major"]),
("60,,80", ["60", "80"]),
("50-real;120-real;121", ["50-real", "120-real", "121"]),
)


Expand All @@ -33,6 +34,7 @@ class TestCUDA:
("env_var", "env_value", "expected"),
[
("CUDAARCHS", "volta", "volta"),
("CUDAARCHS", "volta;ampere", "volta;ampere"),
("CMAKE_CUDA_ARCHITECTURES", "75", "75"),
("", "", "all-major"),
],
Expand Down
Loading