tags:

views:

326

answers:

1
+3  Q: 

BLAS and CUBLAS

I'm wondering about Nvidia's CUBLAS Library. Does anybody have experience with it? For example if I write a C program using BLAS will I be able to replace the calls to BLAS with calls to CUBLAS? Or even better implement a mechanism which let's the user choose at runtime?

What about if I use the BLAS Library provided by Boost with C++?

+2  A: 

CUBLAS is, IIRC, API compatible with the standard BLAS. So switching from standard BLAS to CUBLAS should be as simple as relinking your application. If you want it selectable at runtime, one option would be to use dlopen() or equivalent to open an .so at runtime.

Boost uBLAS is, again IIRC, partly a wrapper around standard BLAS, so it should be possible to configure it so that you link to CUBLAS.

janneb
Thx for the hint, I'll try this out later.
Nils
default cublas assumes pointers are GPU device pointers.you have to twiddle a little bit, otherwise you will get junk. ublas is nothing like regular blas interface-wise, it may be possible, but it will not be easy to use cuda blas with ublas
aaa
As far as I can tell, Boost-uBLAS is not a wrapper around std BLAS, but a reimplementation. The code does not in any way call the std BLAS libraries.
rcollyer