/* naive_o0.c - deliberately simple C. The Makefile compiles THIS FILE ONLY at -O0 * so it is a true "unoptimized" baseline (variant 1) and the exact INT8 reference. */ #include "kernels.h" void matvec_f32_naive(const float *W, const float *x, float *y, int rows, int cols) { for (int r = 0; r < rows; r++) { float acc = 0.0f; for (int c = 0; c < cols; c++) acc += W[(long)r * cols + c] * x[c]; y[r] = acc; } } void matvec_i8_naive(const int8_t *W, const int8_t *x, int32_t *y, int rows, int cols) { for (int r = 0; r < rows; r++) { int32_t acc = 0; for (int c = 0; c < cols; c++) acc += (int32_t)W[(long)r * cols + c] * (int32_t)x[c]; y[r] = acc; } }