==> src/main.c <==1/* gemm as a native worker process under meshd. */
2#include "gemm.h"
3#include "mesh/ref/gemm.h"
4#include "mesh/worker.h"
5
6#include <stdio.h>
7#include <stdlib.h>
8
9int main(void) {
10 /* Warm the kernel and the pages once before meshd hears `ready`. */
11 float *a = malloc(sizeof(float) * 64 * 64), *b = malloc(sizeof(float) * 64 * 64), *c = malloc(sizeof(float) * 64 * 64);
12 if (a && b && c) {
13 mesh_gemm_inputs(64, a, b);
14 gemm_fast(64, a, b, c, false);
15 }
16 free(a), free(b), free(c);
17 fprintf(stderr, "gemm: blocked C (4x16 tiles), %zu threads\n", gemm_threads());
18 static const mesh_worker_program p = {gemm_init, gemm_task, NULL};
19 mesh_worker_run(&p);
20}