Thread Subject: Fixed-Point Toolbox and BLAS

Subject: Fixed-Point Toolbox and BLAS

From: Michael Hui

Date: 18 Jul, 2008 21:00:22

Message: 1 of 2

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?

Subject: Fixed-Point Toolbox and BLAS

From: Tom Bryan

Date: 21 Jul, 2008 12:07:25

Message: 2 of 2

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

Tags for this Thread

Add a New Tag:

Separated by commas
Ex.: root locus, bode

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

rssFeed for this Thread

Contact us at files@mathworks.com