LabVIEW Idea Exchange

cancel
Showing results for 
Search instead for 
Did you mean: 
GregSands

SGL (and CSG) support for Math functions

Status: New

While the intrinsic Math functions all support EXT, DBL and SGL, few of the remaining Math (or Signal Processing etc) functions support anything except DBL.  For many cases, using SGLs is sufficiently accurate, while using less memory and often being faster to compute.  While some functions are implemented solely in G (and therefore it is easy to create an SGL copy, though not so easy to integrate in a "polymorphic" way into the existing menus), most functions call a DLL routine.

 

I suggest that SGL (and CSG where appropriate) be supported for all Mathematics functions, including Signal Processing, and the Advanced Signal Processing Toolkit.  Is there anyone else who would make use of these if available?

 

Note: two "addons" have been released by NI which begin to address this.

 

Single-Precision Basic Linear Algebra Subroutines (BLAS)

4 Comments
Darin.K
Trusted Enthusiast

Oh, you mean math functions like Power of X?  That would be nice...

altenbach
Knight of NI

Since all the 3D picture tools operate on SGL (coordinates, angles and RGBA colors, etc.), this is now needed more than before.

Manzolli
Active Participant

For years I'm using only Doubles for operations, even though sometimes the data comes in a precision that fits in the Single data.

 

The PCs I am working with LabVIEW have 4 gigabytes of RAM or more. I only ran out of RAM while I was working with big images. Disc storage is the same, lots of space, no problem at all.

 

Maybe speed is a concern. Anybody has measured the gain of using Singles instead of Doubles in calculations? I'm sure for storage Singles can be up to twice faster, since they have half of the size of Doubles in bytes.

André Manzolli

Mechanical Engineer
Certified LabVIEW Developer - CLD
LabVIEW Champion
Curitiba - PR - Brazil
GregSands
Active Participant

I've done some benchmarking of the HPAL 2.0 library for FFT routines (it supports both CSG/SGL and CDB/DBL), and using singles is approximately 2x faster than using doubles (FFT of a 1499x1499 array reduces from ~290ms to ~140ms, by comparison the built-in LabVIEW FFT takes ~1600ms).

 

I've recently re-implemented my 3D deconvolution routines to use singles, and the results are identical (to the order of the precision).  So coupling the halving of memory and of processing time, this is a huge improvement for me.  Hence the suggested idea here, as I have some other image processing steps (such as Wavelet-based denoising) which call the ASP Wavelet routines which call DLLs coded only for DBLs.  If the HPAL library hadn't including singles, I doubt I would have thought it worthwhile, but now I'd like to know whether this idea is even feasible or not.