Open kylemcdonald opened 5 years ago
I'd be happy to take a PR to realize this.
I just write a package to hack the code in Elementwise
to support basic broadcasting and also extend GPUArray
https://github.com/zzjjbb/broadcasting_pycuda
Currently, it's experimental and I don't have time to merge it in pycuda. If you want to use some other functions, you can just copy & paste that part from pycuda. Maybe also need to modify it a little by yourself.
Use at your own risk...
I would like to compute squared euclidean distance between all (m x n) combinations of two lists with length m and n using pycuda. Here is some numpy-compatible code:
This doesn't work with pycuda, so I wrote a similar chunk of test code using pycuda:
The error in both cases is as follows:
Does pycuda not support broadcasting? I checked the FAQ and searched the documentation for "broadcasting" and couldn't find any clear statement on this. Or is it necessary to write a custom kernel to handle this? Thank you :)