wellposed / hblas

haskell bindings for blas and lapack
www.wellposed.com
BSD 3-Clause "New" or "Revised" License
49 stars 19 forks source link

HBLAS.BLAS.FFI types #23

Open mxswd opened 10 years ago

mxswd commented 10 years ago

The types of the functions (i.e. cblas_sdot_unsafe) are Float and Double, when they are really CFloat and CDouble.

Also cblas_isamax_unsafe / cblas_idamax_unsafe is returning a CInt, when really it returns a CUInt.

Also, cblas_idamax_unsafe's 2nd argument takes a Float, when it should take a Double?

cartazio commented 10 years ago

is there any difference between CFloat vs Float and CDouble vs Double for the purposes of FFI? AFAIK, the C* versions of float and double are just newtype wrappers and then the ghc ffi work treats them as Float and Double? (i could be totally wrong here, so please correct me if i'm wrong.)

Good catch #define CBLAS_INDEX size_t seems to the the right defn, so it should be CSize right?

you're right, i'll check that shortly.

mxswd commented 10 years ago

Yeah, leave the Floats and Doubles.