Skip to content

Commit a01b866

Browse files
authored
Improve usecuda function to verify CUDA availability (#762)
1 parent 940ea1d commit a01b866

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/LinearSolve.jl

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -434,7 +434,10 @@ appleaccelerate_isavailable() = HAS_APPLE_ACCELERATE[]
434434

435435
# Extension availability checking functions
436436
useblis() = Base.get_extension(@__MODULE__, :LinearSolveBLISExt) !== nothing
437-
usecuda() = Base.get_extension(@__MODULE__, :LinearSolveCUDAExt) !== nothing
437+
function usecuda()
438+
ext = Base.get_extension(@__MODULE__, :LinearSolveCUDAExt)
439+
!isnothing(ext) && ext.CUDA.functional()
440+
end
438441

439442
# Metal is only available on Apple platforms
440443
@static if !Sys.isapple()

0 commit comments

Comments
 (0)