[R-SIG-Mac] Re: float vs double on Macs [was Re: [Rd] NaN and linear algebra]

Jan de Leeuw deleeuw at stat.ucla.edu
Thu Mar 24 18:02:53 CET 2005


Is this done from R ? By passing floats (not doubles) from R to a C  
or FORTRAN routine in a compiled
bundle or dylib ?

Would it also be possible to build a bundle with routines compiled  
using SMP (using MPI or OpenMP)
and call these from R ?


On Mar 24, 2005, at 8:54 , Simon Urbanek wrote:

> On Mar 24, 2005, at 6:59 AM, Bill Northcott wrote:
>
>> PS  This discussion has given me another thought.  On MacOS X, it  
>> would be much faster to use floats instead of doubles because they  
>> can be directly processed by the Altivec section of the CPU.  I  
>> can see no way to have R use floats.  Would that be possible as a  
>> future enhancement or is it just too hard?
>
> To have just a rough idea about how "much faster" this would be,  
> here are some timings for 2000 runs of 1000x1000 matrix-vector  
> multiplications using vecLib's BLAS:
> G5 1.8GHz
> sgemv: 2.9s
> dgemv: 6.7s
>
> G4 1.5GHz
> sgemv: 10.1s
> dgemv: 17.3s
>
> The performance difference between double and float is actually  
> less astonishing (although is proves that altiVec is used - still)  
> than the G4 vs G5 comparison. vecLib for G5 seems to be fairly well  
> optimized and the G5 architecture seems to have better throughput.
>
> Anyway, I'm not quite sure switching from doubles to floats yields  
> big enough speed up to justify the effort. Maybe some Lapack test  
> would helpful, too, to have a bigger picture of this.
>
> Cheers,
> Simon
>
> PS: I'd rather move this part to R-SIG-Mac as this is actually a  
> Mac-only question.
>
> ______________________________________________
> R-devel at stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel
>

===
Jan de Leeuw; Distinguished Professor and Chair, UCLA Department of  
Statistics;
Editor: Journal of Multivariate Analysis, Journal of Statistical  
Software
US mail: 8130 Math Sciences Bldg, Box 951554, Los Angeles, CA 90095-1554
phone (310)-825-9550;  fax (310)-206-5658;  email: deleeuw at stat.ucla.edu
.mac: jdeleeuw ++++++  aim: deleeuwjan ++++++ skype: j_deleeuw
homepages: http://gifi.stat.ucla.edu ++++++ http://www.cuddyvalley.org
   
------------------------------------------------------------------------ 
-------------------------
           No matter where you go, there you are. --- Buckaroo Banzai
                    http://gifi.stat.ucla.edu/sounds/nomatter.au



More information about the R-SIG-Mac mailing list