Merge pull request #941 from FluxML/tb/include_during_precompile

Don't include the CUDA module during precompilation.
This commit is contained in:
Tim Besard 2019-11-24 08:55:43 +01:00 committed by GitHub
commit fbb377a7b4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 0 deletions

View File

@ -39,6 +39,12 @@ include("data/Data.jl")
include("deprecations.jl")
function __init__()
precompiling = ccall(:jl_generating_output, Cint, ()) != 0
# we don't want to include the CUDA module when precompiling,
# or we could end up replacing it at run time (triggering a warning)
precompiling && return
if !CuArrays.functional()
# nothing to do here, and either CuArrays or one of its dependencies will have warned
else