From 3e2f10f00d46613899f4aba624fc02496e25cb30 Mon Sep 17 00:00:00 2001 From: Tim Besard Date: Mon, 12 Apr 2021 17:27:51 +0200 Subject: [PATCH] Test validation of GPU-only function. --- Manifest.toml | 8 ++++---- Project.toml | 2 +- test/device/intrinsics.jl | 15 +++++++++++++++ 3 files changed, 20 insertions(+), 5 deletions(-) diff --git a/Manifest.toml b/Manifest.toml index 3a5d3bd3e5..5b6529181e 100644 --- a/Manifest.toml +++ b/Manifest.toml @@ -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"] @@ -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"] diff --git a/Project.toml b/Project.toml index b19a8b5caa..e680b8ac78 100644 --- a/Project.toml +++ b/Project.toml @@ -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" diff --git a/test/device/intrinsics.jl b/test/device/intrinsics.jl index 2e0265b38f..e5cf244dff 100644 --- a/test/device/intrinsics.jl +++ b/test/device/intrinsics.jl @@ -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