Implementation of GPU computing with gpuArray?
5 ビュー (過去 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
0 件のコメント
回答 (1 件)
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.
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で GPU Computing についてさらに検索
製品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!