- pad or truncation value must be constant
- power of two transform
- and type-2 only
- double inputs only
Problems in using the Coder and/or gpuArray with the DCT
4 views (last 30 days)
Show older comments
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:
- When used as dct(Matrix) the error message given is: Function call failed.
- 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
0 Comments
Answers (1)
Ram Kokku
on 14 Jun 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.
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 Comments
Frantz Bouchereau
on 18 Jun 2019
Gerry, you are correct, the same limitations apply to the gpuArray. We will add the limitations to the documentation.
See Also
Categories
Find more on Array and Matrix Mathematics in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!