forked from FluxML/Flux.jl
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
16 changed files
with
140 additions
and
55 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,38 +1,12 @@ | ||
module CUDA | ||
|
||
using ..CuArrays | ||
import ..CuArrays.CUDAdrv: CuPtr, CU_NULL | ||
using Pkg.TOML | ||
|
||
function version_check() | ||
major_version = 1 | ||
project = joinpath(dirname(pathof(CuArrays)), "../Project.toml") | ||
project = TOML.parse(String(read(project))) | ||
version = VersionNumber(get(project, "version", "0.0.0")) | ||
if version.major != major_version | ||
@warn """ | ||
Flux is only supported with CuArrays v$major_version.x. | ||
Try running `] pin CuArrays@$major_version`. | ||
""" | ||
end | ||
end | ||
|
||
version_check() | ||
|
||
if !applicable(CuArray{UInt8}, undef, 1) | ||
(T::Type{<:CuArray})(::UndefInitializer, sz...) = T(sz...) | ||
end | ||
|
||
if CuArrays.libcudnn != nothing | ||
if isdefined(CuArrays, :libcudnn_handle) | ||
handle() = CuArrays.libcudnn_handle[] | ||
else | ||
handle() = CuArrays.CUDNN.handle() | ||
end | ||
if CuArrays.libcudnn !== nothing # TODO: use CuArrays.has_cudnn() | ||
include("curnn.jl") | ||
include("cudnn.jl") | ||
else | ||
@warn("CUDNN is not installed, some functionality will not be available.") | ||
@warn "CUDNN is not installed, some functionality will not be available." | ||
end | ||
|
||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.