open cl confusion

asked 2018-07-05 04:29:33 -0600

holger gravatar image

updated 2018-07-05 04:39:12 -0600

Hello, i have written a small program which evaluates a model (res10_300x300_ssd_iter_140000_fp16.caffemodel). This is working fine. I want to compare opencl with cpu only model

I set setPreferableTarget(DNN_TARGET_CPU); to force cpu usage.

In Logs

[ INFO:0] Initialize OpenCL runtime...

The measured time still the same(42ms). Well to make very sure - i decided to recompile without open cl

cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr/local -DWITH_OPENCL=OFF -DBUILD_DOCS=ON -DBUILD_EXAMPLES=ON ../opencv-3.4.1-src

and after that

 make -j7

In Logs

[ INFO:0] Initialize OpenCL runtime...

Still - the measured time still the same(42ms) and i got the open cl log. Did it run on cpu or gpu? Does gpu acceleration has no influence for this model? Did i failed to reinstall successfully or does open cv always uses open cl? Very confused.

edit retag flag offensive close merge delete

Comments

adding sudo make install to actually install it.

holger gravatar imageholger ( 2018-07-05 04:33:07 -0600 )edit

So i compiled and installed open cv without open cl The times measured are still the same.

reconNet.setPreferableTarget(DNN_TARGET_OPENCL);

Strangely this code from above gives me no exception. I guess its "preferable" So to come to a conclusion.This model is unsuitable for gpu / cpu comparison. I will try on another model, but i still have the impression open cl for dnn has no effect and if you have big model you need cuda for dnn evaluation(not supported by open cv - but there are other ways to play around) Will post results here.

holger gravatar imageholger ( 2018-07-05 04:58:46 -0600 )edit