From 96b08c4a792d9af1d7584dbc1e1a9eb666360fa9 Mon Sep 17 00:00:00 2001
From: Andreas Kloeckner <inform@tiker.net>
Date: Sat, 13 Aug 2016 14:56:32 -0500
Subject: [PATCH] Complex: Add c{double,float}_abs_squared

---
 pyopencl/cl/pyopencl-complex.h | 1 +
 1 file changed, 1 insertion(+)

diff --git a/pyopencl/cl/pyopencl-complex.h b/pyopencl/cl/pyopencl-complex.h
index 976bf81a..7518e810 100644
--- a/pyopencl/cl/pyopencl-complex.h
+++ b/pyopencl/cl/pyopencl-complex.h
@@ -35,6 +35,7 @@
   REAL_TP TPROOT##_real(TP a) { return a.real; } \
   REAL_TP TPROOT##_imag(TP a) { return a.imag; } \
   REAL_TP TPROOT##_abs(TP a) { return hypot(a.real, a.imag); } \
+  REAL_TP TPROOT##_abs_squared(TP a) { return a.real * a.real + a.imag * a.imag; } \
   \
   TP TPROOT##_new(REAL_TP real, REAL_TP imag) \
   { \
-- 
GitLab