Problems in using the Coder and/or gpuArray with the DCT

3 vues (au cours des 30 derniers jours)
Gerasimos Politis
Gerasimos Politis le 14 Juin 2019
Hello
I am facing problems when calling the dct function with the 'Type' option and I am attempting to to make use of gpuArrays OR when (without gpuArrays) I am trying to compile the code in C with the Matlab coder.
With gpuArrays it works fine when neither the direction nor the type are used.
In coder (without gpuArrays) the dct function does not work at all.
The Mathworks function reference page suggests that the function supports both functionalities so I am not quite sure what goes wrong.
The error messages given are:
For gpuArray:
Error using
matlab.internal.math.transform.mldct
Invalid data type. First argument must be
double, single, int8, uint8, int16, uint16,
int32, uint32, or logical.
Error in dct>dctinternal (line 116)
b =
matlab.internal.math.transform.mldct(x,n,dim,'Variant',type);
Error in dct (line 59)
b = dctinternal(a,varargin{:});
For coder:
  1. When used as dct(Matrix) the error message given is: Function call failed.
  2. When used with option as dct(Matrix,'Type',1) the error message given is: Error calling 'dct'. This call-site passes more inputs to this function than it can accept.
Any help will be much appreciated.
Thanks
Gerry

Réponses (1)

Ram Kokku
Ram Kokku le 14 Juin 2019
Hi Gerry,
I dont think I completely understand the issues that you are running into. if you are tying to generate code for a design function that has gpuArrays, the error is expected. gpuArrays are not supported for code generation. that means your design function and its inputs cannot have any gpuArrays. that's the reason you see this error.
Invalid data type. First argument must be
double, single, int8, uint8, int16, uint16,
int32, uint32, or logical."
And about the second error, DCT code generation has following limitation.
  • pad or truncation value must be constant
  • power of two transform
  • and type-2 only
  • double inputs only
Looks like these limitations are not mentioned in the documentation. I communicated this to the corresponding teams.
If this response does not answer your questions, please provide me an example that could reproduce the issue. Thank you.
  2 commentaires
Gerasimos Politis
Gerasimos Politis le 15 Juin 2019
Modifié(e) : Gerasimos Politis le 15 Juin 2019
Hi Ram and thanks for your quick reply.
I have edited my original question to reflect more clearly the two seperate issues that I encountered.
The clarification you have given regarding the use of the DCT with coder is indeed not stated on the reference page. Thank you for that.
Your answer in regards to the gpuArrays may have been mislead by my original question. Hopefully now it will be clearer. I suspect that gpuArrays also have a limitation in regards to the type-2-only DCT, pad or truncation value etc.. Is that correct? If that's the case then it should also me mentionsed on the DCT reference page.
Frantz Bouchereau
Frantz Bouchereau le 18 Juin 2019
Gerry, you are correct, the same limitations apply to the gpuArray. We will add the limitations to the documentation.

Connectez-vous pour commenter.

Catégories

En savoir plus sur MATLAB Coder dans Help Center et File Exchange

Produits


Version

R2018a

Community Treasure Hunt

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

Start Hunting!

Translated by