X-Git-Url: http://git.euphorik.ch/?p=GPU.git;a=blobdiff_plain;f=WCudaMSE%2FStudent_Cuda_Image%2Fsrc%2Fcpp%2Fcore%2F03_Newton%2Fmoo%2Fhost%2FNewton.cu;h=a468b057e7cbefa56a64834ad11979fa4de6d367;hp=685fb5e42503015d08b681781c159765787781e0;hb=7753d7abc9c1cdf90793a2936221aa4951c574b3;hpb=cb39d6a91b65d2862018430d65e633d2a8fdc818 diff --git a/WCudaMSE/Student_Cuda_Image/src/cpp/core/03_Newton/moo/host/Newton.cu b/WCudaMSE/Student_Cuda_Image/src/cpp/core/03_Newton/moo/host/Newton.cu index 685fb5e..a468b05 100755 --- a/WCudaMSE/Student_Cuda_Image/src/cpp/core/03_Newton/moo/host/Newton.cu +++ b/WCudaMSE/Student_Cuda_Image/src/cpp/core/03_Newton/moo/host/Newton.cu @@ -5,18 +5,17 @@ using namespace std; #include "Newton.h" #include "Device.h" - -extern __global__ void newton(uchar4* ptrDevPixels, int w, int h, DomaineMath domaineMath); +#include "NewtonDevice.h" Newton::Newton(int w, int h) - : variateurAnimation(IntervalF(30, 100), 1), + : variateurN(IntervalI(5, 1000), 1), + variateurEpsilon(IntervalF(0.01, 10), 0.01), w(w), h(h), dg(8, 8, 1), - db(16, 16, 1), + db(32, 32, 1), ptrDomaineMathInit(new DomaineMath(-2, -2, 2, 2)), title("Fractal Newton") { - // print(dg, db); Device::assertDim(dg, db); } @@ -27,12 +26,15 @@ Newton::~Newton() void Newton::runGPU(uchar4* ptrDevPixels, const DomaineMath& domaineMath) { - newton<<>>(ptrDevPixels, this->w, this->h, domaineMath); + newton<<>>(ptrDevPixels, this->w, this->h, domaineMath, this->t, this->epsilon); + + HANDLE_ERROR(cudaDeviceSynchronize()); // Pour flusher les 'printf' (pour le DEBUG). } void Newton::animationStep() { - this->t = this->variateurAnimation.varierAndGet(); + this->t = this->variateurN.varierAndGet(); + this->epsilon = this->variateurEpsilon.varierAndGet(); } int Newton::getW() @@ -52,7 +54,7 @@ DomaineMath* Newton::getDomaineMathInit() float Newton::getT() { - return 0; + return this->t; } string Newton::getTitle()