Based on the work of Prof Lemire, this is an attempt to create a Zig library that can be imported in projects to profile code
I first ported Prof Lemire's code from C++ to C (because I absolutely hate C++ with a passion)
The sgemm_ref.c
file can be compiled and run with perf counting using:
gcc sgemm_ref.c -o sgemm_ref
sudo ./sgemm_ref
You will need sudo for accessing the Performance counters on ARM Macs.
The C header file m1pro_events.h
is portable across M2 (and M3 I presume) Macs as well, despite the m1
in the header name