Skip to content

Commit 830d51b

Browse files
authored
Bump minimal Julia requirement to v1.10. (#2447)
1 parent 33ed684 commit 830d51b

File tree

22 files changed

+49
-747
lines changed

22 files changed

+49
-747
lines changed

.buildkite/pipeline.yml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,6 @@ steps:
2929
matrix:
3030
setup:
3131
julia:
32-
- "1.8"
33-
- "1.9"
3432
- "1.10"
3533
- "1.11"
3634
- "nightly"
@@ -466,8 +464,6 @@ steps:
466464
matrix:
467465
setup:
468466
julia:
469-
- "1.8"
470-
- "1.9"
471467
- "1.10"
472468
- "1.11"
473469
timeout_in_minutes: 30

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -68,9 +68,9 @@ documentation](https://juliagpu.github.io/CUDA.jl/stable/).
6868

6969
## Requirements
7070

71-
The latest development version of CUDA.jl requires **Julia 1.8** or higher. If you are using
72-
an older version of Julia, you need to use a previous version of CUDA.jl. This will happen
73-
automatically when you install the package using Julia's package manager.
71+
The latest development version of CUDA.jl requires **Julia 1.10** or higher. If you are
72+
using an older version of Julia, you need to use a previous version of CUDA.jl. This will
73+
happen automatically when you install the package using Julia's package manager.
7474

7575
Note that CUDA.jl may not work with a custom build of Julia; it is recommended that you
7676
install Julia using the [official binaries](https://julialang.org/downloads/) or
@@ -107,7 +107,7 @@ root of this repository lists the relevant papers.
107107

108108
## Project Status
109109

110-
The package is tested against, and being developed for, Julia 1.8 and above. Main
110+
The package is tested against, and being developed for, Julia 1.10 and above. Main
111111
development and testing happens on x86 Linux, but the package is expected to work on
112112
Windows and ARM and as well.
113113

lib/cublas/CUBLAS.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,7 @@ function log_message(ptr)
236236
return
237237
end
238238

239-
@gcunsafe_callback function _log_message(blob)
239+
function _log_message(blob)
240240
# the message format isn't documented, but it looks like a message starts with a capital
241241
# and the severity (e.g. `I!`), and subsequent lines start with a lowercase mark (`!i`)
242242
#

lib/cublas/linalg.jl

Lines changed: 6 additions & 341 deletions
Large diffs are not rendered by default.

lib/cudadrv/occupancy.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ end
3636
# HACK: callback function for `launch_configuration` on platforms without support for
3737
# trampolines as used by `@cfunction` (JuliaLang/julia#27174, JuliaLang/julia#32154)
3838
_shmem_cb = nothing
39-
@gcunsafe_callback function _shmem_cint_cb(x::Cint)
39+
function _shmem_cint_cb(x::Cint)
4040
Cint(something(_shmem_cb)(x))
4141
end
4242
_shmem_cb_lock = Threads.ReentrantLock()
@@ -60,7 +60,7 @@ function launch_configuration(fun::CuFunction; shmem::Union{Integer,Base.Callabl
6060
if isa(shmem, Integer)
6161
cuOccupancyMaxPotentialBlockSize(blocks_ref, threads_ref, fun, C_NULL, shmem, max_threads)
6262
elseif Sys.ARCH == :x86 || Sys.ARCH == :x86_64
63-
@gcunsafe_callback function shmem_cint(threads)
63+
function shmem_cint(threads)
6464
Cint(shmem(threads))
6565
end
6666
cb = @cfunction($shmem_cint, Cint, (Cint,))

lib/cudadrv/synchronization.jl

Lines changed: 0 additions & 82 deletions
Original file line numberDiff line numberDiff line change
@@ -101,8 +101,6 @@ end
101101
# nonblocking sync
102102
#
103103

104-
@static if VERSION >= v"1.9.2"
105-
106104
# if we support foreign threads, perform the actual synchronization on a separate thread.
107105

108106
const SyncObject = Union{CuContext, CuStream, CuEvent}
@@ -222,83 +220,3 @@ function synchronize(event::CuEvent; blocking::Bool=false, spin::Bool=true)
222220
cuEventSynchronize(event)
223221
end
224222
end
225-
226-
else
227-
228-
# without thread adoption, have CUDA notify an async condition that wakes the libuv loop.
229-
# this is not ideal: stream callbacks are deprecated, and do not fire in case of errors.
230-
# furthermore, they do not trigger CUDA's synchronization hooks (see NVIDIA bug #3383169)
231-
# requiring us to perform the actual API call again after nonblocking synchronization.
232-
233-
function nonblocking_synchronize(stream::CuStream)
234-
# wait for an event signalled by CUDA
235-
event = Base.Event()
236-
launch(; stream) do
237-
notify(event)
238-
end
239-
240-
# if an error occurs, the callback may never fire, so use a timer to detect such cases
241-
dev = device()
242-
timer = Timer(0; interval=1)
243-
244-
Base.@sync begin
245-
Threads.@spawn try
246-
device!(dev)
247-
while true
248-
try
249-
Base.wait(timer)
250-
catch err
251-
err isa EOFError && break
252-
rethrow()
253-
end
254-
if isdone(stream)
255-
break
256-
end
257-
end
258-
finally
259-
notify(event)
260-
end
261-
262-
Threads.@spawn begin
263-
Base.wait(event)
264-
close(timer)
265-
end
266-
end
267-
268-
return
269-
end
270-
271-
function device_synchronize(; blocking::Bool=false, spin::Bool=true)
272-
if use_nonblocking_synchronization && !blocking
273-
stream = legacy_stream()
274-
if !spin || !spinning_synchronization(isdone, stream)
275-
nonblocking_synchronize(stream)
276-
end
277-
end
278-
maybe_collect(true)
279-
cuCtxSynchronize()
280-
281-
check_exceptions()
282-
end
283-
284-
function synchronize(stream::CuStream=stream(); blocking::Bool=false, spin::Bool=true)
285-
if use_nonblocking_synchronization && !blocking
286-
if !spin || !spinning_synchronization(isdone, stream)
287-
nonblocking_synchronize(stream)
288-
end
289-
end
290-
maybe_collect(true)
291-
cuStreamSynchronize(stream)
292-
293-
check_exceptions()
294-
end
295-
296-
function synchronize(event::CuEvent; blocking::Bool=false, spin::Bool=true)
297-
if use_nonblocking_synchronization && !blocking
298-
spin && spinning_synchronization(isdone, event)
299-
end
300-
maybe_collect(true)
301-
cuEventSynchronize(event)
302-
end
303-
304-
end

lib/cudnn/src/cuDNN.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ function log_message(sev, udata, dbg_ptr, ptr)
142142
return
143143
end
144144

145-
@gcunsafe_callback function _log_message(sev, dbg, str)
145+
function _log_message(sev, dbg, str)
146146
lines = split(str, '\0')
147147
msg = join(lines, '\n')
148148
if sev == CUDNN_SEV_INFO

lib/cupti/wrappers.jl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@ end
3333
# multiple subscribers aren't supported, so make sure we only call CUPTI once
3434
const callback_lock = ReentrantLock()
3535

36-
@gcunsafe_callback function callback(userdata::Ptr{Cvoid}, domain::CUpti_CallbackDomain,
37-
id::CUpti_CallbackId, data_ptr::Ptr{Cvoid})
36+
function callback(userdata::Ptr{Cvoid}, domain::CUpti_CallbackDomain,
37+
id::CUpti_CallbackId, data_ptr::Ptr{Cvoid})
3838
cfg = Base.unsafe_pointer_to_objref(userdata)::CallbackConfig
3939

4040
# decode the callback data
@@ -147,7 +147,7 @@ end
147147
const activity_lock = ReentrantLock()
148148
const activity_config = Ref{Union{Nothing,ActivityConfig}}(nothing)
149149

150-
@gcunsafe_callback function request_buffer(dest_ptr, sz_ptr, max_num_records_ptr)
150+
function request_buffer(dest_ptr, sz_ptr, max_num_records_ptr)
151151
# this function is called by CUPTI, but directly from the application, so it should be
152152
# fine to perform I/O or allocate memory here.
153153

@@ -178,7 +178,7 @@ const activity_config = Ref{Union{Nothing,ActivityConfig}}(nothing)
178178
return
179179
end
180180

181-
@gcunsafe_callback function complete_buffer(ctx_handle, stream_id, buf_ptr, sz, valid_sz)
181+
function complete_buffer(ctx_handle, stream_id, buf_ptr, sz, valid_sz)
182182
# this function is called by a CUPTI worker thread while our application may be waiting
183183
# for `cuptiActivityFlushAll` to complete. that means we cannot do I/O here, or we could
184184
# yield while the application cannot make any progress.

lib/cusolver/dense.jl

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -931,16 +931,14 @@ for elty in (:ComplexF32, :ComplexF64)
931931
end
932932
end
933933

934-
if VERSION >= v"1.10"
935-
for elty in (:Float32, :Float64)
936-
@eval begin
937-
LAPACK.syevd!(jobz::Char, uplo::Char, A::StridedCuMatrix{$elty}) = syevd!(jobz, uplo, A)
938-
end
934+
for elty in (:Float32, :Float64)
935+
@eval begin
936+
LAPACK.syevd!(jobz::Char, uplo::Char, A::StridedCuMatrix{$elty}) = syevd!(jobz, uplo, A)
939937
end
938+
end
940939

941-
for elty in (:ComplexF32, :ComplexF64)
942-
@eval begin
943-
LAPACK.syevd!(jobz::Char, uplo::Char, A::StridedCuMatrix{$elty}) = heevd!(jobz, uplo, A)
944-
end
940+
for elty in (:ComplexF32, :ComplexF64)
941+
@eval begin
942+
LAPACK.syevd!(jobz::Char, uplo::Char, A::StridedCuMatrix{$elty}) = heevd!(jobz, uplo, A)
945943
end
946944
end

lib/cusolver/linalg.jl

Lines changed: 4 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -185,24 +185,6 @@ CuMatrix{T}(Q::QRCompactWYQ) where {T} = error("QRCompactWY format is not suppor
185185
Matrix{T}(Q::QRPackedQ{S,<:CuArray,<:CuArray}) where {T,S} = Array(CuMatrix{T}(Q))
186186
Matrix{T}(Q::QRCompactWYQ{S,<:CuArray,<:CuArray}) where {T,S} = Array(CuMatrix{T}(Q))
187187

188-
if VERSION < v"1.10-"
189-
# extracting the full matrix can be done with `collect` (which defaults to `Array`)
190-
function Base.collect(src::Union{QRPackedQ{<:Any,<:CuArray,<:CuArray},
191-
QRCompactWYQ{<:Any,<:CuArray,<:CuArray}})
192-
dest = similar(src)
193-
copyto!(dest, I)
194-
lmul!(src, dest)
195-
collect(dest)
196-
end
197-
198-
# avoid the generic similar fallback that returns a CPU array
199-
Base.similar(Q::Union{QRPackedQ{<:Any,<:CuArray,<:CuArray},
200-
QRCompactWYQ{<:Any,<:CuArray,<:CuArray}},
201-
::Type{T}, dims::Dims{N}) where {T,N} =
202-
CuArray{T,N}(undef, dims)
203-
204-
end
205-
206188
function Base.getindex(Q::QRPackedQ{<:Any, <:CuArray}, ::Colon, j::Int)
207189
y = CUDA.zeros(eltype(Q), size(Q, 2))
208190
y[j] = 1
@@ -308,14 +290,10 @@ end
308290
## LU
309291

310292
function _check_lu_success(info, allowsingular)
311-
if VERSION >= v"1.11.0-DEV.1535"
312-
if info < 0 # zero pivot error from unpivoted LU
313-
LinearAlgebra.checknozeropivot(-info)
314-
else
315-
allowsingular || LinearAlgebra.checknonsingular(info)
316-
end
293+
if info < 0 # zero pivot error from unpivoted LU
294+
LinearAlgebra.checknozeropivot(-info)
317295
else
318-
LinearAlgebra.checknonsingular(info)
296+
allowsingular || LinearAlgebra.checknonsingular(info)
319297
end
320298
end
321299

@@ -333,10 +311,8 @@ function Base.getproperty(F::LU{T,<:StridedCuMatrix}, d::Symbol) where T
333311
L = tril!(getfield(F, :factors)[1:m, 1:min(m,n)])
334312
L[1:m+1:end] .= one(T) # set the diagonal (linear indexing trick)
335313
return L
336-
elseif VERSION >= v"1.9.0-DEV.1775"
337-
invoke(getproperty, Tuple{LU{T}, Symbol}, F, d)
338314
else
339-
invoke(getproperty, Tuple{LU{T,<:StridedMatrix}, Symbol}, F, d)
315+
invoke(getproperty, Tuple{LU{T}, Symbol}, F, d)
340316
end
341317
end
342318

0 commit comments

Comments
 (0)