Skip to content

Commit

Permalink
try new test approach for benchmark
Browse files Browse the repository at this point in the history
  • Loading branch information
Dale-Black committed Jun 25, 2024
1 parent 95a13fb commit f76e001
Show file tree
Hide file tree
Showing 2 changed files with 51 additions and 53 deletions.
52 changes: 0 additions & 52 deletions test/benchmarks.jl

This file was deleted.

52 changes: 51 additions & 1 deletion test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,54 @@ include("transform.jl")
include("utils.jl")

# Benchmark the transform function
include("benchmarks.jl")
@testset "Benchmarks" begin
s = 10 # number of samples
e = 1 # number of evals

# Create an array of input sizes to benchmark for 2D
sizes_2D = [2^i for i in 3:4]

# Create DataFrames to store the benchmark results
df_dt_2D = DataFrame(
os_info = os_info,
gpu_info = gpu_info,
sizes = sizes_2D,
dt_proposed = Float64[]
)

for n in sizes_2D
f = Float32.(rand([0, 1], n, n))

if dev != Array
f_dev = dev(f)
dt = @benchmark(transform($boolean_indicator($f_dev)); samples=s, evals=e)
push!(df_dt_2D, [os_info, gpu_info, n, minimum(dt).time])
end
end

# Create an array of input sizes to benchmark for 3D
sizes_3D = [2^i for i in 0:2]

# Create DataFrames to store the benchmark results
df_dt_3D = DataFrame(
os_info = os_info,
gpu_info = gpu_info,
sizes = sizes_3D,
dt_proposed = Float64[]
)

for n in sizes_3D
f = Float32.(rand([0, 1], n, n, n))

if dev != Array
f_dev = dev(f)
dt = @benchmark(transform($boolean_indicator($f_dev)); samples=s, evals=e)
push!(df_dt_3D, [os_info, gpu_info, n, minimum(dt).time])
end
end

# Show the dataframes
@info df_dt_2D
@info df_dt_3D
@test 1 == 1
end

0 comments on commit f76e001

Please sign in to comment.