Does the code run on the GPU after transferring data to the GPU using the gpuArray function?

12 ビュー (過去 30 日間)
lu zhang
lu zhang 2021 年 11 月 29 日
コメント済み: Walter Roberson 2021 年 11 月 30 日
I am a novice, I used the gpuArray function for transferring data to GPU , but the code run on the CPU. How can I get code to run on the GPU

回答 (1 件)

Matt J
Matt J 2021 年 11 月 29 日
編集済み: Matt J 2021 年 11 月 29 日
Any operations you do on a gpuArray object will be done on the GPU. Operations you do on other objects (not gpuArrays) will be executed on the CPU.
  2 件のコメント
lu zhang
lu zhang 2021 年 11 月 30 日
Thank you for your answer. I see what you mean. I have transfered the data to GPU and run the code. But my task manager showed that the CPU was working, and the utilization of GPU was 0. I'm very confused now.
Walter Roberson
Walter Roberson 2021 年 11 月 30 日
GPUs can be quite fast.
Use gputimeit() to estimate speed.

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeGPU Computing についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by