fjarri / reikna

Pure Python GPGPU library
http://reikna.publicfields.net/
MIT License
164 stars 16 forks source link

Fix for exp() #7

Closed tnorth closed 11 years ago

tnorth commented 11 years ago

Hi,

I ran into an issue when using the exp() function defined in cluda/functions.mako. (undefined variable theta) The following patch should fix it:

--- a/reikna/cluda/functions.mako
+++ b/reikna/cluda/functions.mako
@@ -158,6 +158,7 @@ WITHIN_KERNEL ${dtypes.ctype(dtype)} ${prefix}(${dtypes.ctype(dtype)} a)
     return exp(a);
     %else:
     ${sincos(dtypes.real_for(dtype))}
+    ${dtypes.ctype(dtypes.real_for(dtype))} theta = a.y;
     ${dtypes.ctype(dtypes.real_for(dtype))} rho = exp(a.x);
     res.x *= rho;
     res.y *= rho;

Thank you ! Thibault

tnorth commented 11 years ago

Thanks!