From b024c40bc2ce1167697d008ce95243bed70be367 Mon Sep 17 00:00:00 2001 From: Thomas White Date: Mon, 22 Feb 2010 18:26:36 +0100 Subject: Use GPU native functions --- data/diffraction.cl | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'data') 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, -- cgit v1.2.3