Skip to content

Commit 108f6d1

Browse files
committed
Test GPUArrays reverse
[only benchmarks]
1 parent 12641d7 commit 108f6d1

File tree

5 files changed

+20
-6
lines changed

5 files changed

+20
-6
lines changed

perf/Project.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,6 @@ BenchmarkTools = "6e4b80f9-dd63-53aa-95a3-0cdb28fa8baf"
33
HTTP = "cd3eb016-35fb-5094-929b-558a96fad6f3"
44
JSON = "682c06a0-de6a-54ab-a142-c8b1cf79cde6"
55
Metal = "dde4c033-4e86-420c-a63e-0dd931031962"
6+
Pkg = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f"
67
StableRNGs = "860ef19b-820b-49d6-a774-d7a799459cd3"
78
StaticArrays = "90137ffa-7385-5640-81b9-e52037218182"

perf/array.jl

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -59,12 +59,18 @@ gpu_mat_ints = MtlMatrix{Int64}(rand(rng, -10:10, m, n))
5959
gpu_mat_long_ints = MtlMatrix{Int64}(rand(rng, -10:10, m_long, n_long))
6060
gpu_vec_ints = reshape(gpu_mat_ints, length(gpu_mat_ints))
6161

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
62+
let group = addgroup!(group, "reverse")
63+
group["1d"] = @benchmarkable Metal.@sync reverse($gpu_vec)
64+
group["dims=1"] = @benchmarkable Metal.@sync reverse($gpu_mat; dims=1)
65+
group["dims=2"] = @benchmarkable Metal.@sync reverse($gpu_mat; dims=2)
66+
group["dims=1L"] = @benchmarkable Metal.@sync reverse($gpu_mat_long; dims=1)
67+
group["dims=2L"] = @benchmarkable Metal.@sync reverse($gpu_mat_long; dims=2)
68+
group["1d_inplace"] = @benchmarkable Metal.@sync reverse!($gpu_vec)
69+
group["dims=1_inplace"] = @benchmarkable Metal.@sync reverse!($gpu_mat; dims=1)
70+
group["dims=2_inplace"] = @benchmarkable Metal.@sync reverse!($gpu_mat; dims=2)
71+
group["dims=1L_inplace"] = @benchmarkable Metal.@sync reverse!($gpu_mat_long; dims=1)
72+
group["dims=2L_inplace"] = @benchmarkable Metal.@sync reverse!($gpu_mat_long; dims=2)
73+
end
6874

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

perf/runbenchmarks.jl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
# benchmark suite execution and codespeed submission
22

3+
using Pkg
4+
Pkg.add(url="https://github.com/christiangnrd/GPUArrays.jl", rev="reverse")
5+
36
using Metal
47

58
using BenchmarkTools

test/Project.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ KernelAbstractions = "63c18a36-062a-441e-b654-da1e3ab1ce7c"
1111
LLVM = "929cbde3-209d-540e-8aea-75f648917ca0"
1212
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
1313
ObjectiveC = "e86c9b32-1129-44ac-8ea0-90d5bb39ded9"
14+
Pkg = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f"
1415
Printf = "de0858da-6303-5e67-8744-51eddeeeb8d7"
1516
REPL = "3fa0cd96-eef1-5676-8a61-b3b8758bbffb"
1617
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"

test/runtests.jl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
using Pkg
2+
Pkg.add(url="https://github.com/christiangnrd/GPUArrays.jl", rev="reverse")
3+
14
using Distributed
25
using Dates
36
using Metal

0 commit comments

Comments
 (0)