Skip to content

Add a stable public interface for accessing the data underlying a BenchmarkResult #9

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 22, 2021
Merged
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
24 changes: 20 additions & 4 deletions src/BLASBenchmarksCPU.jl
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,27 @@ using BenchmarkTools, ProgressMeter
# Plotting & presenting results
using VegaLite, DataFrames

export benchmark_result_type
export benchmark_result_df
export benchmark_result_threaded
export logspace
export plot
export runbench

export runbench, logspace, plot, matmul!,
gemmmkl!, mkl_set_num_threads,
gemmopenblas!, openblas_set_num_threads,
gemmblis!, blis_set_num_threads
# BLIS
export gemmblis!
export blis_set_num_threads

# Octavian.jl
export matmul!

# OpenBLAS
export gemmopenblas!
export openblas_set_num_threads

# MKL
export gemmmkl!
export mkl_set_num_threads

# set threads
const libMKL = MKL_jll.libmkl_rt # more convenient name
Expand Down
25 changes: 23 additions & 2 deletions src/runbenchmark.jl
Original file line number Diff line number Diff line change
@@ -1,10 +1,31 @@

struct BenchmarkResult{T}
df::DataFrame
threaded::Bool
end

"""
benchmark_result_type(benchmark_result::BenchmarkResult)
"""
function benchmark_result_type(::BenchmarkResult{T}) where {T}
return T
end

"""
benchmark_result_df(benchmark_result::BenchmarkResult)
"""
function benchmark_result_df(benchmark_result::BenchmarkResult)
return deepcopy(benchmark_result.df)
end

"""
benchmark_result_threaded(benchmark_result::BenchmarkResult)
"""
function benchmark_result_threaded(benchmark_result::BenchmarkResult)
return benchmark_result.threaded
end

function Base.show(io::IO, br::BenchmarkResult{T}) where {T}
println(io, "Bennchmark Result of Matrix{$T}, threads = $(br.threaded)")
println(io, "Bennchmark Result of Matrix{$T}, threaded = $(br.threaded)")
println(io, br.df)
end

Expand Down