Skip to content

Commit

Permalink
Run precompile workload with CUDA when functional
Browse files Browse the repository at this point in the history
As suggested by @vchuravy, we guard the CUDA precompilation with
`CUDA.functional()`.
  • Loading branch information
lcw committed May 10, 2024
1 parent 52e0cc1 commit 6481ee9
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions ext/RavenCUDAExt.jl
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,11 @@ CUDA.@device_override function Base.checkbounds(A::StaticArrays.MArray, I...)
end

PrecompileTools.@compile_workload let
for FT in (Float32, Float64)
AT = CuArray
Raven.precompile_workload(FT, AT)
if CUDA.functional()
for FT in (Float32, Float64)
AT = CuArray
Raven.precompile_workload(FT, AT)
end
end
end

Expand Down

0 comments on commit 6481ee9

Please sign in to comment.