summaryrefslogtreecommitdiff
path: root/src/kernels/common.opencl
diff options
context:
space:
mode:
authorcnugteren <web@cedricnugteren.nl>2016-04-14 19:58:26 -0600
committercnugteren <web@cedricnugteren.nl>2016-04-14 19:58:26 -0600
commit8be99de82d2ff0634c1289d9b4d1785364a68a44 (patch)
tree27c16eb24784bed190ca75fe51abf5953e3b0d6a /src/kernels/common.opencl
parente0497807e297e38884efae67a0109a160dc693b7 (diff)
Added support for the SASUM/DASUM/ScASUM/DzASUM routines
Diffstat (limited to 'src/kernels/common.opencl')
-rw-r--r--src/kernels/common.opencl7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/kernels/common.opencl b/src/kernels/common.opencl
index f2a2e7a7..0a68defb 100644
--- a/src/kernels/common.opencl
+++ b/src/kernels/common.opencl
@@ -109,6 +109,13 @@ R"(
#define SetToOne(a) a = ONE
#endif
+// The absolute value (component-wise)
+#if PRECISION == 3232 || PRECISION == 6464
+ #define AbsoluteValue(value) value.x = fabs(value.x); value.y = fabs(value.y)
+#else
+ #define AbsoluteValue(value) value = fabs(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