Remplacement des 'powf(a, 2)' par 'a*a'.
[GPU.git] / WCudaMSE / Student_Cuda_Image / src / cpp / core / 03_Newton / moo / device / NewtonDevice.cu
index 536b75b..534e37f 100755 (executable)
@@ -1,26 +1,27 @@
 #include <iostream>\r
+#include <stdio.h>\r
+using namespace std;\r
+\r
+#include "NewtonDevice.h"\r
 \r
 #include "Indice2D.h"\r
 #include "IndiceTools.h"\r
-#include "DomaineMath.h"\r
 #include "cudaTools.h"\r
 #include "Device.h"\r
 \r
 #include "NewtonMath.h"\r
 \r
-using std::cout;\r
-using std::endl;\r
-\r
-__global__ void newton(uchar4* ptrDevPixels, int w, int h, DomaineMath domaineMath)\r
+__global__\r
+void newton(uchar4* ptrDevPixels, int w, int h, DomaineMath domaineMath, int n, float epsilon)\r
     {\r
     const int TID = Indice2D::tid();\r
     const int NB_THREAD = Indice2D::nbThread();\r
     const int WH = w * h;\r
 \r
-    NewtonMath newtonMath;\r
+    NewtonMath newtonMath(n, epsilon);\r
 \r
     uchar4 color;\r
-    color.z = 255; // Par défaut, l'image est opaque.\r
+    color.w = 255; // Par défaut, l'image est opaque.\r
 \r
     double x, y;\r
     int pixelI, pixelJ;\r
@@ -30,9 +31,9 @@ __global__ void newton(uchar4* ptrDevPixels, int w, int h, DomaineMath domaineMa
         {\r
         IndiceTools::toIJ(s, w, &pixelI, &pixelJ); // update (pixelI, pixelJ)\r
 \r
-        // (i,j) domaine ecran\r
-        // (x,y) domaine math\r
-        domaineMath.toXY(pixelI, pixelJ, &x, &y); //  (i,j) -> (x,y)\r
+        // (i,j) domaine écran.\r
+        // (x,y) domaine math.\r
+        domaineMath.toXY(pixelI, pixelJ, &x, &y); // (i,j) -> (x,y).\r
 \r
         newtonMath.colorXY(&color, x, y);\r
 \r