1
votes

I have a problem which involves many matrix multiplications (classical and kronecker product) . I read that GPU are suited for this task and since speed is my main objective I was thinking about using Cuda with c++. However I would have to learn Cuda first. So before I start waisting my time I thought I should ask wiser people first. Can Cuda speed up my calculations? The matrices are generally quite small around 20x50. Sometimes involving a third dimension so it becomes a 20x50x10 matrix. I can only multiply a couple of matrices at one step in time (10-100). But I need to do several millions iteration after each other (Monte Carlo simulation). Currently I am using armadillo and matlab.

1
You would see some speed ups if your matrices were bigger, I think now you might face bandwidth bottlenecks worse than computation timesStack Player
You can only speed up your calculations using Cuda if they are parallelizable and you do it properly. Matlab probably already parallelizes matrix operations.duffymo
Not probably but surely. Matlab/octave have pretty good vectorization, and matrices this size are absolutely not problematic.Ash
If the output of one iteration is fed to the input of another iteration, the data transfer may be not a bottleneck. Otherwise, you will confront data movement overhead. One possible solution can be overlapping computation and transfer overhead, though I'm not sure if matlab supports this feature.BugRepairMan

1 Answers

1
votes

You would see some speed ups if your matrices were bigger, now you will be facing data bandwidth bottlenecks worse than computation time delays.

Something worth considering is to see mathematical tricks that could allow you (based on your computations) to combine multiple instances into bigger matrices then transfer and compute. But usually this is quite difficult and probably not always doable.