diff options
author | Thomas White <taw@physics.org> | 2010-02-22 18:02:40 +0100 |
---|---|---|
committer | Thomas White <taw@physics.org> | 2010-02-22 18:03:05 +0100 |
commit | 38f720958d850fe55a06660b2da9262e881287f6 (patch) | |
tree | 241116a3b21d39b8830390d0741ce9d0015cf8c8 /data | |
parent | f92a84e3929ad775da64cab7ae1ca224b7d80358 (diff) |
OpenCL strictness
Diffstat (limited to 'data')
-rw-r--r-- | data/diffraction.cl | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/data/diffraction.cl b/data/diffraction.cl index 5ca7d571..892ec2db 100644 --- a/data/diffraction.cl +++ b/data/diffraction.cl @@ -11,7 +11,7 @@ #include <defs.h> - +#define M_PI ((float)(3.14159265)) float4 quat_rot(float4 q, float4 z) { @@ -54,7 +54,7 @@ float4 get_q(int x, int y, float cx, float cy, float res, float clen, float k, rx = ((float)x - sampling*cx)/(res*sampling); ry = ((float)y - sampling*cy)/(res*sampling); - r = sqrt(pow(rx, 2.0) + pow(ry, 2.0)); + r = sqrt(pow(rx, 2.0f) + pow(ry, 2.0f)); tt = atan2(r, clen); *ttp = tt; @@ -161,12 +161,12 @@ kernel void diffraction(global float2 *diff, global float *tt, float klow, if ( lx + ly + lb == 0 ) { int i; - float2 sum = (0.0, 0.0); + float2 sum = (float2)(0.0, 0.0); for ( i=0; i<sampling*sampling*get_local_size(2); i++ ) sum += tmp[i]; - diff[ax+w*ay] = sum / (sampling*sampling*get_local_size(2)); + diff[ax+w*ay] = sum / (float)(sampling*sampling*get_local_size(2)); /* Leader thread also records the 2theta value. * This should really be averaged across all pixels, but |