i’m using the cublas functions, the cublasSetVector and the cublasSdot among them, and though my program is simple i have results with no logic at all.

The guide says:

I don’t understand what incx and incy are. Are they the numbers of bytes? Since i have 2 floats vectors how much should they be?

I am pretty sure the errors i have are caused by that.

incx and incy are strides measured in floats. For example, if you have a vector in the cpu memory defined as float cpuvector[n] and a matrix and a vector in the gpu memory defined as

cublasSetVector( n, sizeof(float), cpuvector, 1, gpuvector, 1 ) copies cpuvector to gpuvector
cublasSetVector( n, sizeof(float), cpuvector, 1, gpumatrix, 1 ) copies cpuvector to the first column of gpumatrix
cublasSetVector( n, sizeof(float), cpuvector, 1, gpumatrix, n ) copies cpuvector to the first row of gpumatrix
cublasSdot( n, gpumatrix, 1, gpumatrix, n ) returns dot product of the first row and the first column of the matrix.

It’s same as with any other BLAS, say the one in the Intel MKL.

I still don’t undestand how to compute, for example, the dot product of the third row of a matrix and the fifth column of another matrix, if that can be done by cublasSdot function. Thank you in advance.

Yes you can :-) Assuming column-major storage (which is what CUBLAS uses in general), all elements of a column are stored consecutively. The elements of a row on the other hand are strided by the leading dimension (i.e. the number of rows of the matrix). So in your example one would pass to SDOT:

x start address of the third row of matrix A
incx LDA (leading dimension of A)
y start address of the fifth column of matrix B
incy 1