Discussion:
[PyCUDA] gpuarray matrix vector multiply
C***@csiro.au
2016-03-29 00:27:56 UTC
Permalink
Hi team,

Is it possible to perform a matrix vector multiply using the gpuarray.dot() method (or maybe a better one)?

I can individually multiply matrix rows by a vector

gpuarray.dot(d_A[0, :], d_b)

but don't seem to be able to multiply a whole matrix by a vector?

gpuarray.dot(d_A, d_b)

It returns a result, but it is just a bogus integer, not an array.

Thanks


Christopher Watkins
Applications Support Specialist
IM&T | Scientific Computing
CSIRO
E ***@csiro.au T +61 3 9545 2369
Private Bag 10, Clayton South, Vic, 3169
www.csiro.au

PLEASE NOTE
The information contained in this email may be confidential or privileged. Any unauthorised use or disclosure is prohibited. If you have received this email in error, please delete it immediately and notify the sender by return email. Thank you. To the extent permitted by law, CSIRO does not represent, warrant and/or guarantee that the integrity of this communication has been maintained or that the communication is free of errors, virus, interception or interference.
Lev Givon
2016-03-29 03:26:55 UTC
Permalink
Post by C***@csiro.au
Hi team,
Is it possible to perform a matrix vector multiply using the gpuarray.dot()
method (or maybe a better one)?
I can individually multiply matrix rows by a vector
gpuarray.dot(d_A[0, :], d_b)
but don't seem to be able to multiply a whole matrix by a vector?
gpuarray.dot(d_A, d_b)
It returns a result, but it is just a bogus integer, not an array.
Thanks
scikit-cuda has a dot function that can multiple vectors/matrices:

http://scikit-cuda.readthedocs.org/en/latest/generated/skcuda.linalg.dot.html
--
Lev Givon
Bionet Group | Neurokernel Project
http://lebedov.github.io/
http://neurokernel.github.io/
C***@csiro.au
2016-03-29 05:19:31 UTC
Permalink
Thanks,

That was exactly what I was looking for. Is scikit-cuda maintained as well as pycuda?

Christopher Watkins 
Applications Support Specialist
IM&T | Scientific Computing
CSIRO
E ***@csiro.au T +61 3 9545 2369
Private Bag 10, Clayton South, Vic, 3169
www.csiro.au
 
PLEASE NOTE
The information contained in this email may be confidential or privileged. Any unauthorised use or disclosure is prohibited. If you have received this email in error, please delete it immediately and notify the sender by return email. Thank you. To the extent permitted by law, CSIRO does not represent, warrant and/or guarantee that the integrity of this communication has been maintained or that the communication is free of errors, virus, interception or interference.

-----Original Message-----
From: Lev Givon [mailto:***@columbia.edu]
Sent: Tuesday, 29 March 2016 2:27 PM
To: Watkins, Chris (IM&T, Clayton) <***@csiro.au>
Cc: ***@tiker.net
Subject: Re: [PyCUDA] gpuarray matrix vector multiply
Post by C***@csiro.au
Hi team,
Is it possible to perform a matrix vector multiply using the
gpuarray.dot() method (or maybe a better one)?
I can individually multiply matrix rows by a vector
gpuarray.dot(d_A[0, :], d_b)
but don't seem to be able to multiply a whole matrix by a vector?
gpuarray.dot(d_A, d_b)
It returns a result, but it is just a bogus integer, not an array.
Thanks
scikit-cuda has a dot function that can multiple vectors/matrices:

http://scikit-cuda.readthedocs.org/en/latest/generated/skcuda.linalg.dot.html
--
Lev Givon
Bionet Group | Neurokernel Project
http://lebedov.github.io/
http://neurokernel.github.io/
Andreas Kloeckner
2016-03-29 05:32:11 UTC
Permalink
Post by C***@csiro.au
Thanks,
That was exactly what I was looking for. Is scikit-cuda maintained as well as pycuda?
Lev may be hesitant to say it: Yes, it is. It's been around for almost
as long as PyCUDA.

Andreas
C***@csiro.au
2016-03-29 21:01:35 UTC
Permalink
Okay,

Great. Thank guys. I will give it a go.

Thanks

Christopher Watkins 
Applications Support Specialist
IM&T | Scientific Computing
CSIRO
E ***@csiro.au T +61 3 9545 2369
Private Bag 10, Clayton South, Vic, 3169
www.csiro.au
 
PLEASE NOTE
The information contained in this email may be confidential or privileged. Any unauthorised use or disclosure is prohibited. If you have received this email in error, please delete it immediately and notify the sender by return email. Thank you. To the extent permitted by law, CSIRO does not represent, warrant and/or guarantee that the integrity of this communication has been maintained or that the communication is free of errors, virus, interception or interference.

-----Original Message-----
From: Andreas Kloeckner [mailto:***@informa.tiker.net]
Sent: Tuesday, 29 March 2016 4:32 PM
To: Watkins, Chris (IM&T, Clayton) <***@csiro.au>; ***@columbia.edu
Cc: ***@tiker.net
Subject: Re: [PyCUDA] gpuarray matrix vector multiply
Post by C***@csiro.au
Thanks,
That was exactly what I was looking for. Is scikit-cuda maintained as well as pycuda?
Lev may be hesitant to say it: Yes, it is. It's been around for almost as long as PyCUDA.

Andreas

_______________________________________________
PyCUDA mailing list

Loading...