Implementation of GPU computing with gpuArray?

6 次查看(过去 30 天)
Hi!
I have a probplem with GPU computing.
I have implemented in my code and in all my functions (*m-files) GPU computing by adding gpuArray.
However, I did not observe significant improvment in computational time. Moreover, in my task maneger GPU is loaded only max 3%.
Can anyone advice what would be the best way to double check if my code really addresses the GPU? What could be a possible solution of this problem?
As a part of my code, I use the VideoWriter function to save frames of figures after every "for loop". Can it be a possible issue why the speed is not improved?
Thank you in advance for any help!
Best regards,
Ivan

回答(1 个)

Walter Roberson
Walter Roberson 2020-10-2
Every iteration, you have to bring back the solution from the GPU and write it to video. Writing to video can involve some compression steps, depending on what kind of file you are writing and what kind of "profile" you are using. That processing could easily take a lot more time than the iterations take on the GPU.
Remember that there is overhead getting the data to and from the GPU and in instructing the GPU what to do. If the problem you are sending to the GPU is not "big enough" then you can even end up with worse performance than using CPU.

类别

Help CenterFile Exchange 中查找有关 GPU Computing 的更多信息

产品

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by