Ask Your Question
1

Does CUDA model effect (increase performance) of python module?

asked 2013-10-14 09:28:12 -0500

xamox gravatar image

I'm assuming that if I build with CUDA support to use the GPU that I should see performance increase through the python modules as well as these are essentially just calling the C/C++ functions correct?

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
2

answered 2013-10-14 11:11:17 -0500

Vladislav Vinogradov gravatar image

No. CUDA optimization is explicit. OpenCV has separate module opencv_gpu, that contains different algorithms implemented via CUDA. User should explicitly call functions from opencv_gpu module to run code on GPU, for example:

cv::Mat img = cv::imread(...);
cv::gpu::GpuMat d_img;
d_img.upload(img); // copy data to GPU memory
cv::gpu::GpuMat d_edges;
cv::gpu::Canny(d_img, d_edges, 50, 100); // call GPU implementation
cv::Mat edges;
d_edges.download(edges); // copy data from GPU to CPU memory

And, unfortunately, there is no Python wrappers for opencv_gpu module.

edit flag offensive delete link more

Comments

Okay, thanks for the heads up.

xamox gravatar imagexamox ( 2013-10-14 13:49:34 -0500 )edit
Login/Signup to Answer

Question Tools

Stats

Asked: 2013-10-14 09:28:12 -0500

Seen: 342 times

Last updated: Oct 14 '13