Skip to content

Commit a3792e6

Browse files
committed
Add a performance benchmark for rand() in a kernel.
[skip tests]
1 parent 4b55e73 commit a3792e6

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

perf/kernel.jl

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,3 +26,10 @@ function checked_indexing_kernel(dest, src)
2626
return
2727
end
2828
group["indexing_checked"] = @async_benchmarkable @cuda threads=size(src,1) blocks=size(src,2) $checked_indexing_kernel($dest, $src)
29+
30+
function rand_kernel(dest::AbstractArray{T}) where {T}
31+
i = (blockIdx().x-1) * blockDim().x + threadIdx().x
32+
dest[i] = rand(T)
33+
return
34+
end
35+
group["rand"] = @async_benchmarkable @cuda threads=size(src,1) blocks=size(src,2) $rand_kernel($dest)

0 commit comments

Comments
 (0)