Skip to content

Commit

Permalink
Merge pull request #8183 from kmaehashi/allow-show-config-without-cuda
Browse files Browse the repository at this point in the history
Allow `cupy.show_config()` without CUDA
  • Loading branch information
asi1024 committed Feb 17, 2024
2 parents 8907516 + 03e70d4 commit c72183e
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions cupyx/_runtime.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,46 +122,46 @@ def __init__(self, *, full=True):
cupy.cuda.runtime.CUDARuntimeError)
self.cuda_local_runtime_version = _eval_or_error(
cupy.cuda.get_local_runtime_version,
cupy.cuda.runtime.CUDARuntimeError)
Exception)

# cuBLAS
self.cublas_version = '(available)'
if full:
self.cublas_version = _eval_or_error(
lambda: cupy.cuda.cublas.getVersion(
cupy.cuda.device.get_cublas_handle()),
cupy.cuda.cublas.CUBLASError)
Exception)

# cuFFT
try:
from cupy.cuda import cufft
self.cufft_version = _eval_or_error(
cufft.getVersion, cufft.CuFFTError)
lambda: cufft.getVersion(), Exception)
except ImportError:
pass

# cuRAND
self.curand_version = _eval_or_error(
cupy.cuda.curand.getVersion,
cupy.cuda.curand.CURANDError)
lambda: cupy.cuda.curand.getVersion(),
Exception)

# cuSOLVER
self.cusolver_version = _eval_or_error(
cupy.cuda.cusolver._getVersion,
cupy.cuda.cusolver.CUSOLVERError)
lambda: cupy.cuda.cusolver._getVersion(),
Exception)

# cuSPARSE
self.cusparse_version = '(available)'
if full:
self.cusparse_version = _eval_or_error(
lambda: cupy.cuda.cusparse.getVersion(
cupy.cuda.device.get_cusparse_handle()),
cupy.cuda.cusparse.CuSparseError)
Exception)

# NVRTC
self.nvrtc_version = _eval_or_error(
cupy.cuda.nvrtc.getVersion,
(cupy.cuda.nvrtc.NVRTCError, cupy.cuda.runtime.CUDARuntimeError))
lambda: cupy.cuda.nvrtc.getVersion(),
Exception)

# Thrust
try:
Expand Down

0 comments on commit c72183e

Please sign in to comment.