From 4ece13c6491059eee466e32d8506193c69184880 Mon Sep 17 00:00:00 2001 From: Tim Besard Date: Fri, 22 Nov 2019 18:03:51 +0100 Subject: [PATCH] Don't include the CUDA module during precompilation. If we do, we could end up replacing it at runtime. --- src/Flux.jl | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/Flux.jl b/src/Flux.jl index d0e0d5bf0f..905cb63869 100644 --- a/src/Flux.jl +++ b/src/Flux.jl @@ -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