diff --git a/lib/mtl/capture.jl b/lib/mtl/capture.jl index bb8744eb8..c2c1a77ac 100644 --- a/lib/mtl/capture.jl +++ b/lib/mtl/capture.jl @@ -59,7 +59,7 @@ function MTLCaptureDescriptor() end # TODO: Add capture state -function MTLCaptureDescriptor(obj::Union{MTLDevice,MTLCommandQueue, MTLCaptureScope}, +function MTLCaptureDescriptor(obj::Union{MTLDevice,MTLCommandQueue,MTLCaptureScope}, destination::MTLCaptureDestination; folder::String=nothing) desc = MTLCaptureDescriptor() @@ -110,7 +110,7 @@ end Start GPU frame capture using the default capture object and specifying capture descriptor parameters directly. """ -function startCapture(obj::Union{MTLDevice,MTLCommandQueue, MTLCaptureScope}, +function startCapture(obj::Union{MTLDevice,MTLCommandQueue,MTLCaptureScope}, destination::MTLCaptureDestination=MTLCaptureDestinationGPUTraceDocument; folder::String=nothing) if destination == MTLCaptureDestinationGPUTraceDocument && folder === nothing diff --git a/perf/Project.toml b/perf/Project.toml index decfbe75f..0661bd90f 100644 --- a/perf/Project.toml +++ b/perf/Project.toml @@ -3,5 +3,6 @@ BenchmarkTools = "6e4b80f9-dd63-53aa-95a3-0cdb28fa8baf" HTTP = "cd3eb016-35fb-5094-929b-558a96fad6f3" JSON = "682c06a0-de6a-54ab-a142-c8b1cf79cde6" Metal = "dde4c033-4e86-420c-a63e-0dd931031962" +Pkg = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f" StableRNGs = "860ef19b-820b-49d6-a774-d7a799459cd3" StaticArrays = "90137ffa-7385-5640-81b9-e52037218182" diff --git a/perf/array.jl b/perf/array.jl index 21cd4677c..008ab4d62 100644 --- a/perf/array.jl +++ b/perf/array.jl @@ -53,18 +53,23 @@ cpu_mat = rand(rng, Float32, m, n) gpu_mat = MtlMatrix{Float32}(cpu_mat) gpu_mat_long = MtlMatrix{Float32}(rand(rng, Float32, m_long, n_long)) gpu_vec = reshape(gpu_mat, length(gpu_mat)) +gpu_vec_long = reshape(gpu_mat_long, length(gpu_mat_long)) gpu_arr_3d = reshape(gpu_mat, (m, 40, 25)) gpu_arr_4d = reshape(gpu_mat, (m, 10, 10, 10)) gpu_mat_ints = MtlMatrix{Int64}(rand(rng, -10:10, m, n)) gpu_mat_long_ints = MtlMatrix{Int64}(rand(rng, -10:10, m_long, n_long)) gpu_vec_ints = reshape(gpu_mat_ints, length(gpu_mat_ints)) -# let group = addgroup!(group, "reverse") -# group["1d"] = @benchmarkable Metal.@sync reverse($gpu_vec) -# group["2d"] = @benchmarkable Metal.@sync reverse($gpu_mat; dims=1) -# group["1d_inplace"] = @benchmarkable Metal.@sync reverse!($gpu_vec) -# group["2d_inplace"] = @benchmarkable Metal.@sync reverse!($gpu_mat; dims=1) -# end +let group = addgroup!(group, "reverse") + group["1d"] = @benchmarkable Metal.@sync reverse($gpu_vec) + group["1dL"] = @benchmarkable Metal.@sync reverse($gpu_vec_long) + group["2d"] = @benchmarkable Metal.@sync reverse($gpu_mat; dims=1) + group["2dL"] = @benchmarkable Metal.@sync reverse($gpu_mat_long; dims=1) + group["1d_inplace"] = @benchmarkable Metal.@sync reverse!($gpu_vec) + group["1dL_inplace"] = @benchmarkable Metal.@sync reverse!($gpu_vec_long) + group["2d_inplace"] = @benchmarkable Metal.@sync reverse!($gpu_mat; dims=1) + group["2dL_inplace"] = @benchmarkable Metal.@sync reverse!($gpu_mat_long; dims=2) +end # 'evals=1' added to prevent hang when running benchmarks of CI # TODO: Investigate cause and properly fix. diff --git a/perf/runbenchmarks.jl b/perf/runbenchmarks.jl index 6e8434bc7..17bf4ea0d 100644 --- a/perf/runbenchmarks.jl +++ b/perf/runbenchmarks.jl @@ -1,5 +1,8 @@ # benchmark suite execution and codespeed submission +using Pkg +Pkg.add(url="https://github.com/christiangnrd/GPUArrays.jl", rev="reverse") + using Metal using BenchmarkTools diff --git a/test/Project.toml b/test/Project.toml index 4eef64770..589722cb2 100644 --- a/test/Project.toml +++ b/test/Project.toml @@ -12,6 +12,7 @@ KernelAbstractions = "63c18a36-062a-441e-b654-da1e3ab1ce7c" LLVM = "929cbde3-209d-540e-8aea-75f648917ca0" LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e" ObjectiveC = "e86c9b32-1129-44ac-8ea0-90d5bb39ded9" +Pkg = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f" Printf = "de0858da-6303-5e67-8744-51eddeeeb8d7" REPL = "3fa0cd96-eef1-5676-8a61-b3b8758bbffb" Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c" diff --git a/test/runtests.jl b/test/runtests.jl index 22268fb29..081fc280f 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -1,3 +1,6 @@ +using Pkg +Pkg.add(url="https://github.com/christiangnrd/GPUArrays.jl", rev="reverse") + using Distributed using Dates using Metal