Flattening of gpuArray - row major or column major order?

4 ビュー (過去 30 日間)
Sofie Lovdal
Sofie Lovdal 2018 年 6 月 18 日
コメント済み: Sofie Lovdal 2018 年 6 月 19 日
Dear Matlab experts,
I am having some unexpected results passing a 2D Matrix to a CUDA kernel via feval. I think the reason might have to do with the way Matlab flattens the array when passing it to the kernel, but this far I haven't found anything online that would confirm this. My CUDA kernel expects row-major order.
How does Matlab pass the array to the GPU? Does it flatten it with row-major order or column-major order?
Thankful for response!

採用された回答

Edric Ellis
Edric Ellis 2018 年 6 月 19 日
gpuArray data is stored in column-major format, just like CPU data in MATLAB.
  1 件のコメント
Sofie Lovdal
Sofie Lovdal 2018 年 6 月 19 日
Thank you Edric! This information will definitely help my solve my problem.

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeLoops and Conditional Statements についてさらに検索

製品


リリース

R2018a

Community Treasure Hunt

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

Start Hunting!

Translated by