aboutsummaryrefslogtreecommitdiff
path: root/data
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2010-02-22 18:06:57 +0100
committerThomas White <taw@physics.org>2010-02-22 18:06:57 +0100
commit41af67b689f21ab2c0b9a682939873c86cbc7773 (patch)
treec545071e6b9c1665a66d17d0e9c5b78d31b481d0 /data
parentebe8f6f9882d388637c58ad2093c35fef57963ed (diff)
parent38f720958d850fe55a06660b2da9262e881287f6 (diff)
Merge branch 'master' of ssh://cfelw1.desy.de/Volumes/Data_RAID1/git/crystfel
Diffstat (limited to 'data')
-rw-r--r--data/diffraction.cl8
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