From e6d5931bd3b3ca93a5d130e82bb5b4196a15c54b Mon Sep 17 00:00:00 2001 From: James Willis <james.s.willis@durham.ac.uk> Date: Wed, 20 Apr 2016 16:25:23 +0100 Subject: [PATCH] Modified testKernel.c to include a call to a vectorised version of kernel_deval. --- tests/testKernel.c | 31 +++++++++++++++++++++++++++---- 1 file changed, 27 insertions(+), 4 deletions(-) diff --git a/tests/testKernel.c b/tests/testKernel.c index 5ad9cc81ea..c25d1c4ae5 100644 --- a/tests/testKernel.c +++ b/tests/testKernel.c @@ -22,16 +22,39 @@ int main() { const float h = const_eta_kernel; - const int numPoints = 30; + const int numPoints = 16; - for (int i = 0; i < numPoints; ++i) { + printf("Serial Output\n"); + printf("-------------\n"); - const float x = i * 3.f / numPoints; + for (int i = 0; i <= numPoints; ++i) { + + const float x = i * 1.f / numPoints; float W, dW; kernel_deval(x / h, &W, &dW); - printf("h= %f H= %f x=%f W(x,h)=%f\n", h, h * kernel_gamma, x, W); + printf("h= %f H= %f x=%f W(x,h)=%f dW(x,h)=%f\n", h, h * kernel_gamma, x, W, dW); } + printf("Vector Output for VEC_SIZE=%d\n",VEC_SIZE); + printf("-------------\n"); + for (int i = 0; i < numPoints + 1; i+=VEC_SIZE) { + + vector vx, vx_h; + vector W, dW; + + for (int j = 0; j< VEC_SIZE; j++) { + vx.f[j] = (i + j) * 1.f / numPoints; + } + + vx_h.v = vx.v / vec_set1(h); + + kernel_deval_vec(&vx_h, &W, &dW); + + for (int j = 0; j< VEC_SIZE; j++) { + printf("h= %f H= %f x=%f W(x,h)=%f dW(x,h)=%f\n", h, h * kernel_gamma, vx.f[j], W.f[j], dW.f[j]); + } + + } return 0; } -- GitLab