Embedded Artistry Framework
Embedded Systems C++ Framework
Classes | Macros | Functions | Variables
libm-bench.cpp File Reference
#include <math.h>
#include <time.h>
#include <stdio.h>
#include <stdlib.h>
Include dependency graph for libm-bench.cpp:

Classes

class  stimer
 

Macros

#define TFUN1(FNAME)
 
#define TFUN2(FNAME)
 
#define TCALL(FNAME)   test_##FNAME(20000)
 

Functions

double sec2mps (double s, long n)
 
int main (int argc, char *argv[])
 

Variables

const long ARR_LEN = 1024
 
double a [ARR_LEN]
 
double b [ARR_LEN]
 
double r [ARR_LEN]
 

Macro Definition Documentation

◆ TCALL

#define TCALL (   FNAME)    test_##FNAME(20000)

◆ TFUN1

#define TFUN1 (   FNAME)
Value:
void test_##FNAME(long n) { \
for (int j = 0; j < ARR_LEN; ++j) r[j] = FNAME(a[j]); \
stimer tm; \
stimer::time_type t0 = tm.current(); \
for(int i = 0; i < n; ++i) { \
for (int j = 0; j < ARR_LEN; ++j) r[j] = FNAME(a[j]); \
} \
double s = tm.span(t0, tm.current()); \
double mps = sec2mps(s, n * ARR_LEN); \
printf(" %-8s: %7.4f MPS\n", #FNAME, mps); }
double a[ARR_LEN]
Definition: libm-bench.cpp:74
timespec time_type
Definition: libm-bench.cpp:47
static const double t0
Definition: e_lgamma_r.c:111
double r[ARR_LEN]
Definition: libm-bench.cpp:76
static const char * s[]
Definition: heapsort.c:22
const long ARR_LEN
Definition: libm-bench.cpp:72
static int n[]
Definition: heapsort.c:32
Definition: time.h:41
double sec2mps(double s, long n)
Definition: libm-bench.cpp:66

◆ TFUN2

#define TFUN2 (   FNAME)
Value:
void test_##FNAME(long n) { \
for (int j = 0; j < ARR_LEN; ++j) r[j] = FNAME(a[j], b[j]); \
stimer tm; \
stimer::time_type t0 = tm.current(); \
for(int i = 0; i < n; ++i) { \
for (int j = 0; j < ARR_LEN; ++j) r[j] = FNAME(a[j], b[j]); \
} \
double s = tm.span(t0, tm.current()); \
double mps = sec2mps(s, n * ARR_LEN); \
printf(" %-8s: %7.4f MPS\n", #FNAME, mps); }
double b[ARR_LEN]
Definition: libm-bench.cpp:75
double a[ARR_LEN]
Definition: libm-bench.cpp:74
timespec time_type
Definition: libm-bench.cpp:47
static const double t0
Definition: e_lgamma_r.c:111
double r[ARR_LEN]
Definition: libm-bench.cpp:76
static const char * s[]
Definition: heapsort.c:22
const long ARR_LEN
Definition: libm-bench.cpp:72
static int n[]
Definition: heapsort.c:32
Definition: time.h:41
double sec2mps(double s, long n)
Definition: libm-bench.cpp:66

Function Documentation

◆ main()

int main ( int  argc,
char *  argv[] 
)

◆ sec2mps()

double sec2mps ( double  s,
long  n 
)
inline

References n, and s.

Variable Documentation

◆ a

double a[ARR_LEN]

◆ ARR_LEN

const long ARR_LEN = 1024

Referenced by main().

◆ b

double b[ARR_LEN]

◆ r

double r[ARR_LEN]

Referenced by __attribute__(), __ieee754_acos(), __ieee754_acosf(), __ieee754_asin(), __ieee754_j0(), __ieee754_j0f(), __ieee754_j1(), __ieee754_j1f(), __ieee754_lgamma_r(), __ieee754_lgammaf_r(), __ieee754_log10(), __ieee754_log10f(), __ieee754_log2(), __ieee754_log2f(), __ieee754_pow(), __ieee754_powf(), __ieee754_rem_pio2(), __ieee754_rem_pio2f(), __ieee754_rem_pio2l(), __ieee754_sqrt(), __ieee754_sqrtf(), __kernel_cos(), __kernel_cosdf(), __kernel_cosl(), __kernel_sin(), __kernel_sincos(), __kernel_sincosdf(), __kernel_sindf(), __kernel_sinl(), __kernel_tan(), __kernel_tandf(), __kernel_tanl(), _qsort(), acosl(), asinl(), asprintf(), os::posix::ConditionVariable::broadcast(), cbrt(), cbrtf(), cbrtl(), cexpl(), embdrv::vl53l1x::checkModelID(), convertI2CTransactionErrorCode(), os::posix::Semaphore::count(), cpow(), cpowf(), cpowl(), embdrv::vl53l1x::create(), div(), os::posix::MessageQueue< TType >::empty(), erf(), erfc(), erfcf(), erfcl(), erff(), erfl(), exp2(), exp2l(), fma(), fmal(), free(), os::freertos::ConditionVariable::freertos_wait(), os::posix::MessageQueue< TType >::full(), get_converted_error(), os::freertos::Semaphore::give(), os::posix::Semaphore::give(), os::posix::Semaphore::giveFromISR(), embdrv::aardvarkAdapter::i2cPullups(), embutil::is_aligned(), os::posix::Thread::join(), embdrv::vl53l1x::kickoffMeasurementOnceFirmwareReady(), ldiv(), lgammal_r(), os::freertos::Mutex::lock(), os::posix::Mutex::lock(), log1pl(), main(), malloc(), malloc_addblock(), os::posix::Mutex::Mutex(), pone(), ponef(), posix_memalign(), posix_memalign_test(), powl(), embvm::i2c::activeMaster< 128 >::process_(), embvm::spi::activeMaster< TQueueSize, TLock, TCond >::process_(), embdrv::aardvarkSPIMaster::process_(), embdrv::aardvarkI2CMaster::process_(), embdrv::aardvarkAdapter::pullup(), puts(), pzero(), pzerof(), qone(), qonef(), qzero(), qzerof(), rand_r(), embdrv::vl53l1x::rangeStatus(), embdrv::vl53l1x::readData(), embdrv::vl53l1x::readOscillatorCal(), embdrv::vl53l1x::readTrim(), rv_alloc(), os::posix::Semaphore::Semaphore(), embdrv::aardvarkGPIOOutput< 5 >::set(), os::freertos::EventFlag::setFromISR(), shuffle2(), os::posix::ConditionVariable::signal(), embdrv::vl53l1x::signalRate(), os::posix::MessageQueue< TType >::size(), small_gam(), smaller_gam(), sqrtl(), embdrv::aardvarkGPIOOutput< 5 >::start_(), strchr(), strcmp(), strcoll(), strerror_r(), strncmp(), strnstr_test(), strnstr_test_null(), os::freertos::Semaphore::take(), os::posix::Semaphore::take(), embdrv::aardvarkAdapter::targetPower(), os::posix::Thread::terminate(), test_randn(), os::freertos::Thread::Thread(), os::posix::Thread::Thread(), os::posix::Thread::thread_func(), os::freertos::Mutex::trylock(), os::posix::Mutex::trylock(), nRFi2cMaster< NordicTWIM0, nRFPinID< 0, 27 >, nRFPinID< 0, 26 > >::twim_callback_(), uint64_gen(), os::posix::Mutex::unlock(), os::posix::ConditionVariable::wait(), os::posix::ConditionVariable::~ConditionVariable(), os::posix::Mutex::~Mutex(), and os::posix::Semaphore::~Semaphore().