Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // packed vector of 2-elements
- typedef double v2d __attribute__((vector_size(sizeof(double)*2)));
- v2d x = ...;
- double y = ...;
- x[0] = pow(x[0], y)
- x[1] = pow(x[1], y)
- #include <math.h>
- typedef double vnd __attribute__((vector_size(sizeof(double)*2)));
- vnd foo(vnd x, vnd y) {
- #pragma omp simd
- for(int i=0; i<2; i++) x[i] = pow(x[i], y[i]);
- return x;
- }
Add Comment
Please, Sign In to add comment