Skip to content
Prev 46250 / 63458 Next

question about Makeconf and nvcc/CUDA

Hi Erin

 Glad you are making progress on this with Brian's help.

 I thought I would mention a different approach that might save you some
programming time and actually make the code more flexible at the same time.
Basically, in a high-level language like R, it is nice to keep the code
calling a GPU kernel also high-level rather than writing code in C/C++
to do the transfer of data to and from the CPU and GPU.

Simon's OpenCL package (on CRAN) and the new RCUDA package (www.omegahat.org/RCUDA)
allow us to load and invoke kernels directly from R.
These provide more flexibility for invoking GPU kernels from R than fixed C/C++ code.

RCUDA provides an interface to almost all of the CUDA API and so allows us to transfer
values from R to the GPU and back (in different ways), invoke kernels asynchronously, etc.
I haven't built the package on Windows yet, but may be able to get to that in the next
few days.

With a Windows binary of RCUDA (or OpenCL), you would be able to skip nvcc in your
package by  compiling the kernel code generically so that it contains code for GPUs
with different  capabilities (e.g. sm_20, sm_30, sm_35).

In the last few days, I have also managed to compile very simple R code
directly in R to PTX code that we can load and invoke using RCUDA.
The compilation uses the Rllvm and RLLVMCompile packages. So in the
future, I expect we will be able to compile simple R functions
to native and PTX code.

 D.
On 7/17/13 11:45 PM, Hodgess, Erin wrote: