summaryrefslogtreecommitdiff
path: root/src/kernels/common.opencl
diff options
context:
space:
mode:
Diffstat (limited to 'src/kernels/common.opencl')
-rw-r--r--src/kernels/common.opencl14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/kernels/common.opencl b/src/kernels/common.opencl
index b0817242..bfa1042d 100644
--- a/src/kernels/common.opencl
+++ b/src/kernels/common.opencl
@@ -162,6 +162,13 @@ R"(
#define AbsoluteValue(value) value = fabs(value)
#endif
+// Negation (component-wise)
+#if PRECISION == 3232 || PRECISION == 6464
+ #define Negate(value) value.x = -(value.x); value.y = -(value.y)
+#else
+ #define Negate(value) value = -(value)
+#endif
+
// Adds two complex variables
#if PRECISION == 3232 || PRECISION == 6464
#define Add(c, a, b) c.x = a.x + b.x; c.y = a.y + b.y
@@ -193,6 +200,13 @@ R"(
#endif
#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
+#else
+ #define DivideReal(c, a, b) c = a / b
+#endif
+
// The scalar AXPBY function
#if PRECISION == 3232 || PRECISION == 6464
#define AXPBY(e, a, b, c, d) e.x = MulReal(a,b) + MulReal(c,d); e.y = MulImag(a,b) + MulImag(c,d)