projects
/
GPU.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Rippling CUDA Warmup et Smart.
[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
..
eb49b08
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,18
+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
{
\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
// Tools
\r
- //this->dg = // TODO
\r
- //this->db = // TODO
\r
- this->t = 0;
\r
+ this->dg = dim3(8, 8, 1); // disons a optimiser
\r
+ this->db = dim3(16, 16, 1); // disons a optimiser
\r
\r
// Outputs
\r
this->title = "Rippling Cuda";
\r
\r
// Outputs
\r
this->title = "Rippling Cuda";
\r
@@
-72,7
+67,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
+75,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