Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions test/Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ GPUCompiler = "61eb1bfa-7361-4325-ad38-22787b887f55"
InteractiveUtils = "b77e0a4c-d291-57a0-90e8-8db25a27a240"
LLVM = "929cbde3-209d-540e-8aea-75f648917ca0"
LLVMDowngrader_jll = "f52de702-fb25-5922-94ba-81dd59b07444"
LLVM_jll = "86de99a1-58d6-5da7-8064-bd56ce2e322c"
Logging = "56ddb016-857b-54e1-b83d-db4d58db5568"
NVPTX_LLVM_Backend_jll = "ef6e0fe3-e6ef-59c0-bde6-4989574699e0"
ParallelTestRunner = "d3525ed8-44d0-4b2c-a655-542cee43accc"
Expand All @@ -21,5 +20,4 @@ demumble_jll = "1e29f10c-031c-5a83-9565-69cddfc27673"

[compat]
Aqua = "0.8"
LLVM_jll = "15,16,18,20"
ParallelTestRunner = "2"
11 changes: 5 additions & 6 deletions test/gcn.jl
Original file line number Diff line number Diff line change
Expand Up @@ -458,20 +458,19 @@ end
@testset "float boxes" begin
mod = @eval module $(gensym())
function kernel(a,b)
# Int32(a) may fail, boxing the Float32 for the @nospecialize ctor
c = Int32(a)
# the conversion to Int32 may fail, in which case the input Float32 is boxed in order to
# pass it to the @nospecialize exception constructor. we should really avoid that (eg.
# by avoiding @nospecialize, or optimize the unused arguments away), but for now the box
# should just work.
unsafe_store!(b, c)
return
end
end

@test @filecheck begin
@check_label "define void @{{(julia|j)_kernel_[0-9]+}}"
@check "jl_box_float32"
GCN.code_llvm(mod.kernel, Tuple{Float32,Ptr{Float32}})
# box: a jl_box_float32 call <1.14; 1.14+ inlines it into the devirt'd ctor
@check cond=(VERSION < v"1.14-") "jl_box_float32"
@check cond=(VERSION >= v"1.14-") "gpu_gc_pool_alloc"
GCN.code_llvm(mod.kernel, Tuple{Float32,Ptr{Float32}}; dump_module=true)
end
GCN.code_native(devnull, mod.kernel, Tuple{Float32,Ptr{Float32}})
end
Expand Down
11 changes: 5 additions & 6 deletions test/ptx.jl
Original file line number Diff line number Diff line change
Expand Up @@ -371,20 +371,19 @@ end
@testset "float boxes" begin
mod = @eval module $(gensym())
function kernel(a,b)
# Int32(a) may fail, boxing the Float32 for the @nospecialize ctor
c = Int32(a)
# the conversion to Int32 may fail, in which case the input Float32 is boxed in
# order to pass it to the @nospecialize exception constructor. we should really
# avoid that (eg. by avoiding @nospecialize, or optimize the unused arguments
# away), but for now the box should just work.
unsafe_store!(b, c)
return
end
end

@test @filecheck begin
@check_label "define void @{{(julia|j)_kernel_[0-9]+}}"
@check "jl_box_float32"
PTX.code_llvm(mod.kernel, Tuple{Float32,Ptr{Float32}})
# box: a jl_box_float32 call <1.14; 1.14+ inlines it into the devirt'd ctor
@check cond=(VERSION < v"1.14-") "jl_box_float32"
@check cond=(VERSION >= v"1.14-") "gpu_gc_pool_alloc"
PTX.code_llvm(mod.kernel, Tuple{Float32,Ptr{Float32}}; dump_module=true)
end
PTX.code_native(devnull, mod.kernel, Tuple{Float32,Ptr{Float32}})
end
Expand Down