X-Git-Url: http://git.euphorik.ch/?a=blobdiff_plain;f=WCudaMSE%2FStudent_Cuda_Image%2Fsrc%2Fcpp%2Fcore%2F03_Newton%2Fmoo%2Fhost%2FNewton.cu;fp=WCudaMSE%2FStudent_Cuda_Image%2Fsrc%2Fcpp%2Fcore%2F03_Newton%2Fmoo%2Fhost%2FNewton.cu;h=028f9243ebfaceedc41eba0413bedb112ba84b12;hb=7b1db14e9df63c577384e1722d2028438a51944e;hp=0000000000000000000000000000000000000000;hpb=bd178531f80f8bc41c998d1c4588f9e18cc29389;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 new file mode 100755 index 0000000..028f924 --- /dev/null +++ b/WCudaMSE/Student_Cuda_Image/src/cpp/core/03_Newton/moo/host/Newton.cu @@ -0,0 +1,62 @@ +#include +#include + +#include "Newton.h" +#include "Device.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") + { + //print(dg, db); + Device::assertDim(dg, db); + } + +Newton::~Newton() + { + delete this->ptrDomaineMathInit; + } + +void Newton::runGPU(uchar4* ptrDevPixels, const DomaineMath& domaineMath) + { + newton<<>>(ptrDevPixels, this->w, this->h, domaineMath); + } + +void Newton::animationStep() + { + this->t = this->variateurAnimation.varierAndGet(); + } + +int Newton::getW() + { + return this->w; + } + +int Newton::getH() + { + return this->h; + } + +DomaineMath* Newton::getDomaineMathInit() + { + return this->ptrDomaineMathInit; + } + +float Newton::getT() + { + return 0; + } + +string Newton::getTitle() + { + return this->title; + } +