b0aaa3274899c1e0b376f5c7f8408358996414a9
11 /*----------------------------------------------------------------------*\
13 \*---------------------------------------------------------------------*/
15 /*--------------------------------------*\
17 \*-------------------------------------*/
19 extern void launchKernelRippling0(uchar4
* ptrDevPixels
, int w
, int h
, float t
);
21 /*--------------------------------------*\
23 \*-------------------------------------*/
25 int rippling0FreeGL(int itmax
);
27 /*--------------------------------------*\
29 \*-------------------------------------*/
31 /*----------------------------------------------------------------------*\
33 \*---------------------------------------------------------------------*/
35 /*--------------------------------------*\
37 \*-------------------------------------*/
40 * Hyp: itmax suffisamment grand pour que timeElapse soit significatif
42 int rippling0FreeGL(int itmax
)
44 cout
<<"\n[Rippling0] : FreeGL running ..."<<endl
;
50 size_t size
= w
* h
* sizeof(uchar4
);
51 HANDLE_ERROR(cudaMalloc((void**) &ptrDevImage
, size
));
52 HANDLE_ERROR(cudaMemset(ptrDevImage
, 0, size
));
56 float dt
= 2 * PI
/ 10;
61 launchKernelRippling0(ptrDevImage
, w
, h
, t
);
62 Device::checkKernelError("Rippling0");
63 Device::synchronize();
70 HANDLE_ERROR(cudaFree(ptrDevImage
));
72 double timeElapseS
= chrono
.getDeltaTime();
73 int fps
= itmax
/ timeElapseS
;
75 cout
<< "fps : "<<fps
<<endl
;
80 /*--------------------------------------*\
82 \*-------------------------------------*/
84 /*----------------------------------------------------------------------*\
86 \*---------------------------------------------------------------------*/