The LAPACK routine works on an iPhone simulator, but not on a device

advertisements

I'm using the Accelerate framework to solve a under/overdetermined system of linear equations. The routine I'm using is dgelsd_ originally from LAPACK.

dgelsd_( &m, &n, &nrhs, a_t, &lda, b, &ldb, s, &RCOND, &IRANK, work, &workSize, iWork, &info);

This works fine in the simulator, where on supplying matrices a_t and b, the result is returned correctly in b. However, when I try this on the device, the result is all zeroes.

Where could I be going wrong? I have allocated a certain amount of working memory for the routine, as required, but I ran a check with the profiler and memory doesn't seem to be the issue.

Has anyone got LAPACK routines to work correctly on the iPhone device? Thanks.

Edit: iPhone SDK version 4.2, Device iPhone 4


Looks like it's a known issue when using double precision.

Solution: Use single-precision, i.e. Floats.