DEPRECATED!!! Instead, please consider using mPAPI which works for MATLAB and Octave.
Simple Octave API for PAPI (Performance Application Programming Interface).
- Install PAPI >=5.5.1
- Install package
liboctave-dev
if you don't have it already - Run
octave
in oPAPI directory - Compile
oPAPI_register
,oPAPI_tic
, andoPAPI_toc
functions from Octave console using mex:
mex -I/usr/local/include oPAPI_register.c -L/usr/local/lib/ -lpapi -output oPAPI_register
mex -I/usr/local/include oPAPI_tic.c -L/usr/local/lib/ -lpapi -output oPAPI_tic
mex -I/usr/local/include oPAPI_toc.c -L/usr/local/lib/ -lpapi -output oPAPI_toc
Where directory /usr/local/include
contains papi.h
header and directory /usr/local/lib/
contains libpapi.so
static library.
- Register hardware performance monitoring counters (PMC) using preset or native events:
>> oPAPI_register('FP_ARITH:SCALAR_SINGLE', 'L1D:REPLACEMENT', 'PAPI_L2_ICA')
- Start counters:
>> oPAPI_tic
- Read counters measurements:
>> oPAPI_toc
ans = [0 355 1698]
- The number of hardware counters available on the system defines the upper limit of counters you can register using
oPAPI_register
function. - Not all hardware counters can be mixed and used simultaneously.