Shared utilities for wgblas benchmark scripts — a JS module and a parallel C header covering the same operations for the cuBLAS benchmarks.
helpers.mjs
Used by every benchmarks/<routine>/benchmark.<routine>.js for timing, result persistence, and table formatting.
benchmarks/<routine>/benchmark.<routine>.js
helpers.h
A header-only C counterpart used by every benchmarks/<routine>/cuda/benchmark.c. All functions are static so each translation unit gets its own copy.
benchmarks/<routine>/cuda/benchmark.c
static
get_gpu_model
(char *dst, int maxlen) → void
dst
getGpuModel()
random_float_array
(int n, float low, float high) → float*
n
[low, high]
free()
median
(float *arr, int n) → float
arr
save_results
(const char *routine, const char *gpu_model, int *sizes, float *med_times, float *gbs_vals, int n) → void
benchmarks/results/<gpu>/cuda/<routine>.json
saveResults()
Shared utilities for wgblas benchmark scripts — a JS module and a parallel C header covering the same operations for the cuBLAS benchmarks.
JS —
helpers.mjsUsed by every
benchmarks/<routine>/benchmark.<routine>.jsfor timing, result persistence, and table formatting.C —
helpers.hA header-only C counterpart used by every
benchmarks/<routine>/cuda/benchmark.c. All functions arestaticso each translation unit gets its own copy.get_gpu_model(char *dst, int maxlen) → voiddstwith the CUDA device name normalised to the same slug format asgetGpuModel()random_float_array(int n, float low, float high) → float*nrandom floats in[low, high]; caller mustfree()median(float *arr, int n) → floatarr; copies before sorting so original is unchangedsave_results(const char *routine, const char *gpu_model, int *sizes, float *med_times, float *gbs_vals, int n) → voidbenchmarks/results/<gpu>/cuda/<routine>.jsonin the same schema assaveResults()