Skip to content
This repository has been archived by the owner on Mar 12, 2021. It is now read-only.

Better error upon use of missing libraries. #625

Merged
merged 1 commit into from
Mar 11, 2020
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
18 changes: 14 additions & 4 deletions src/bindeps.jl
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,22 @@ libcusparse() = @after_init(__libcusparse[])
libcusolver() = @after_init(__libcusolver[])
libcufft() = @after_init(__libcufft[])
libcurand() = @after_init(__libcurand[])
libcudnn() = @after_init(__libcudnn[])
libcutensor() = @after_init(__libcutensor[])
function libcudnn()
@after_init begin
@assert has_cudnn() "This functionality is unavailabe as CUDNN is missing."
__libcudnn[]
end
end
function libcutensor()
@after_init begin
@assert has_cutensor() "This functionality is unavailabe as CUTENSOR is missing."
__libcutensor[]
end
end

export has_cudnn, has_cutensor
has_cudnn() = libcudnn() !== nothing
has_cutensor() = libcutensor() !== nothing
has_cudnn() = @after_init(__libcudnn[]) !== nothing
has_cutensor() = @after_init(__libcutensor[]) !== nothing


## discovery
Expand Down