X-Git-Url: http://git.euphorik.ch/index.cgi?a=blobdiff_plain;f=WCudaMSE%2FStudent_Cuda_Image%2Fsrc%2Fcpp%2Fcore%2F01_Rippling%2Fmoo%2Fhost%2FRippling.cu;fp=WCudaMSE%2FStudent_Cuda_Image%2Fsrc%2Fcpp%2Fcore%2F01_Rippling%2Fmoo%2Fhost%2FRippling.cu;h=6bd9e0cebbecdf94eed9b36a54e12cc27e999696;hb=8d08c12b29c2a14684f35c023ee39e694bb80d25;hp=0000000000000000000000000000000000000000;hpb=226de81f7e1f1fbf4ac79d0d089e8a05ec7159a0;p=GPU.git diff --git a/WCudaMSE/Student_Cuda_Image/src/cpp/core/01_Rippling/moo/host/Rippling.cu b/WCudaMSE/Student_Cuda_Image/src/cpp/core/01_Rippling/moo/host/Rippling.cu new file mode 100755 index 0000000..6bd9e0c --- /dev/null +++ b/WCudaMSE/Student_Cuda_Image/src/cpp/core/01_Rippling/moo/host/Rippling.cu @@ -0,0 +1,129 @@ +#include +#include + +#include "Rippling.h" +#include "Device.h" + +using std::cout; +using std::endl; + +/*----------------------------------------------------------------------*\ + |* Declaration *| + \*---------------------------------------------------------------------*/ + +/*--------------------------------------*\ + |* Imported *| + \*-------------------------------------*/ + +extern __global__ void rippling(uchar4* ptrDevPixels, int w, int h, float t); + +/*--------------------------------------*\ + |* Public *| + \*-------------------------------------*/ + +/*--------------------------------------*\ + |* Private *| + \*-------------------------------------*/ + +/*----------------------------------------------------------------------*\ + |* Implementation *| + \*---------------------------------------------------------------------*/ + +/*--------------------------------------*\ + |* Public *| + \*-------------------------------------*/ + +/*-------------------------*\ + |* Constructeur *| + \*-------------------------*/ + +Rippling::Rippling(int w, int h, float dt) + { + assert(w == h); + + // Inputs + this->w = w; + this->h = h; + this->dt = dt; + + // Tools + //this->dg = // TODO + //this->db = // TODO + this->t = 0; + + // Outputs + this->title = "Rippling Cuda"; + + //print(dg, db); + Device::assertDim(dg, db); + } + +Rippling::~Rippling() + { + // rien + } + +/*-------------------------*\ + |* Methode *| + \*-------------------------*/ + +/** + * Override + */ +void Rippling::animationStep() + { + // TODO + } + +/** + * Override + */ +void Rippling::runGPU(uchar4* ptrDevPixels) + { + // TODO lancer le kernel avec <<>> + } + +/*--------------*\ + |* get *| + \*--------------*/ + +/** + * Override + */ +float Rippling::getT(void) + { + return t; + } + +/** + * Override + */ +int Rippling::getW(void) + { + return w; + } + +/** + * Override + */ +int Rippling::getH(void) + { + return h; + } + +/** + * Override + */ +string Rippling::getTitle(void) + { + return title; + } + +/*--------------------------------------*\ + |* Private *| + \*-------------------------------------*/ + +/*----------------------------------------------------------------------*\ + |* End *| + \*---------------------------------------------------------------------*/ +