I have 2 simple matrices A and B and I'm calculating their multiplication.
The arrays looks like this (using numpy as as mockup)
A=np.array(([1,2,3],[4,5,6])).astype(np.float64)
B=np.array(([7,8],[9,10],[11,12])).astype(np.float64)
Here are the shapes of the Matrix
A: (2, 3)
B: (3, 2)
Now, I am trying to do this using cublasDgemmBatched to get the product.
I am confused on what my m,n,and k values should be when applying cublasDgemmBatched.
Also, I'm not sure what my leading dimension (lda, ldb, ldc) of the array would be.
There is a nice 3d example here but I can't seem to get this function to work on 2d matrices.
Ideally, i would like to get the same results as np.dot.
m = 2, n = 2, k = 3, lda = 3, ldb = 2, ldc = 2. Although I cannot say with confidence whether or not this will work. Or, referencing the example you linked to, just setl=1. - inJeanscublasDgemm. Adjusting the 3D example to fit your 2D one might look like thiscublasDgemm(self.cublas_handle, 'n','n', 2, 2, 3, alpha, b_arr.gpudata, 2, a_arr.gpudata, 3, beta, c_arr.gpudata, 2)- inJeans