Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

CPU GPU Performance Measurement

Does a cv::gpu API takes more time inside a for loop as compared to its corresponding C Style API in the for with same number of iterations.

i.e

` // GPU FOR LOOP

cv::gpu::GpuMat a , b; // assume they contain some data for(int i = 0; i < 10180 ; i++) cv::gpu::add(a ,b,a);

// CPU FOR LOOP

CvMat a1 , b1; //assume they contain some data for(int i = 0; i < 10180 ; i++) cvAdd(a ,b,a); `

Timings:

GPU FOR LOOP : 0.87SEC

CPU FOR LOOP : 0.02SEC

why is it so ?

CPU GPU Performance Measurement

Does a cv::gpu API takes more time inside a for loop as compared to its corresponding C Style API in the for with same number of iterations.

i.e

` // GPU FOR LOOP

cv::gpu::GpuMat a , b; // assume they contain some data data

for(int i = 0; i < 10180 ; i++) i++)

cv::gpu::add(a ,b,a);

// CPU FOR LOOP

CvMat a1 , b1; //assume they contain some data data

for(int i = 0; i < 10180 ; i++) i++)

cvAdd(a ,b,a); ,b,a);

`

Timings:

GPU FOR LOOP : 0.87SEC

CPU FOR LOOP : 0.02SEC

why is it so ?

CPU GPU Performance Measurement

Does a cv::gpu API takes more time inside a for loop as compared to its corresponding C Style API in the for with same number of iterations.

i.e

` // GPU FOR LOOP

cv::gpu::GpuMat a , b; // assume they contain some data

for(int i = 0; i < 10180 ; i++)

cv::gpu::add(a ,b,a);

// CPU FOR LOOP

CvMat a1 , b1; //assume they contain some data

for(int i = 0; i < 10180 ; i++)

cvAdd(a ,b,a);cvAdd(a1 ,b1,a1);

`

Timings:

GPU FOR LOOP : 0.87SEC

CPU FOR LOOP : 0.02SEC

why is it so ?