8 void vecacc(
int n,
float* src1,
float* src2,
float* result)
14 result[i]+=src1[i]*src2[i];
17 int main(
int argc,
char **argv)
20 float *src1, *src2, *result;
25 if (posix_memalign((void **) &p, 32, n * sizeof(float))) \
31 p=(float*)malloc(n*sizeof(float));\
46 clock_gettime(CLOCK_MONOTONIC, &
start);
47 vecacc(n, src1, src2, result);
48 clock_gettime(CLOCK_MONOTONIC, &
end);
49 double tdiff =
end.tv_sec*1000.0+(
end.tv_nsec/1000000.0) - (
start.tv_sec*1000.0+(
start.tv_nsec/1000000.0));
50 printf(
"Time: %f\n", tdiff);
static char start[1024]
The name of the variable from which to start counting domain numbers.
int main(int argc, char **argv)
void vecacc(int n, float *src1, float *src2, float *result)