File tree Expand file tree Collapse file tree 5 files changed +15
-17
lines changed Expand file tree Collapse file tree 5 files changed +15
-17
lines changed Original file line number Diff line number Diff line change @@ -151,22 +151,21 @@ end
151
151
152
152
function __init__ ()
153
153
precompiling = ccall (:jl_generating_output , Cint, ()) != 0
154
- precompiling && return
155
154
156
155
CUDA. functional () || return
157
156
158
157
global libcudnn
159
158
if CUDA_Runtime == CUDA_Runtime_jll
160
159
if ! CUDNN_jll. is_available ()
161
- @error " cuDNN is not available for your platform ($(Base. BinaryPlatforms. triplet (CUDNN_jll. host_platform)) )"
160
+ precompiling || @error " cuDNN is not available for your platform ($(Base. BinaryPlatforms. triplet (CUDNN_jll. host_platform)) )"
162
161
return
163
162
end
164
163
libcudnn = CUDNN_jll. libcudnn
165
164
else
166
165
dirs = CUDA_Runtime. find_toolkit ()
167
166
path = CUDA_Runtime. get_library (dirs, " cudnn" ; optional= true )
168
167
if path === nothing
169
- @error " cuDNN is not available on your system (looked in $(join (dirs, " , " )) )"
168
+ precompiling || @error " cuDNN is not available on your system (looked in $(join (dirs, " , " )) )"
170
169
return
171
170
end
172
171
libcudnn = path
Original file line number Diff line number Diff line change @@ -103,22 +103,21 @@ end
103
103
104
104
function __init__ ()
105
105
precompiling = ccall (:jl_generating_output , Cint, ()) != 0
106
- precompiling && return
107
106
108
107
CUDA. functional () || return
109
108
110
109
global libcustatevec
111
110
if CUDA_Runtime == CUDA_Runtime_jll
112
111
if ! cuQuantum_jll. is_available ()
113
- @error " cuQuantum is not available for your platform ($(Base. BinaryPlatforms. triplet (cuQuantum_jll. host_platform)) )"
112
+ precompiling || @error " cuQuantum is not available for your platform ($(Base. BinaryPlatforms. triplet (cuQuantum_jll. host_platform)) )"
114
113
return
115
114
end
116
115
libcustatevec = cuQuantum_jll. libcustatevec
117
116
else
118
117
dirs = CUDA_Runtime. find_toolkit ()
119
118
path = CUDA_Runtime. get_library (dirs, " custatevec" ; optional= true )
120
119
if path === nothing
121
- @error " cuQuantum is not available on your system (looked for custatevec in $(join (dirs, " , " )) )"
120
+ precompiling || @error " cuQuantum is not available on your system (looked for custatevec in $(join (dirs, " , " )) )"
122
121
return
123
122
end
124
123
libcustatevec = path
Original file line number Diff line number Diff line change 87
87
88
88
function __init__ ()
89
89
precompiling = ccall (:jl_generating_output , Cint, ()) != 0
90
- precompiling && return
91
90
92
91
CUDA. functional () || return
93
92
94
93
global libcutensor
95
94
if CUDA_Runtime == CUDA_Runtime_jll
96
95
if ! CUTENSOR_jll. is_available ()
97
- @error " cuTENSOR is not available for your platform ($(Base. BinaryPlatforms. triplet (CUTENSOR_jll. host_platform)) )"
96
+ precompiling || @error " cuTENSOR is not available for your platform ($(Base. BinaryPlatforms. triplet (CUTENSOR_jll. host_platform)) )"
98
97
return
99
98
end
100
99
libcutensor = CUTENSOR_jll. libcutensor
101
100
else
102
101
dirs = CUDA_Runtime. find_toolkit ()
103
102
path = CUDA_Runtime. get_library (dirs, " cutensor" ; optional= true )
104
103
if path === nothing
105
- @error " cuTENSOR is not available on your system (looked in $(join (dirs, " , " )) )"
104
+ precompiling || @error " cuTENSOR is not available on your system (looked in $(join (dirs, " , " )) )"
106
105
return
107
106
end
108
107
libcutensor = path
Original file line number Diff line number Diff line change @@ -104,22 +104,21 @@ end
104
104
105
105
function __init__ ()
106
106
precompiling = ccall (:jl_generating_output , Cint, ()) != 0
107
- precompiling && return
108
107
109
108
CUDA. functional () || return
110
109
111
110
global libcutensornet
112
111
if CUDA_Runtime == CUDA_Runtime_jll
113
112
if ! cuQuantum_jll. is_available ()
114
- @error " cuQuantum is not available for your platform ($(Base. BinaryPlatforms. triplet (cuQuantum_jll. host_platform)) )"
113
+ precompiling || @error " cuQuantum is not available for your platform ($(Base. BinaryPlatforms. triplet (cuQuantum_jll. host_platform)) )"
115
114
return
116
115
end
117
116
libcutensornet = cuQuantum_jll. libcutensornet
118
117
else
119
118
dirs = CUDA_Runtime. find_toolkit ()
120
119
path = CUDA_Runtime. get_library (dirs, " cutensornet" ; optional= true )
121
120
if path === nothing
122
- @error " cuQuantum is not available on your system (looked for cutensornet in $(join (dirs, " , " )) )"
121
+ precompiling || @error " cuQuantum is not available on your system (looked for cutensornet in $(join (dirs, " , " )) )"
123
122
return
124
123
end
125
124
libcutensornet = path
Original file line number Diff line number Diff line change 30
30
31
31
function __init__ ()
32
32
precompiling = ccall (:jl_generating_output , Cint, ()) != 0
33
- precompiling && return
34
33
35
34
# TODO : make errors here (and in submodules/subpackages like cuBLAS and cuDNN) fatal,
36
35
# and remove functional(), once people sufficiently use weak dependencies.
@@ -124,12 +123,15 @@ function __init__()
124
123
end
125
124
126
125
# register device overrides
127
- eval (Expr (:block , overrides... ))
128
- empty! (overrides)
129
- @require SpecialFunctions= " 276daf66-3868-5448-9aa4-cd146d93841b" begin
130
- include (" device/intrinsics/special_math.jl" )
126
+ if ! precompiling
131
127
eval (Expr (:block , overrides... ))
132
128
empty! (overrides)
129
+
130
+ @require SpecialFunctions= " 276daf66-3868-5448-9aa4-cd146d93841b" begin
131
+ include (" device/intrinsics/special_math.jl" )
132
+ eval (Expr (:block , overrides... ))
133
+ empty! (overrides)
134
+ end
133
135
end
134
136
135
137
# ensure that operations executed by the REPL back-end finish before returning,
You can’t perform that action at this time.
0 commit comments