@@ -5,16 +5,16 @@ const n = 1000
55
66# generate some arrays
77cpu_mat = rand (rng, Float32, m, n)
8- gpu_mat = CuArray {Float32} (undef, size (cpu_mat))
8+ gpu_mat = MtlArray {Float32} (undef, size (cpu_mat))
99gpu_vec = reshape (gpu_mat, length (gpu_mat))
1010gpu_arr_3d = reshape (gpu_mat, (m, 40 , 25 ))
1111gpu_arr_4d = reshape (gpu_mat, (m, 10 , 10 , 10 ))
12- gpu_mat_ints = CuArray (rand (rng, Int, m, n))
12+ gpu_mat_ints = MtlArray (rand (rng, Int, m, n))
1313gpu_vec_ints = reshape (gpu_mat_ints, length (gpu_mat_ints))
14- gpu_mat_bools = CuArray (rand (rng, Bool, m, n))
14+ gpu_mat_bools = MtlArray (rand (rng, Bool, m, n))
1515gpu_vec_bools = reshape (gpu_mat_bools, length (gpu_mat_bools))
1616
17- group[" construct" ] = @benchmarkable CuArray {Int} (undef, 1 )
17+ group[" construct" ] = @benchmarkable MtlArray {Int} (undef, 1 )
1818
1919group[" copy" ] = @async_benchmarkable copy ($ gpu_mat)
2020
@@ -26,7 +26,7 @@ let group = addgroup!(group, "copyto!")
2626end
2727
2828let group = addgroup! (group, " iteration" )
29- group[" scalar" ] = @benchmarkable CUDA . @allowscalar [$ gpu_vec[i] for i in 1 : 10 ]
29+ group[" scalar" ] = @benchmarkable Metal . @allowscalar [$ gpu_vec[i] for i in 1 : 10 ]
3030
3131 group[" logical" ] = @benchmarkable $ gpu_vec[$ gpu_vec_bools]
3232
@@ -46,12 +46,12 @@ let group = addgroup!(group, "iteration")
4646 end
4747end
4848
49- let group = addgroup! (group, " reverse" )
50- group[" 1d" ] = @async_benchmarkable reverse ($ gpu_vec)
51- group[" 2d" ] = @async_benchmarkable reverse ($ gpu_mat; dims= 1 )
52- group[" 1d_inplace" ] = @async_benchmarkable reverse! ($ gpu_vec)
53- group[" 2d_inplace" ] = @async_benchmarkable reverse! ($ gpu_mat; dims= 1 )
54- end
49+ # let group = addgroup!(group, "reverse")
50+ # group["1d"] = @async_benchmarkable reverse($gpu_vec)
51+ # group["2d"] = @async_benchmarkable reverse($gpu_mat; dims=1)
52+ # group["1d_inplace"] = @async_benchmarkable reverse!($gpu_vec)
53+ # group["2d_inplace"] = @async_benchmarkable reverse!($gpu_mat; dims=1)
54+ # end
5555
5656group[" broadcast" ] = @async_benchmarkable $ gpu_mat .= 0f0
5757
7777
7878let group = addgroup! (group, " random" )
7979 let group = addgroup! (group, " rand" )
80- group[" Float32" ] = @async_benchmarkable CUDA . rand (Float32, m* n)
81- group[" Int64" ] = @async_benchmarkable CUDA . rand (Int64, m* n)
80+ group[" Float32" ] = @async_benchmarkable Metal . rand (Float32, m* n)
81+ group[" Int64" ] = @async_benchmarkable Metal . rand (Int64, m* n)
8282 end
8383
8484 let group = addgroup! (group, " rand!" )
85- group[" Float32" ] = @async_benchmarkable CUDA . rand! ($ gpu_vec)
86- group[" Int64" ] = @async_benchmarkable CUDA . rand! ($ gpu_vec_ints)
85+ group[" Float32" ] = @async_benchmarkable Metal . rand! ($ gpu_vec)
86+ group[" Int64" ] = @async_benchmarkable Metal . rand! ($ gpu_vec_ints)
8787 end
8888
8989 let group = addgroup! (group, " randn" )
90- group[" Float32" ] = @async_benchmarkable CUDA . randn (Float32, m* n)
91- # group["Int64"] = @async_benchmarkable CUDA .randn(Int64, m*n)
90+ group[" Float32" ] = @async_benchmarkable Metal . randn (Float32, m* n)
91+ # group["Int64"] = @async_benchmarkable Metal .randn(Int64, m*n)
9292 end
9393
9494 let group = addgroup! (group, " randn!" )
95- group[" Float32" ] = @async_benchmarkable CUDA . randn! ($ gpu_vec)
96- # group["Int64"] = @async_benchmarkable CUDA .randn!($gpu_vec_ints)
95+ group[" Float32" ] = @async_benchmarkable Metal . randn! ($ gpu_vec)
96+ # group["Int64"] = @async_benchmarkable Metal .randn!($gpu_vec_ints)
9797 end
9898end
9999
100- let group = addgroup! (group, " sorting" )
101- group[" 1d" ] = @async_benchmarkable sort ($ gpu_vec)
102- group[" 2d" ] = @async_benchmarkable sort ($ gpu_mat; dims= 1 )
103- group[" by" ] = @async_benchmarkable sort ($ gpu_vec; by= sin)
104- end
100+ # let group = addgroup!(group, "sorting")
101+ # group["1d"] = @async_benchmarkable sort($gpu_vec)
102+ # group["2d"] = @async_benchmarkable sort($gpu_mat; dims=1)
103+ # group["by"] = @async_benchmarkable sort($gpu_vec; by=sin)
104+ # end
105105
106106let group = addgroup! (group, " permutedims" )
107107 group[" 2d" ] = @async_benchmarkable permutedims ($ gpu_mat, (2 ,1 ))
0 commit comments