Skip to content

Commit

Permalink
use CUDA.functional() to detect cuda.device
Browse files Browse the repository at this point in the history
  • Loading branch information
ArrogantGao committed Oct 19, 2023
1 parent 918f982 commit 62f24b1
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/CuTropicalGEMM.jl
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,15 @@ using CUDA, TropicalNumbers, LinearAlgebra, TropicalGemmC_jll
export matmul!

function __init__()
@assert CUDA.driver_version() >= v"11.4" "Error: CUDA.driver_version < v11.4"
@assert CUDA.driver_version() <= v"12.2" "Error: CUDA.driver_version > v12.2"
if CUDA.functional() == true
if CUDA.driver_version() < v"11.4"
@warn "CUDA.driver_version < v11.4! CuTropicalGEMM may not be available."

Check warning on line 9 in src/CuTropicalGEMM.jl

View check run for this annotation

Codecov / codecov/patch

src/CuTropicalGEMM.jl#L9

Added line #L9 was not covered by tests
elseif CUDA.driver_version() > v"12.2"
@warn "CUDA.driver_version > v12.2! CuTropicalGEMM may not be available."
end
elseif CUDA.functional() == false
@warn "CUDA Driver not found! CuTropicalGEMM will not be available."

Check warning on line 14 in src/CuTropicalGEMM.jl

View check run for this annotation

Codecov / codecov/patch

src/CuTropicalGEMM.jl#L13-L14

Added lines #L13 - L14 were not covered by tests
end
return nothing
end

Expand Down

0 comments on commit 62f24b1

Please sign in to comment.