Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Detect local installation of cuDSS #57

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
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
2 changes: 1 addition & 1 deletion .github/workflows/Aqua.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,5 @@ jobs:
version: '1'
- name: Aqua.jl
run: julia --color=yes -e 'using Pkg; Pkg.add("Aqua"); Pkg.add("CUDA"); Pkg.develop(path=".");
using Aqua, CUDA.CUSPARSE, CUDSS; Aqua.test_all(CUDSS, piracies=false, ambiguities=false);
using Aqua, CUDA.CUSPARSE, CUDSS; Aqua.test_all(CUDSS, stale_deps=false, piracies=false, ambiguities=false);
Aqua.test_ambiguities(CUDSS); Aqua.test_piracies(CUDSS; treat_as_own=[CuSparseMatrixCSR])'
6 changes: 4 additions & 2 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,21 @@ version = "0.3.2"
[deps]
CEnum = "fa961155-64e5-5f13-b03f-caf6b980ea82"
CUDA = "052768ef-5323-5732-b1bb-66c8b64840ba"
CUDA_Runtime_Discovery = "1af6417a-86b4-443c-805f-a4643ffb695f"
CUDSS_jll = "4889d778-9329-5762-9fec-0578a5d30366"
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
SparseArrays = "2f01184e-e22b-5df5-ae63-d93ebab69eaf"

[compat]
CEnum = "0.4, 0.5"
CUDA = "5.4.0"
CUDA_Runtime_Discovery = "0.3.4"
CUDSS_jll = "0.3.0"
julia = "1.6"
LinearAlgebra = "1.6"
SparseArrays = "1.6"
Random = "1.6"
SparseArrays = "1.6"
Test = "1.6"
julia = "1.6"

[extras]
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
Expand Down
29 changes: 24 additions & 5 deletions src/CUDSS.jl
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,31 @@
using LinearAlgebra
using SparseArrays

if haskey(ENV, "JULIA_CUDSS_LIBRARY_PATH") && Sys.islinux()
const libcudss = joinpath(ENV["JULIA_CUDSS_LIBRARY_PATH"], "libcudss.so")
const CUDSS_INSTALLATION = "CUSTOM"
if CUDA.local_toolkit
using CUDA_Runtime_Discovery
else
using CUDSS_jll
const CUDSS_INSTALLATION = "YGGDRASIL"
import CUDSS_jll
end

function __init__()
if CUDA.functional()
global libcudss
global CUDSS_INSTALLATION
if haskey(ENV, "JULIA_CUDSS_LIBRARY_PATH") && Sys.islinux()
libcudss = joinpath(ENV["JULIA_CUDSS_LIBRARY_PATH"], "libcudss.so")
CUDSS_INSTALLATION = "CUSTOM"

Check warning on line 20 in src/CUDSS.jl

View check run for this annotation

Codecov / codecov/patch

src/CUDSS.jl#L19-L20

Added lines #L19 - L20 were not covered by tests
elseif CUDA.local_toolkit
dirs = CUDA_Runtime_Discovery.find_toolkit()
path = CUDA_Runtime_Discovery.get_library(dirs, "cudss"; optional=true)
(path === nothing) && error("cuDSS is not available on your system (looked in $(join(dirs, ", "))).")
libcudss = path
CUDSS_INSTALLATION = "LOCAL"

Check warning on line 26 in src/CUDSS.jl

View check run for this annotation

Codecov / codecov/patch

src/CUDSS.jl#L22-L26

Added lines #L22 - L26 were not covered by tests
else
!CUDSS_jll.is_available() && error("cuDSS is not available for your platform.")
libcudss = CUDSS_jll.libcudss
CUDSS_INSTALLATION = "YGGDRASIL"
end
end
end

import CUDA: @checked, libraryPropertyType, cudaDataType, initialize_context, retry_reclaim, CUstream, @gcsafe_ccall
Expand Down
Loading