projects
/
GPU.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fin du TP convolution. (Constant memory + Texture).
[GPU.git]
/
WCudaMSE
/
Student_Cuda_Image
/
src
/
cpp
/
core
/
01_Rippling
/
moo
/
host
/
Rippling.cu
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
index
6bd9e0c
..
43068a2
100755
(executable)
--- 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
@@
-38,22
+38,13
@@
extern __global__ void rippling(uchar4* ptrDevPixels, int w, int h, float t);
\*-------------------------*/
\r
\r
Rippling::Rippling(int w, int h, float dt)
\r
\*-------------------------*/
\r
\r
Rippling::Rippling(int w, int h, float dt)
\r
+ : w(w), h(h), dt(dt), t(0),
\r
+ dg(8, 8, 1),
\r
+ db(16, 16, 1),
\r
+ title("Rippling Cuda")
\r
{
\r
assert(w == h);
\r
\r
{
\r
assert(w == h);
\r
\r
- // Inputs
\r
- this->w = w;
\r
- this->h = h;
\r
- this->dt = dt;
\r
-
\r
- // Tools
\r
- //this->dg = // TODO
\r
- //this->db = // TODO
\r
- this->t = 0;
\r
-
\r
- // Outputs
\r
- this->title = "Rippling Cuda";
\r
-
\r
//print(dg, db);
\r
Device::assertDim(dg, db);
\r
}
\r
//print(dg, db);
\r
Device::assertDim(dg, db);
\r
}
\r
@@
-72,7
+63,7
@@
Rippling::~Rippling()
*/
\r
void Rippling::animationStep()
\r
{
\r
*/
\r
void Rippling::animationStep()
\r
{
\r
- // TODO
\r
+ this->t += dt;
\r
}
\r
\r
/**
\r
}
\r
\r
/**
\r
@@
-80,7
+71,7
@@
void Rippling::animationStep()
*/
\r
void Rippling::runGPU(uchar4* ptrDevPixels)
\r
{
\r
*/
\r
void Rippling::runGPU(uchar4* ptrDevPixels)
\r
{
\r
- // TODO lancer le kernel avec <<<dg,db>>>
\r
+ rippling<<<dg,db>>>(ptrDevPixels, this->w, this->h, this->t);
\r
}
\r
\r
/*--------------*\
\r
}
\r
\r
/*--------------*\
\r