> Am 17.02.2016 um 15:42 schrieb Andreas Kloeckner <[email protected]>: > > Gregor Thalhammer <[email protected]> writes: >>>> A drawback of optionally reverting to the old vector-based complex >>>> types is that the nice .real and .imag attribute access cannot be used >>>> anymore, instead one has to revert to the .x and .y attributes, or >>>> introduce macros for attribute access. >>> >>> Functions (not macros) for the attribute access already exist: >>> >>> cdouble_real(...), cdouble_imag(...) >>> >>> Are you ok just using those? >> >> These typed functions are ok for using in custom kernels, but in >> pyopencl-complex.h itself they are not used for attribute access, so >> the same macro expression can be used to define the complex math >> functions for both cfloat and cdouble. Thats the reason why I only see >> the options of reverting to use a.x, a.y or introduce macros >> (e.g. RE(a), IM(a)) for use in pyopencl-complex.h > > pyopencl-complex.h can be changed to use those functions, I think. What > part is troublesome in your estimation? >
Using cdouble_real() etc. explicitly instead of direct attribute access in pyopencl-complex.h would require to have two implementations of each complex math function for cdouble and cfloat. In my opinion that is not a sensible option. Now there is only one macro definition for both single and double precision complex math. Gregor > Andreas > _______________________________________________ PyOpenCL mailing list [email protected] https://lists.tiker.net/listinfo/pyopencl
