Skip to content

Commit

Permalink
Don't include the CUDA module during precompilation.
Browse files Browse the repository at this point in the history
If we do, we could end up replacing it at runtime.
  • Loading branch information
maleadt committed Nov 22, 2019
1 parent 2fa3e56 commit 4ece13c
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/Flux.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 4ece13c

Please sign in to comment.