X-Git-Url: http://git.euphorik.ch/index.cgi?a=blobdiff_plain;f=WCudaMSE%2FTuto_Image_Cuda%2Fsrc%2Fcpp%2Fcore%2F03_Event%2Fmoo%2Fhost%2FEvent.cu;fp=WCudaMSE%2FTuto_Image_Cuda%2Fsrc%2Fcpp%2Fcore%2F03_Event%2Fmoo%2Fhost%2FEvent.cu;h=e12491823bf072ab5a2203e93cde65c4f55a13d8;hb=8d08c12b29c2a14684f35c023ee39e694bb80d25;hp=0000000000000000000000000000000000000000;hpb=226de81f7e1f1fbf4ac79d0d089e8a05ec7159a0;p=GPU.git diff --git a/WCudaMSE/Tuto_Image_Cuda/src/cpp/core/03_Event/moo/host/Event.cu b/WCudaMSE/Tuto_Image_Cuda/src/cpp/core/03_Event/moo/host/Event.cu new file mode 100755 index 0000000..e124918 --- /dev/null +++ b/WCudaMSE/Tuto_Image_Cuda/src/cpp/core/03_Event/moo/host/Event.cu @@ -0,0 +1,140 @@ +#include +#include + +#include "Event.h" +#include "Device.h" +#include "MathTools.h" + +using std::cout; +using std::endl; + +/*----------------------------------------------------------------------*\ + |* Declaration *| + \*---------------------------------------------------------------------*/ + +/*--------------------------------------*\ + |* Imported *| + \*-------------------------------------*/ + +extern __global__ void event(uchar4* ptrDevPixels,int w, int h,DomaineMath domaineMath,float t); + +/*--------------------------------------*\ + |* Public *| + \*-------------------------------------*/ + +/*--------------------------------------*\ + |* Private *| + \*-------------------------------------*/ + +/*----------------------------------------------------------------------*\ + |* Implementation *| + \*---------------------------------------------------------------------*/ + +/*--------------------------------------*\ + |* Public *| + \*-------------------------------------*/ + +/*-------------------------*\ + |* Constructeur *| + \*-------------------------*/ + +Event::Event(int w, int h, float dt) + { + // Inputs + this->w = w; + this->h = h; + + // Tools + this->dg = dim3(8, 8, 1); // disons a optimiser + this->db = dim3(16, 16, 1); // disons a optimiser + this->t = 0; + ptrDomaineMathInit = new DomaineMath(0, 0, 10, 10); + + //Outputs + this->title = "[API Image Cuda] : Event Window, try to clik on the window, and look console"; + + // Check: + //print(dg, db); + Device::assertDim(dg, db); + + } + +Event::~Event() + { + // rien + } + +/*-------------------------*\ + |* Methode *| + \*-------------------------*/ + +/** + * Override + */ +void Event::animationStep() + { + // rien + } + +/** + * Override + */ +void Event::runGPU(uchar4* ptrDevPixels, const DomaineMath& domaineMath) + { + event<<>>(ptrDevPixels,w,h,domaineMath,t); + } + +/*--------------*\ + |* get *| + \*--------------*/ + + +/** + * Override + */ +DomaineMath* Event::getDomaineMathInit(void) + { + return ptrDomaineMathInit; + } + +/** + * Override + */ +float Event::getT(void) + { + return t; + } + +/** + * Override + */ +int Event::getW(void) + { + return w; + } + +/** + * Override + */ +int Event::getH(void) + { + return h; + } + +/** + * Override + */ +string Event::getTitle(void) + { + return title; + } + + +/*--------------------------------------*\ + |* Private *| + \*-------------------------------------*/ + +/*----------------------------------------------------------------------*\ + |* End *| + \*---------------------------------------------------------------------*/ +