diff options
Diffstat (limited to 'src/kernels/common.opencl')
-rw-r--r-- | src/kernels/common.opencl | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/kernels/common.opencl b/src/kernels/common.opencl index bfa1042d..8e59a5fe 100644 --- a/src/kernels/common.opencl +++ b/src/kernels/common.opencl @@ -176,6 +176,13 @@ R"( #define Add(c, a, b) c = a + b #endif +// Subtracts two complex variables +#if PRECISION == 3232 || PRECISION == 6464 + #define Subtract(c, a, b) c.x = a.x - b.x; c.y = a.y - b.y +#else + #define Subtract(c, a, b) c = a - b +#endif + // Multiply two complex variables (used in the defines below) #if PRECISION == 3232 || PRECISION == 6464 #define MulReal(a, b) a.x*b.x - a.y*b.y @@ -200,6 +207,13 @@ R"( #endif #endif +// The scalar multiply-subtract function +#if PRECISION == 3232 || PRECISION == 6464 + #define MultiplySubtract(c, a, b) c.x -= MulReal(a,b); c.y -= MulImag(a,b) +#else + #define MultiplySubtract(c, a, b) c -= a * b +#endif + // The scalar division function #if PRECISION == 3232 || PRECISION == 6464 #define DivideReal(c, a, b) c.x = a.x / b.x; c.y = a.x |