|
Michael Hui wrote:
> I have a question regarding coding tricks one can use to
> make Fixed-Point Toolbox run as fast as possible.
>
> I have read elsewhere on this newsgroup that BLAS
>
> http://www.intel.com/cd/software/products/asmo-na/eng/266858.htm
>
> is not used for calculations in equations defined using
> Fixed-Point Toolbox.
>
> But what if I code my sum-of-products where every term on
> the RHS have their SumMode and ProductMode set to the
> FullPrecision default, and the tool already knows at
> compile time that the equation's LHS will have a mantissa
> with fewer bits than the floating point mantissa limit?
> That means the sum-of-products can be executed using BLAS,
> and any rounding or saturation can be handled afterwards.
>
> Or is it true that Fixed-Point Toolbox calculations never
> use BLAS, so no matter how I code it, there is no way to
> approach the speed of floating point sum-of-products
> calculations in regular M code?
Hi Michael,
It is true that Fixed-Point Toolbox does not use BLAS.
However, you can get speeds comparable to builtin types in MATLAB by
compiling the code into a MEX file with the EMLMEX function. The
compiled code uses native integer types. You get the best speedup by
putting as much of the code as possible into the MEX file.
You have the EMLMEX function if you have Fixed-Point Toolbox.
Best wishes,
Tom Bryan
tbryan@mathworks.com
|