03-27-2009 10:06 AM
Intel Compiler 2.02ms
Does anyone have any faster math libraries that are supported by the real time systems? Are there any other options that will work with real time?
03-27-2009 01:51 PM
The first suggestion is try and reduce the pow functions. The pow function takes a lot of time, if you are raising to an integer power it is generally faster to do multiple multiplies, for reasonable powers.
Can you post more details on your algorithm? You could try and code SSE instructions, depending on the parallelism of the algorithm and your capabilities.
03-27-2009 03:18 PM
The only time I use the pow function for non integer powers like x^0.2. I generally avoid all function calls inside loops if I can help it.
The general form of the equation is c0 * pow(X1 , c1) * pow(X2 , c2) * pow(X3 + X4 , c3) where c0, c1, c2, c3 are scaler values and X1, X2, X3, X4 are arrays. This a small piece of the larger set of calculations. I need to use sin cos and exp a few places. The majority of the calculations involve simple math operations on arrays with scalar values or arrays.
The Intel compiler is set up to use all the special processor commands including SSE, SSE2, etc. They also have vector math libraries were used to make the calculations run faster. However, the Intel libraries are not supported by the real time OS. Are there other ways to use the SSE instructions?
03-27-2009 03:28 PM
What system/os are you using?
I haven't played around with LabVIEW too much with this regard, I progam almost exclusively on the FPGA side.
I should be possible to write the SSE instructions in assembler and compile a DLL. Then make a call to the DLL within your LabVIEW code.