cublas function to scale the diagonal values of a matrix


I have a n x n matrix and I would like to use cublas to basically just scale each column by some valu. So I would like to pass a vector and this matrix and the column entries entries (:, k) of the matrix should be multiplied by the kth element of the input vector.

Is there a way to do this in cublas?


you want A * diag(v) where A is nxn matrix, v is a nx1 vector.

this problem is memory-bound, try BLAS1 function cublasSscal()