Gregor Thalhammer <[email protected]> writes:
> 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.

No, disagreed.

Example:


    #define PYOPENCL_DECLARE_COMPLEX_TYPE_INT(REAL_TP, REAL_3LTR, TPROOT, TP) \
      \
      TP TPROOT##_add(TP a, TP b) \
      { \
        return TPROOT##_new(TPROOT##_real(a) + TPROOT##_real(b), 
TPROOT##_imag(a) + TPROOT##_imag(b)); \
        ; \
      } \

    PYOPENCL_DECLARE_COMPLEX_TYPE(float, FLT);
    PYOPENCL_DECLARE_COMPLEX_TYPE(double, DBL);

Andreas

_______________________________________________
PyOpenCL mailing list
[email protected]
https://lists.tiker.net/listinfo/pyopencl

Reply via email to