Skip to content

Commit

Permalink
Test validation of GPU-only function.
Browse files Browse the repository at this point in the history
  • Loading branch information
maleadt committed Apr 12, 2021
1 parent 27520e6 commit 3e2f10f
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 5 deletions.
8 changes: 4 additions & 4 deletions Manifest.toml
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,9 @@ version = "0.9.37"

[[Compat]]
deps = ["Base64", "Dates", "DelimitedFiles", "Distributed", "InteractiveUtils", "LibGit2", "Libdl", "LinearAlgebra", "Markdown", "Mmap", "Pkg", "Printf", "REPL", "Random", "SHA", "Serialization", "SharedArrays", "Sockets", "SparseArrays", "Statistics", "Test", "UUIDs", "Unicode"]
git-tree-sha1 = "4fecfd5485d3c5de4003e19f00c6898cccd40667"
git-tree-sha1 = "ac4132ad78082518ec2037ae5770b6e796f7f956"
uuid = "34da2185-b29b-5c13-b0c7-acf172513d20"
version = "3.26.0"
version = "3.27.0"

[[CompilerSupportLibraries_jll]]
deps = ["Artifacts", "Libdl"]
Expand Down Expand Up @@ -83,9 +83,9 @@ version = "6.2.2"

[[GPUCompiler]]
deps = ["DataStructures", "ExprTools", "InteractiveUtils", "LLVM", "Libdl", "Logging", "Scratch", "Serialization", "TimerOutputs", "UUIDs"]
git-tree-sha1 = "a5a239b8c688f59872eb689edd75395e97cc6641"
git-tree-sha1 = "7f13030524614d90c876332c980fd1edef2331e8"
uuid = "61eb1bfa-7361-4325-ad38-22787b887f55"
version = "0.11.2"
version = "0.11.3"

[[InteractiveUtils]]
deps = ["Markdown"]
Expand Down
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ CEnum = "0.2, 0.3, 0.4"
DataStructures = "0.17, 0.18"
ExprTools = "0.1"
GPUArrays = "6.1.0"
GPUCompiler = "0.11.1"
GPUCompiler = "0.11.3"
LLVM = "3"
MacroTools = "0.5"
Memoize = "0.4"
Expand Down
15 changes: 15 additions & 0 deletions test/device/intrinsics.jl
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,21 @@ end
@test testf(a->op.(a, T(2)), T[-1])
end
end

@testset "rsqrt" begin
# GPUCompiler.jl#173: a CUDA-only device function fails to validate
function kernel(a)
a[] = CUDA.rsqrt(a[])
return
end

# make sure this test uses an actual device function
@test_throws ErrorException kernel(ones(1))

a = CuArray{Float32}([4])
@cuda kernel(a)
@test Array(a) == [0.5]
end
end


Expand Down

0 comments on commit 3e2f10f

Please sign in to comment.