From fa18f3dc5525867778c681498568ea79bd98f2cf Mon Sep 17 00:00:00 2001 From: Tim Besard Date: Wed, 17 Mar 2021 08:54:02 +0100 Subject: [PATCH] Clean-up version checks. --- deps/compatibility.jl | 5 ----- examples/wmma/high-level.jl | 6 ------ examples/wmma/low-level.jl | 6 ------ src/CUDA.jl | 2 +- src/array.jl | 6 ------ src/compiler/execution.jl | 6 +----- src/device/intrinsics.jl | 2 +- src/mapreduce.jl | 6 ------ test/exceptions.jl | 6 +----- test/execution.jl | 2 -- test/runtests.jl | 2 +- 11 files changed, 5 insertions(+), 44 deletions(-) diff --git a/deps/compatibility.jl b/deps/compatibility.jl index a2aefee90c..b4dfd146d5 100644 --- a/deps/compatibility.jl +++ b/deps/compatibility.jl @@ -175,11 +175,6 @@ end ## high-level functions that return target and isa support function llvm_compat(version=LLVM.version()) - # https://github.com/JuliaGPU/CUDAnative.jl/issues/428 - if version >= v"8.0" && VERSION < v"1.3.0-DEV.547" - error("LLVM 8.0 requires a newer version of Julia") - end - InitializeNVPTXTarget() cap_support = sort(collect(llvm_cap_support(version))) diff --git a/examples/wmma/high-level.jl b/examples/wmma/high-level.jl index 98dd28fc8d..bfc1c46d30 100644 --- a/examples/wmma/high-level.jl +++ b/examples/wmma/high-level.jl @@ -1,9 +1,3 @@ -# Need https://github.com/JuliaLang/julia/pull/33970 -# and https://github.com/JuliaLang/julia/pull/34043 -if VERSION < v"1.5-" - exit() -end - using CUDA if capability(device()) < v"7.0" exit() diff --git a/examples/wmma/low-level.jl b/examples/wmma/low-level.jl index 0424bbae9f..fe41512e2e 100644 --- a/examples/wmma/low-level.jl +++ b/examples/wmma/low-level.jl @@ -1,9 +1,3 @@ -# Need https://github.com/JuliaLang/julia/pull/33970 -# and https://github.com/JuliaLang/julia/pull/34043 -if VERSION < v"1.5-" - exit() -end - using CUDA if capability(device()) < v"7.0" exit() diff --git a/src/CUDA.jl b/src/CUDA.jl index f51f125c8f..34d43fef3b 100644 --- a/src/CUDA.jl +++ b/src/CUDA.jl @@ -25,7 +25,7 @@ using ExprTools const ci_cache = GPUCompiler.CodeCache() -@static if VERSION >= v"1.7-" +@static if isdefined(Base.Experimental, Symbol("@overlay")) Base.Experimental.@MethodTable(method_table) else const method_table = nothing diff --git a/src/array.jl b/src/array.jl index 6dcf41427c..57e20abd98 100644 --- a/src/array.jl +++ b/src/array.jl @@ -476,12 +476,6 @@ function Base.reshape(a::CuArray{T,M}, dims::NTuple{N,Int}) where {T,N,M} return b end -# allow missing dimensions with Colon() -if VERSION < v"1.6.0-DEV.1358" -Base.reshape(parent::CuArray, dims::Tuple{Vararg{Union{Int,Colon}}}) = - Base.reshape(parent, Base._reshape_uncolon(parent, dims)) -end - ## reinterpret diff --git a/src/compiler/execution.jl b/src/compiler/execution.jl index cbb9f7f550..e136e5d4c4 100644 --- a/src/compiler/execution.jl +++ b/src/compiler/execution.jl @@ -166,11 +166,7 @@ AbstractKernel args = (:F, (:( args[$i] ) for i in 1:length(args))...) # filter out arguments that shouldn't be passed - predicate = if VERSION >= v"1.5.0-DEV.581" - dt -> isghosttype(dt) || Core.Compiler.isconstType(dt) - else - dt -> isghosttype(dt) - end + predicate = dt -> isghosttype(dt) || Core.Compiler.isconstType(dt) to_pass = map(!predicate, sig.parameters) call_t = Type[x[1] for x in zip(sig.parameters, to_pass) if x[2]] call_args = Union{Expr,Symbol}[x[1] for x in zip(args, to_pass) if x[2]] diff --git a/src/device/intrinsics.jl b/src/device/intrinsics.jl index ba809ccb03..33abcb3493 100644 --- a/src/device/intrinsics.jl +++ b/src/device/intrinsics.jl @@ -6,7 +6,7 @@ macro device_override(ex) code = quote $GPUCompiler.@override($method_table, $ex) end - if VERSION >= v"1.7-" + if isdefined(Base.Experimental, Symbol("@overlay")) return esc(code) else overrides = getfield(__module__, :overrides) diff --git a/src/mapreduce.jl b/src/mapreduce.jl index fcf8b1ef2a..8965f26b52 100644 --- a/src/mapreduce.jl +++ b/src/mapreduce.jl @@ -131,12 +131,6 @@ end ## COV_EXCL_STOP -if VERSION < v"1.5.0-DEV.748" - Base.axes(bc::Base.Broadcast.Broadcasted{<:CuArrayStyle, <:NTuple{N}}, - d::Integer) where N = - d <= N ? axes(bc)[d] : Base.OneTo(1) -end - function GPUArrays.mapreducedim!(f::F, op::OP, R::AnyCuArray{T}, A::Union{AbstractArray,Broadcast.Broadcasted}; init=nothing) where {F, OP, T} diff --git a/test/exceptions.jl b/test/exceptions.jl index 5198c93478..ed8d4bd8b1 100644 --- a/test/exceptions.jl +++ b/test/exceptions.jl @@ -54,11 +54,7 @@ let (code, out, err) = julia_script(script, `-g2`) occursin("ERROR: CUDA error: an illegal instruction was encountered", err) || occursin("ERROR: CUDA error: unspecified launch failure", err) @test occursin(r"ERROR: a \w+ was thrown during kernel execution", out) - if VERSION < v"1.3.0-DEV.270" - @test occursin("[1] Type at float.jl", out) - else - @test occursin("[1] Int64 at float.jl", out) - end + @test occursin("[1] Int64 at float.jl", out) @test occursin("[4] kernel at none:5", out) end diff --git a/test/execution.jl b/test/execution.jl index 093f6f7b6c..9b7a63ddaa 100644 --- a/test/execution.jl +++ b/test/execution.jl @@ -854,7 +854,6 @@ end @test out == "Hello, World!" end -if VERSION >= v"1.1" # behavior of captured variables (box or not) has improved over time @testset "closures" begin function hello() x = 1 @@ -869,7 +868,6 @@ if VERSION >= v"1.1" # behavior of captured variables (box or not) has improved end @test out == "Hello, World 1!" end -end @testset "argument passing" begin ## padding diff --git a/test/runtests.jl b/test/runtests.jl index f492e9deba..3206b346d8 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -163,7 +163,7 @@ if !has_cutensor() || CUDA.version() < v"10.1" || first(picks).cap < v"7.0" push!(skip_tests, "cutensor") end is_debug = ccall(:jl_is_debugbuild, Cint, ()) != 0 -if VERSION < v"1.5-" || first(picks).cap < v"7.0" +if first(picks).cap < v"7.0" push!(skip_tests, "device/wmma") end if Sys.ARCH == :aarch64