Hi, I have a program where I have to perform a dot (scalar product) of an array by a matrix. For e.g., consider the following code snippet:
####### from pycuda import autoinit, gpuarray import numpy as np a_cpu = np.array([0, 1], dtype = np.float32) b_cpu = np.array([[0, 1, 2], [0, 1, 2]], dtype = np.float32) dot_cpu = np.dot(a_cpu, b_cpu) #yelds a 1x3 np.array a_gpu = gpuarray.to_gpu(a_cpu) b_gpu = gpuarray.to_gpu(b_cpu) dot_gpu = gpuarray.dot(a_gpu,b_gpu) # yelds a 0d array??? ######## So, I have two issues: i) How to take the scalar result from dot_gpu? ii) How to obtain the correct result? ( = numpy result) I could do the dot operation over each column, but then it will never outperform the cpu equivalent, am I correct? Cheers RL _______________________________________________ PyCUDA mailing list [email protected] http://lists.tiker.net/listinfo/pycuda
