]> AND Private Git Repository - kahina_paper2.git/commitdiff
Logo AND Algorithmique Numérique Distribuée

Private GIT Repository
new
authorcouturie <couturie@extinction>
Sat, 30 Apr 2016 08:13:59 +0000 (10:13 +0200)
committercouturie <couturie@extinction>
Sat, 30 Apr 2016 08:13:59 +0000 (10:13 +0200)
code.c

diff --git a/code.c b/code.c
index cb93014218bc5df9f0417c751df6096835bfa898..b27065314cf44b2931d375c7cb8470d1778fb86c 100644 (file)
--- a/code.c
+++ b/code.c
@@ -77,19 +77,20 @@ cuDoubleComplex NewH_EA(int i, cuDoubleComplex *Z) {
 
 //kernels to update a root i
 __global__
 
 //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];
 }
 
 }