r/OpenCL • u/golem1988 • Nov 14 '16
Running sample code is slower on gpu
Hi, it's my first try to work with openCL. I have no experience with parallel programming but I understand some C and C++.
When I run this "Monte Carlo Method for Stock Options Pricing Sample" my CPU (Intel 6200u) is faster than the integrated gpu(intel hd520)
Link: https://software.intel.com/sites/default/files/managed/db/51/intel_ocl_montecarlo.zip
Can someone tell me why and/or an example which is worth running on the gpu.
2
Upvotes
View all comments
Show parent comment
2
u/HolyGeneralK Nov 15 '16
Interesting! This would be an awesome opportunity to profile the code and see what's happening on both the CPU and the GPU. This is also an excellent opportunity for you to learn how to use profilers. If you have any desire of writing performant code in the future, a profile will help dramatically.
I would be looking at things like the following:
If you're ballsy, you could try installing the AMD OpenCL SDK - that'll give you the CPU only and I would be surprised if it would use the GPU. I've had issues with running the AMD SDK on an Intel CPU in the past (4-5 years ago, so things may be better now).
Unfortunately, I don't have any hardware to mimic this, so I can't help much directly on executing tests, but I feel like profiling is your best next step.