X-Git-Url: http://git.euphorik.ch/?a=blobdiff_plain;f=WCudaMSE%2FStudent_Cuda_Image%2Fsrc%2Fcpp%2Fcore%2F03_Newton%2Fmoo%2Fhost%2FNewton.cu;h=eaa92eae6c5bd8b51d37d329151ae61d4d8a893e;hb=HEAD;hp=028f9243ebfaceedc41eba0413bedb112ba84b12;hpb=7b1db14e9df63c577384e1722d2028438a51944e;p=GPU.git 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 028f924..eaa92ea 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 @@ -1,22 +1,21 @@ #include #include +#include +using namespace std; #include "Newton.h" #include "Device.h" +#include "NewtonDevice.h" -using std::cout; -using std::endl; - -extern __global__ void newton(uchar4* ptrDevPixels, int w, int h, DomaineMath domaineMath); - -Newton::Newton(int w, int h) - : variateurAnimation(IntervalF(30, 100), 1), - w(w), h(h), - dg(8, 8, 1), - db(16, 16, 1), - title("Fractal Newton") +Newton::Newton(int w, int h) : + variateurEpsilon(IntervalF(0.01, 1), 0.001), + w(w), + h(h), + dg(8, 8, 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,14 @@ Newton::~Newton() void Newton::runGPU(uchar4* ptrDevPixels, const DomaineMath& domaineMath) { - newton<<>>(ptrDevPixels, this->w, this->h, domaineMath); + newton<<>>(ptrDevPixels, this->w, this->h, domaineMath, 100, this->epsilon); + + HANDLE_ERROR(cudaDeviceSynchronize()); // Pour flusher les 'printf' (pour le DEBUG). } void Newton::animationStep() { - this->t = this->variateurAnimation.varierAndGet(); + this->epsilon = this->variateurEpsilon.varierAndGet(); } int Newton::getW() @@ -52,7 +53,12 @@ DomaineMath* Newton::getDomaineMathInit() float Newton::getT() { - return 0; + return this->epsilon; + } + +string Newton::getTName() + { + return "epsilon : "; } string Newton::getTitle()