Guest User

Untitled

a guest
Jan 18th, 2018
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.37 KB | None | 0 0
  1. // packed vector of 2-elements
  2. typedef double v2d __attribute__((vector_size(sizeof(double)*2)));
  3.  
  4. v2d x = ...;
  5. double y = ...;
  6.  
  7. x[0] = pow(x[0], y)
  8. x[1] = pow(x[1], y)
  9.  
  10. #include <math.h>
  11. typedef double vnd __attribute__((vector_size(sizeof(double)*2)));
  12.  
  13. vnd foo(vnd x, vnd y) {
  14. #pragma omp simd
  15. for(int i=0; i<2; i++) x[i] = pow(x[i], y[i]);
  16. return x;
  17. }
Add Comment
Please, Sign In to add comment