Re: [Rd] Manipulating single-precision (float) arrays in .Call functions

2011-07-19 Thread Duncan Murdoch
On 11-07-19 7:48 AM, Matthew Dowle wrote: "Prof Brian Ripley" wrote in message news:alpine.lfd.2.02.1107190640280.28...@gannet.stats.ox.ac.uk... On Mon, 18 Jul 2011, Alireza Mahani wrote: Simon, Thank you for elaborating on the limitations of R in handling float types. I think I'm pretty mu

Re: [Rd] Manipulating single-precision (float) arrays in .Call functions

2011-07-19 Thread Simon Urbanek
On Jul 19, 2011, at 7:48 AM, Matthew Dowle wrote: > > "Prof Brian Ripley" wrote in message > news:alpine.lfd.2.02.1107190640280.28...@gannet.stats.ox.ac.uk... >> On Mon, 18 Jul 2011, Alireza Mahani wrote: >> >>> Simon, >>> >>> Thank you for elaborating on the limitations of R in handling flo

Re: [Rd] Manipulating single-precision (float) arrays in .Call functions

2011-07-19 Thread Matthew Dowle
"Prof Brian Ripley" wrote in message news:alpine.lfd.2.02.1107190640280.28...@gannet.stats.ox.ac.uk... > On Mon, 18 Jul 2011, Alireza Mahani wrote: > >> Simon, >> >> Thank you for elaborating on the limitations of R in handling float >> types. I >> think I'm pretty much there with you. >> >> As

Re: [Rd] Manipulating single-precision (float) arrays in .Call functions

2011-07-18 Thread Prof Brian Ripley
On Mon, 18 Jul 2011, Alireza Mahani wrote: Simon, Thank you for elaborating on the limitations of R in handling float types. I think I'm pretty much there with you. As for the insufficiency of single-precision math (and hence limitations of GPU), my personal take so far has been that double-pr

Re: [Rd] Manipulating single-precision (float) arrays in .Call functions

2011-07-18 Thread Alireza Mahani
Simon, Thank you for elaborating on the limitations of R in handling float types. I think I'm pretty much there with you. As for the insufficiency of single-precision math (and hence limitations of GPU), my personal take so far has been that double-precision becomes crucial when some sort of erro

Re: [Rd] Manipulating single-precision (float) arrays in .Call functions

2011-07-18 Thread Simon Urbanek
On Jul 18, 2011, at 6:15 PM, Alireza Mahani wrote: > Duncan, > > Thank you for your reply. This is a rather unfortunate limitation, because > for large data sizes there is a significant difference between the > performance of '.C' and '.Call'. I think you may have missed the main point - R do

Re: [Rd] Manipulating single-precision (float) arrays in .Call functions

2011-07-18 Thread Alireza Mahani
Duncan, Thank you for your reply. This is a rather unfortunate limitation, because for large data sizes there is a significant difference between the performance of '.C' and '.Call'. I will have to do some tests to see what sort of penalty I incur for copying from double to float inside my C++ cod

Re: [Rd] Manipulating single-precision (float) arrays in .Call functions

2011-07-18 Thread Duncan Murdoch
On 18/07/2011 11:52 AM, Alireza Mahani wrote: I am writing a wrapper function in C++ that calls a GPU kernel. My array type for the GPU kernel is float, so I would like my wrapper function to receive float arrays from R. I understand that I can use 'as.single' in R to copy a double-precision vect

[Rd] Manipulating single-precision (float) arrays in .Call functions

2011-07-18 Thread Alireza Mahani
I am writing a wrapper function in C++ that calls a GPU kernel. My array type for the GPU kernel is float, so I would like my wrapper function to receive float arrays from R. I understand that I can use 'as.single' in R to copy a double-precision vector from R in single-precision format while using