cublas API questions Clarification about API

Hi,

I have a few questions about the cublas implementation. From everything I can tell, the functions in cublas.h are host functions (rather than device or global). Thus, I call them on the CPU and they run there. This is how they are used in the simpleCUBLAS example and I have been able to use them this way in simple examples of my own. From what I can tell, you cannot call the CUBLAS routines within a device function.

But…

The CUBLAS routines take pointers to things that live on the device and these pointers (according to the CUBLAS docs) cannot be dereferenced on the host.

But…

At the beginning of the CUBLAS docs, it says that calls like:

SDOT(KRANK+1-J,W(I,J),MDW,W(J,J),MDW)

become the following in CUBLAS:

#define IDX2(i,j,ld) (((j)*(ld))+(i))
cublasSdot(krank+1-j,w[IDX(i,j,ldw)],mdw,w[IDX2(i,j,ldw)],mdw)

But this last call can’t make sense. If I understand things correctly, w is a pointer to a chunk of device memory. Thus you can’t dereference it on the host like this!! Am I crazy?

If this is the case, how do you really do a call like the above cublasSdot example? I am particularly interested in doing blas operations on row and columns of matrices.

Cheers,

Brian