Advertisement
Guest User

Untitled

a guest
Jun 14th, 2018
153
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.38 KB | None | 0 0
  1.     typedef __m128 Context;
  2.  
  3.  
  4. struct A { float k[2]; };
  5. struct B { float q[4]; };
  6.  
  7. struct FTransform : thrust::unary_function<A, B>
  8. {
  9.     Context context;
  10.     FTransform(Context context) : context(context) {}
  11.     __attribute__((device)) B operator()(const A& a) const
  12.     {
  13.         B b{{a.k[0], a.k[1], a.k[0]*context.n[0], a.k[1]*context.n[1]}};
  14.         return b;
  15.     }
  16. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement