What's the proper way to handle GPU related matlab functions in a compiled app that might run on a computer without a supported GPU

2 ビュー (過去 30 日間)
Do I just somehow test and if all those statments declarations out or what or do functions like gpuArray do nothing when run on a computer without a supported GPU

採用された回答

Edric Ellis
Edric Ellis 2021 年 7 月 21 日
You can use canUseGpu to check if a GPU is available. If one is not, then your code needs to not create any gpuArray data.
  2 件のコメント
Walter Roberson
Walter Roberson 2021 年 7 月 21 日
I think in a situation like that, I would probably use a little wrapper function to do the allocations.

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

その他の回答 (0 件)

カテゴリ

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

製品


リリース

R2021a

Community Treasure Hunt

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

Start Hunting!

Translated by