Skip to content

Commit

Permalink
Clean-up version checks.
Browse files Browse the repository at this point in the history
  • Loading branch information
maleadt committed Mar 17, 2021
1 parent 6f322bd commit bcf1b82
Show file tree
Hide file tree
Showing 11 changed files with 5 additions and 44 deletions.
5 changes: 0 additions & 5 deletions deps/compatibility.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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)))
Expand Down
6 changes: 0 additions & 6 deletions examples/wmma/high-level.jl
Original file line number Diff line number Diff line change
@@ -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()
Expand Down
6 changes: 0 additions & 6 deletions examples/wmma/low-level.jl
Original file line number Diff line number Diff line change
@@ -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()
Expand Down
2 changes: 1 addition & 1 deletion src/CUDA.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 0 additions & 6 deletions src/array.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
6 changes: 1 addition & 5 deletions src/compiler/execution.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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]]
Expand Down
2 changes: 1 addition & 1 deletion src/device/intrinsics.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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
push!(overrides.args, code)
Expand Down
6 changes: 0 additions & 6 deletions src/mapreduce.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down
6 changes: 1 addition & 5 deletions test/exceptions.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
2 changes: 0 additions & 2 deletions test/execution.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit bcf1b82

Please sign in to comment.