X-Git-Url: http://git.euphorik.ch/?a=blobdiff_plain;f=WCudaMSE%2FStudent_Cuda_Image%2Fsrc%2Fcpp%2Fcore%2F03_Newton%2Fmoo%2Fdevice%2FNewtonDevice.cu;h=534e37f16c466cb6ad53a0310baef84dfe6436ce;hb=7753d7abc9c1cdf90793a2936221aa4951c574b3;hp=536b75bd3c0adbe09900a937f28c36c978aafc8e;hpb=7b1db14e9df63c577384e1722d2028438a51944e;p=GPU.git diff --git a/WCudaMSE/Student_Cuda_Image/src/cpp/core/03_Newton/moo/device/NewtonDevice.cu b/WCudaMSE/Student_Cuda_Image/src/cpp/core/03_Newton/moo/device/NewtonDevice.cu index 536b75b..534e37f 100755 --- a/WCudaMSE/Student_Cuda_Image/src/cpp/core/03_Newton/moo/device/NewtonDevice.cu +++ b/WCudaMSE/Student_Cuda_Image/src/cpp/core/03_Newton/moo/device/NewtonDevice.cu @@ -1,26 +1,27 @@ #include +#include +using namespace std; + +#include "NewtonDevice.h" #include "Indice2D.h" #include "IndiceTools.h" -#include "DomaineMath.h" #include "cudaTools.h" #include "Device.h" #include "NewtonMath.h" -using std::cout; -using std::endl; - -__global__ void newton(uchar4* ptrDevPixels, int w, int h, DomaineMath domaineMath) +__global__ +void newton(uchar4* ptrDevPixels, int w, int h, DomaineMath domaineMath, int n, float epsilon) { const int TID = Indice2D::tid(); const int NB_THREAD = Indice2D::nbThread(); const int WH = w * h; - NewtonMath newtonMath; + NewtonMath newtonMath(n, epsilon); uchar4 color; - color.z = 255; // Par défaut, l'image est opaque. + color.w = 255; // Par défaut, l'image est opaque. double x, y; int pixelI, pixelJ; @@ -30,9 +31,9 @@ __global__ void newton(uchar4* ptrDevPixels, int w, int h, DomaineMath domaineMa { IndiceTools::toIJ(s, w, &pixelI, &pixelJ); // update (pixelI, pixelJ) - // (i,j) domaine ecran - // (x,y) domaine math - domaineMath.toXY(pixelI, pixelJ, &x, &y); // (i,j) -> (x,y) + // (i,j) domaine écran. + // (x,y) domaine math. + domaineMath.toXY(pixelI, pixelJ, &x, &y); // (i,j) -> (x,y). newtonMath.colorXY(&color, x, y);