Advertisement
Guest User

Untitled

a guest
Jul 20th, 2017
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.65 KB | None | 0 0
  1. #if defined __OPENCL_VERSION__
  2.  
  3.     #define CCL_UINT   __attribute__((aligned(4)))  uint
  4.     #define CCL_FLOAT  __attribute__((aligned(4)))  float
  5.     #define CCL_FLOAT4 __attribute__((aligned(16))) float4
  6.  
  7. #elif defined __GNUC__
  8.  
  9.     #define CCL_UINT   __attribute__((aligned(4)))  cl_uint
  10.     #define CCL_FLOAT  __attribute__((aligned(4)))  cl_float
  11.     #define CCL_FLOAT4 __attribute__((aligned(16))) cl_float4
  12.  
  13. #endif
  14.  
  15. struct __attribute__((packed))
  16. _Particle {
  17.     CCL_FLOAT4 position;
  18.     CCL_FLOAT4 velocity;
  19.     CCL_FLOAT4 acceleration;
  20.     CCL_FLOAT  mass;
  21.     CCL_FLOAT  density;
  22.     CCL_FLOAT  pressure;
  23.     CCL_UINT   assigned;
  24. };
  25.  
  26. typedef struct _Particle Particle;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement