View randf.S
* A 32-bit floating pont random number generator [0,1) for the Adapteva Epiphany
* Based on
* A shortcut was taken for conversion of unsigned int to floating point so that
* half of the results are off by the least significant bit. This probably shouldn't
* be used for Monte Carlo simulation, but should still have a normal distribution
* and the underlying state remains the same.
* C Prototype: float randf(void);
.section .text
View dot_product.S
/* // Optimized Dot Product routine follows this protoype
float dot_product(const float* a, const float* b, int nd8m1) {
int i;
float c = 0.0f;
int n = (nd8m1+1)*8;
for (i=0; i<n; i++) {
c += a[i] * b[i];
return c;
} */
View ctimer.c
unsigned int t0, t1;
t0 = ctimer_get();
// place timed code here
t1 = ctimer_get();
unsigned int dt = t0 – t1; // elapsed time in clock cycles
static void ctimer_start(void)