Parolin 0.7.9 6796
Console (soon DLLs) to do a tar like job
Loading...
Searching...
No Matches
benchfn.c File Reference
#include <stdlib.h>
#include <string.h>
#include <assert.h>
#include "timefn.h"
#include "benchfn.h"

Data Structures

struct  BMK_timedFnState_s
 

Macros

#define TIMELOOP_MICROSEC   SEC_TO_MICRO /* 1 second */
 
#define TIMELOOP_NANOSEC   (1*1000000000ULL) /* 1 second */
 
#define KB   *(1 <<10)
 
#define MB   *(1 <<20)
 
#define GB   *(1U<<30)
 
#define DEBUGOUTPUT(...)
 
#define RETURN_QUIET_ERROR(retValue, ...)
 
#define CONTROL(c)
 
#define MIN(a, b)
 
#define MINUSABLETIME   (TIMELOOP_NANOSEC / 2) /* 0.5 seconds */
 

Functions

int BMK_isSuccessful_runOutcome (BMK_runOutcome_t outcome)
 
BMK_runTime_t BMK_extract_runTime (BMK_runOutcome_t outcome)
 
size_t BMK_extract_errorResult (BMK_runOutcome_t outcome)
 
BMK_runOutcome_t BMK_benchFunction (BMK_benchParams_t p, unsigned nbLoops)
 
BMK_timedFnState_tBMK_createTimedFnState (unsigned total_ms, unsigned run_ms)
 
void BMK_freeTimedFnState (BMK_timedFnState_t *state)
 
BMK_timedFnState_tBMK_initStatic_timedFnState (void *buffer, size_t size, unsigned total_ms, unsigned run_ms)
 
void BMK_resetTimedFnState (BMK_timedFnState_t *timedFnState, unsigned total_ms, unsigned run_ms)
 
int BMK_isCompleted_TimedFn (const BMK_timedFnState_t *timedFnState)
 
BMK_runOutcome_t BMK_benchTimedFn (BMK_timedFnState_t *cont, BMK_benchParams_t p)
 

Macro Definition Documentation

◆ CONTROL

#define CONTROL ( c)
Value:
{ if (!(c)) { DEBUGOUTPUT("error: %s \n", #c); abort(); } }
#define c(i)
Definition sha256.c:43
#define DEBUGOUTPUT(...)
Definition benchfn.c:43

◆ DEBUGOUTPUT

#define DEBUGOUTPUT ( ...)

◆ GB

#define GB   *(1U<<30)

◆ KB

#define KB   *(1 <<10)

◆ MB

#define MB   *(1 <<20)

◆ MIN

#define MIN ( a,
b )
Value:
( (a) < (b) ? (a) : (b) )
#define b(i)
Definition sha256.c:42
#define a(i)
Definition sha256.c:41

◆ MINUSABLETIME

#define MINUSABLETIME   (TIMELOOP_NANOSEC / 2) /* 0.5 seconds */

◆ RETURN_QUIET_ERROR

#define RETURN_QUIET_ERROR ( retValue,
... )
Value:
{ \
DEBUGOUTPUT("%s: %i: \n", __FILE__, __LINE__); \
DEBUGOUTPUT("Error : "); \
DEBUGOUTPUT(__VA_ARGS__); \
DEBUGOUTPUT(" \n"); \
return retValue; \
}

◆ TIMELOOP_MICROSEC

#define TIMELOOP_MICROSEC   SEC_TO_MICRO /* 1 second */

◆ TIMELOOP_NANOSEC

#define TIMELOOP_NANOSEC   (1*1000000000ULL) /* 1 second */

Function Documentation

◆ BMK_benchFunction()

BMK_runOutcome_t BMK_benchFunction ( BMK_benchParams_t p,
unsigned nbLoops )

◆ BMK_benchTimedFn()

BMK_runOutcome_t BMK_benchTimedFn ( BMK_timedFnState_t * cont,
BMK_benchParams_t p )

◆ BMK_createTimedFnState()

BMK_timedFnState_t * BMK_createTimedFnState ( unsigned total_ms,
unsigned run_ms )

◆ BMK_extract_errorResult()

size_t BMK_extract_errorResult ( BMK_runOutcome_t outcome)

◆ BMK_extract_runTime()

BMK_runTime_t BMK_extract_runTime ( BMK_runOutcome_t outcome)

◆ BMK_freeTimedFnState()

void BMK_freeTimedFnState ( BMK_timedFnState_t * state)

◆ BMK_initStatic_timedFnState()

BMK_timedFnState_t * BMK_initStatic_timedFnState ( void * buffer,
size_t size,
unsigned total_ms,
unsigned run_ms )

◆ BMK_isCompleted_TimedFn()

int BMK_isCompleted_TimedFn ( const BMK_timedFnState_t * timedFnState)

◆ BMK_isSuccessful_runOutcome()

int BMK_isSuccessful_runOutcome ( BMK_runOutcome_t outcome)

◆ BMK_resetTimedFnState()

void BMK_resetTimedFnState ( BMK_timedFnState_t * timedFnState,
unsigned total_ms,
unsigned run_ms )