Skip to content

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 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