Skip to content

Commit 822abde

Browse files
Kernel rand benchmark (#689)
1 parent 7a00e02 commit 822abde

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

perf/kernel.jl

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,9 @@ function checked_indexing_kernel(dest, src)
2626
end
2727
group["indexing_checked"] = @async_benchmarkable @metal threads=size(src,1) groups=size(src,2) $checked_indexing_kernel($dest, $src)
2828

29-
## DELETE
30-
# function rand_kernel(dest::AbstractArray{T}) where {T}
31-
# i = thread_position_in_grid().x
32-
# dest[i] = Metal.rand(T)
33-
# return
34-
# end
35-
# group["rand"] = @async_benchmarkable @metal threads=size(src,1) groups=size(src,2) $rand_kernel($dest)
29+
function rand_kernel(dest::AbstractArray{T}) where {T}
30+
i = thread_position_in_grid().x
31+
dest[i] = rand(T)
32+
return
33+
end
34+
group["rand"] = @async_benchmarkable @metal threads=size($dest,1) groups=size($dest,2) $rand_kernel($dest)

0 commit comments

Comments
 (0)