907c40b260db28658efedec8a212f0fb74dbcc22
12 /*----------------------------------------------------------------------*\
14 \*---------------------------------------------------------------------*/
16 /*--------------------------------------*\
18 \*-------------------------------------*/
20 extern void launchKernelVague0(uchar4
* ptrDevPixels
, int w
, int h
, float t
);
22 /*--------------------------------------*\
24 \*-------------------------------------*/
26 int vague0FreeGL(int itmax
=1000);
28 /*--------------------------------------*\
30 \*-------------------------------------*/
32 /*----------------------------------------------------------------------*\
34 \*---------------------------------------------------------------------*/
36 /*--------------------------------------*\
38 \*-------------------------------------*/
41 * Hyp: itmax suffisamment grand pour que timeElapse soit significatif
43 int vague0FreeGL(int itmax
)
45 cout
<<"\n[Vague0] : FreeGL running ..."<<endl
;
51 size_t size
= w
* h
* sizeof(uchar4
);
52 HANDLE_ERROR(cudaMalloc((void**) &ptrDevImage
, size
));
53 HANDLE_ERROR(cudaMemset(ptrDevImage
, 0, size
));
57 float dt
= 2 * PI
/ 10000;
62 launchKernelVague0(ptrDevImage
, w
, h
, t
); // assynchrone!
63 Device::checkKernelError("Vague0");
64 Device::synchronize(); // Important!
71 HANDLE_ERROR(cudaFree(ptrDevImage
));
73 double timeElapseS
= chrono
.getDeltaTime();
74 int fps
= itmax
/ timeElapseS
;
76 cout
<<"fps : "<<fps
<<endl
;
81 /*--------------------------------------*\
83 \*-------------------------------------*/
85 /*----------------------------------------------------------------------*\
87 \*---------------------------------------------------------------------*/