aboutsummaryrefslogtreecommitdiff
path: root/data/diffraction.cl
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2010-02-22 18:26:36 +0100
committerThomas White <taw@physics.org>2010-02-22 18:26:36 +0100
commitb024c40bc2ce1167697d008ce95243bed70be367 (patch)
tree14c819fa2e772bbb67c93dc04f15406ee6173add /data/diffraction.cl
parent41af67b689f21ab2c0b9a682939873c86cbc7773 (diff)
Use GPU native functions
Diffstat (limited to 'data/diffraction.cl')
-rw-r--r--data/diffraction.cl10
1 files changed, 6 insertions, 4 deletions
diff --git a/data/diffraction.cl b/data/diffraction.cl
index 892ec2db..c3a0e637 100644
--- a/data/diffraction.cl
+++ b/data/diffraction.cl
@@ -61,7 +61,9 @@ float4 get_q(int x, int y, float cx, float cy, float res, float clen, float k,
az = atan2(ry, rx);
- q = (float4)(k*sin(tt)*cos(az), k*sin(tt)*sin(az), k-k*cos(tt), 0.0);
+ q = (float4)(k*native_sin(tt)*native_cos(az),
+ k*native_sin(tt)*native_sin(az),
+ k-k*native_cos(tt), 0.0);
return quat_rot(q, z);
}
@@ -80,13 +82,13 @@ float lattice_factor(float16 cell, float4 q, int4 ncells)
Udotq.z = cell.s6*q.x + cell.s7*q.y + cell.s8*q.z;
/* At exact Bragg condition, f1 = na */
- f1 = sin(M_PI*(float)na*Udotq.x) / sin(M_PI*Udotq.x);
+ f1 = native_sin(M_PI*(float)na*Udotq.x) / native_sin(M_PI*Udotq.x);
/* At exact Bragg condition, f2 = nb */
- f2 = sin(M_PI*(float)nb*Udotq.y) / sin(M_PI*Udotq.y);
+ f2 = native_sin(M_PI*(float)nb*Udotq.y) / native_sin(M_PI*Udotq.y);
/* At exact Bragg condition, f3 = nc */
- f3 = sin(M_PI*(float)nc*Udotq.z) / sin(M_PI*Udotq.z);
+ f3 = native_sin(M_PI*(float)nc*Udotq.z) / native_sin(M_PI*Udotq.z);
/* At exact Bragg condition, this will multiply the molecular
* part of the structure factor by the number of unit cells,