From 53da0ad12f861879e3977e28d32e8c9e44a5258a Mon Sep 17 00:00:00 2001
From: couturie <couturie@extinction>
Date: Sat, 30 Apr 2016 10:13:59 +0200
Subject: [PATCH] new

---
 code.c | 27 ++++++++++++++-------------
 1 file changed, 14 insertions(+), 13 deletions(-)

diff --git a/code.c b/code.c
index cb93014..b270653 100644
--- a/code.c
+++ b/code.c
@@ -77,19 +77,20 @@ cuDoubleComplex NewH_EA(int i, cuDoubleComplex *Z) {
 
 //kernels to update a root i
 __global__
-cuDoubleComplex H_EA(int i, cuDoubleComplex *Z) {
-  cuDoubleComplex c;
-  //if the root needs to be updated
-  if(!finished[i]) {
-    //according to the module of the root
-    if (Cmodule(Z[i])<=maxRadius)
-      //selects the normal version
-      c = FirstH_EA(i,Z);  
-    else
-      //of the Log Exp version
-      c = NewH_EA(i,Z);
-    return c;
+void Dev_EA(int i, cuDoubleComplex *Z, int size) {
+  int i= blockIdx.x*blockDim.x+ threadIdx.x;
+  if(i<size) {
+    //if the root needs to be updated
+    if(!finished[i]) {
+      //according to the module of the root
+      if (Cmodule(Z[i])<=maxRadius)
+	//selects the normal version
+	Z[i] = FirstH_EA(i,Z);  
+      else
+	//of the Log Exp version
+	Z[i] = NewH_EA(i,Z);
+      return c;
+    }
   }
-  else return Z[i];
 }
 
-- 
2.39.5