#include #include #include #include "convolve.h" #define TESTVEC_LEN 1000 #define DO_INIT 1 float x_vect[TESTVEC_LEN]; float y_vect[TESTVEC_LEN]; float h_vect[TESTVEC_LEN]; float *x; float *h; float *y; /* Generate some random values for testing */ void gen_floats(float *vect, int len) { int i; for (i = 0; i < len; i++) { vect[i] = (float)rand()/(float)(RAND_MAX); } } /* Reset testvectors */ static void reset_testvec(int seed) { srand(seed); memset(x_vect,0,sizeof(x_vect)); memset(y_vect,0,sizeof(y_vect)); memset(h_vect,0,sizeof(h_vect)); x=x_vect + TESTVEC_LEN/2; y=y_vect + TESTVEC_LEN/2; h=h_vect + TESTVEC_LEN/2; gen_floats(x_vect,TESTVEC_LEN); gen_floats(h_vect,TESTVEC_LEN); } /* Show float vector data cut and paste friendly */ static void dump_floats(float *vect, int len, char *name) { int i; printf("float %s[] = {", name); for(i = 0; i < len; i++) { printf("%f",vect[i]); if(i