Skip to content

Commit 25f4c0b

Browse files
committed
Add reverse benchmarks
1 parent 6b7e97c commit 25f4c0b

File tree

1 file changed

+11
-6
lines changed

1 file changed

+11
-6
lines changed

perf/array.jl

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -53,18 +53,23 @@ cpu_mat = rand(rng, Float32, m, n)
5353
gpu_mat = MtlMatrix{Float32}(cpu_mat)
5454
gpu_mat_long = MtlMatrix{Float32}(rand(rng, Float32, m_long, n_long))
5555
gpu_vec = reshape(gpu_mat, length(gpu_mat))
56+
gpu_vec_long = reshape(gpu_mat_long, length(gpu_mat_long))
5657
gpu_arr_3d = reshape(gpu_mat, (m, 40, 25))
5758
gpu_arr_4d = reshape(gpu_mat, (m, 10, 10, 10))
5859
gpu_mat_ints = MtlMatrix{Int64}(rand(rng, -10:10, m, n))
5960
gpu_mat_long_ints = MtlMatrix{Int64}(rand(rng, -10:10, m_long, n_long))
6061
gpu_vec_ints = reshape(gpu_mat_ints, length(gpu_mat_ints))
6162

62-
# let group = addgroup!(group, "reverse")
63-
# group["1d"] = @benchmarkable Metal.@sync reverse($gpu_vec)
64-
# group["2d"] = @benchmarkable Metal.@sync reverse($gpu_mat; dims=1)
65-
# group["1d_inplace"] = @benchmarkable Metal.@sync reverse!($gpu_vec)
66-
# group["2d_inplace"] = @benchmarkable Metal.@sync reverse!($gpu_mat; dims=1)
67-
# end
63+
let group = addgroup!(group, "reverse")
64+
group["1d"] = @benchmarkable Metal.@sync reverse($gpu_vec)
65+
group["1dL"] = @benchmarkable Metal.@sync reverse($gpu_vec_long)
66+
group["2d"] = @benchmarkable Metal.@sync reverse($gpu_mat; dims=1)
67+
group["2dL"] = @benchmarkable Metal.@sync reverse($gpu_mat_long; dims=1)
68+
group["1d_inplace"] = @benchmarkable Metal.@sync reverse!($gpu_vec)
69+
group["1dL_inplace"] = @benchmarkable Metal.@sync reverse!($gpu_vec_long)
70+
group["2d_inplace"] = @benchmarkable Metal.@sync reverse!($gpu_mat; dims=1)
71+
group["2dL_inplace"] = @benchmarkable Metal.@sync reverse!($gpu_mat_long; dims=2)
72+
end
6873

6974
# 'evals=1' added to prevent hang when running benchmarks of CI
7075
# TODO: Investigate cause and properly fix.

0 commit comments

Comments
 (0)