Advertisement

Calling DLLs from R

Started by March 25, 2022 05:26 PM
3 comments, last by taby 2 years, 10 months ago

I've got a small project, which is a DLL that gets called from R.

The source is at:

https://github.com/sjhalayka/r_dll_test​

Regarding dllmain.cpp:

Basically, I try to sum some numbers on the GPU, and the answer is not quite right (but close).

However, the CPU implementation works perfectly (as done the R version of sum()).

Any ideas? I'm at my wit's end LOL

Hmm. If I force it to do the sum on the GPU doing 1 pixel at a time, it works. It's just ridiculously slow however.

size_t curr_size = 1;//max_tex_size;

Advertisement

I don't want to derail your thread so I'll just accept any answer you may give.

Why are you learning R?

🙂🙂🙂🙂🙂<←The tone posse, ready for action.

Please, speak your mind. I'm a newb when it comes to R.

I am learning R to impress a statistician at the local university. It might lead to an internship.

I have also parsed the CRUTEM5 data with R, using the basics like variance, covariance, and standard deviation. There is a positive trend.

I've been told that C++ programmers are in demand because they can write portions of their code in DLLs, hopefully speeding up the data pipeline. We'll see. So far, for fun, I timed the sum() function in R, and the functions in the DLL as well. The GPU version is 10x slower than the CPU version, which itself is 10x slower than the R version. Sum() isn't exactly the meatiest of algorithms, so more effort must be put into coming up with more meaty algorithms, whatever those might be.

This topic is closed to new replies.

Advertisement