Skip to content
Merged
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
22 changes: 20 additions & 2 deletions sigpy/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,26 @@
cupy_enabled = False

if cupy_enabled: # pragma: no cover
cudnn_enabled = util.find_spec("cupy.cuda.cudnn") is not None
nccl_enabled = util.find_spec("cupy.cuda.nccl") is not None
try:
cudnn_enabled = util.find_spec("cupy.cuda.cudnn") is not None
if cudnn_enabled:
from cupy import cudnn
except ImportError as e:
warnings.warn(
f"Importing cupy.cuda.cudnn failed. "
f"For more details, see the error stack below:\n{e}"
)
cudnn_enabled = False
try:
nccl_enabled = util.find_spec("cupy.cuda.nccl") is not None
if nccl_enabled:
from cupy.cuda import nccl # noqa: F401
except ImportError as e:
warnings.warn(
f"Importing cupy.cuda.nccl failed. "
f"For more details, see the error stack below:\n{e}"
)
nccl_enabled = False
else:
cudnn_enabled = False
nccl_enabled = False
Expand Down