Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions lib/mtl/capture.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions perf/Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
17 changes: 11 additions & 6 deletions perf/array.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
3 changes: 3 additions & 0 deletions perf/runbenchmarks.jl
Original file line number Diff line number Diff line change
@@ -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
Expand Down
1 change: 1 addition & 0 deletions test/Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
3 changes: 3 additions & 0 deletions test/runtests.jl
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
using Pkg
Pkg.add(url="https://github.com/christiangnrd/GPUArrays.jl", rev="reverse")

using Distributed
using Dates
using Metal
Expand Down