Errors regarding run-time GPU encoder

2 ビュー (過去 30 日間)
moh mor
moh mor 2024 年 6 月 20 日
回答済み: Garmit Pant 2024 年 6 月 20 日
Hello, I am trying to convert my function from "MATLAB" form to "cuda" form. So, I used GPU coder in the MATLAB. This is my first time trying to perform this task. Therefore, I faced with the following errors during the "run-time check":
None of above errors get appeared during a normal run. I've uploaded the orinigal function and test file in the attachment.
Any help would be appreciated.
Thank you

採用された回答

Garmit Pant
Garmit Pant 2024 年 6 月 20 日
Hello moh mor
To address the errors and to modify your MATLAB code for compatibility with GPU Coder for code generation, you need to ensure that all operations are supported for GPU execution and that the data types and allocations are GPU compatible. Here are some adjustments and considerations:
  • Preallocate Arrays: Arrays need to have memory pre-allocated to them and can undergo manipulation and not change of size. For example, in the following code snippet, ‘expT’ has been initialised as an empty array but is being assigned a matrix of size [15 x 16 x 2916].
expT = cat(2,expT,expT2(:,:,:,i));
Determine the size of array and pre-allocate the memory.
  • Use GPU-Compatible Functions: Verify that all functions used are compatible with GPU Coder. The “save” function is not supported by GPU Coder.
  • Change the function definition: Since the function is not returning any value, you can change the definition as follows.
function BPmimo2C(Efield) %#codegen
Kindly modify your code by following the above guidelines and run the conversion to resolve the issue.
I hope you find the above explanation and suggestions useful!

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeGet Started with GPU Coder についてさらに検索

製品


リリース

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by