cublas calls from device

I’m porting some code from Java to CUDA which includes calls to the BLAS library, so I’m using the corresponding CUBLAS calls in the CUDA code. I was wondering if there is any way to make CUBLAS calls from the device rather than the host, to allow for different function calls depending on the thread ID or block ID.

Thanks for any help.

No that is not possible with CUBLAS.

It is however possible with hand-written code.

global functions have to be called from host

device functions can be called from global functions.

so in your global function you can make a switch that decides which device function to call.