benchmarks.util
fn calculate_gflops_gemm #
fn calculate_gflops_gemm(m int, n int, k int, time_ns f64) f64
Calculate GFLOPS for matrix multiplication
fn calculate_gflops_gemv #
fn calculate_gflops_gemv(m int, n int, time_ns f64) f64
Calculate GFLOPS for matrix-vector multiplication
fn format_time #
fn format_time(ns f64) string
Format time in appropriate units
fn gflops_gemm_ms #
fn gflops_gemm_ms(m int, n int, k int, time_ms f64) f64
gflops_gemm_ms exposes this operation as part of the public API.
fn gflops_gemv_ms #
fn gflops_gemv_ms(m int, n int, time_ms f64) f64
gflops_gemv_ms exposes this operation as part of the public API.
fn mean_time_ms #
fn mean_time_ms(mut samples []f64) f64
mean_time_ms exposes this operation as part of the public API.
fn print_header #
fn print_header(title string)
Print benchmark header
fn print_result #
fn print_result(operation string, size string, time_ns f64, extra string)
Print benchmark result row
fn print_table_header #
fn print_table_header()
Print table header
fn print_vs_numpy_row #
fn print_vs_numpy_row(name string, size string, time_ms f64, extra string)
print_vs_numpy_row exposes this operation as part of the public API.
fn print_vs_numpy_table_header #
fn print_vs_numpy_table_header()
vs_numpy compact table (milliseconds + GFLOPS)
fn random_matrix #
fn random_matrix(m int, n int) [][]f64
Generate random matrix (row-major)
fn random_matrix_colmajor #
fn random_matrix_colmajor(m int, n int) []f64
Generate random matrix flattened (column-major for LAPACK)
fn random_positive_definite #
fn random_positive_definite(n int) []f64
Generate positive definite matrix (for Cholesky)
fn random_symmetric #
fn random_symmetric(n int) []f64
Generate symmetric matrix
fn random_vector #
fn random_vector(n int) []f64
Generate random vector
struct BenchmarkConfig #
struct BenchmarkConfig {
pub:
sizes []int
iterations int = 10
warmup_runs int = 3
}
Benchmark configuration
- fn calculate_gflops_gemm
- fn calculate_gflops_gemv
- fn format_time
- fn gflops_gemm_ms
- fn gflops_gemv_ms
- fn mean_time_ms
- fn print_header
- fn print_result
- fn print_table_header
- fn print_vs_numpy_row
- fn print_vs_numpy_table_header
- fn random_matrix
- fn random_matrix_colmajor
- fn random_positive_definite
- fn random_symmetric
- fn random_vector
- struct BenchmarkConfig