Borrar filtros
Borrar filtros

Errors regarding run-time GPU encoder

7 visualizaciones (últimos 30 días)
moh mor
moh mor el 20 de Jun. de 2024
Respondida: Garmit Pant el 20 de Jun. de 2024
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

Respuesta aceptada

Garmit Pant
Garmit Pant el 20 de Jun. de 2024
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!

Más respuestas (0)

Etiquetas

Productos


Versión

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by