gpuArray of variable size for codegen

1 回表示 (過去 30 日間)
Arabarra
Arabarra 2018 年 11 月 2 日
コメント済み: Benjamin Ballintyn 2020 年 1 月 13 日
Hi,
I'm trying to figure out the actual potential of the codegen capabilities on the GPU. In particular there are two points that I are not addressed explicitly in the online documentation (or I couldn't find the info).
*) First, it seems that the gpuArray type cannot be used as input. This is surprising, as it reduces drastically the applicability of mex functions generated with codegen... Is there a way to create mex files that accept gpuArray vectors as rhs?
*) Second, codegen throws a warning when input arguments of matrices that will be sent to the GPU (by a coder.gpu.kernelfun pragma inside the .m file) are declared to be of variable size using coder.typeof(). Again, a significant restriction on the usability of codegen.... Am I missing something here? Is there a way to trick codegen into accepting dynamically sized arrays as input for GPU processing?
thanks! Daniel

採用された回答

Joss Knight
Joss Knight 2018 年 11 月 5 日
Support for gpuArray input comes with R2018b. I don't know about the other thing, sorry.
  1 件のコメント
Benjamin Ballintyn
Benjamin Ballintyn 2020 年 1 月 13 日
I am running 2018b and when trying to use coder.typeof to specify a variable sized gpuArray input I get the following error:
"Variable-size dimension inputs are not supported when using CODER.TYPEOF to represent gpuArray inputs."
So it seems gpuArrays can be inputs to codegen functions but they cannot be specified as variable size. This is definitely a significant drawback since you would need to recompile the desired function(s) every time you want to change the input size.

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

その他の回答 (0 件)

カテゴリ

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

Community Treasure Hunt

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

Start Hunting!

Translated by