Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

21
  • 24
    Of course myArray(:) = 0 is slow - it's moving loads of zeros from the CPU to the GPU for no reason. That doesn't mean MATLAB GPU capabilities are implemented poorly, it means you need to know how to use them; try myArray = gpuArray.zeros(size(myArray)) instead. Commented Jun 5, 2013 at 16:48
  • 2
    Sam, <code>myArray(:) = 0</code> should only move one integer from the CPU to the GPU - if implemented optimally. Using <code>gpuArray.zeros()</code> is even slower. For now I am using <code>myArray = myArray - myArray</code> which is faster - but still slow. I hope the Jacket functionality is coming with the next MATLAB release. Commented Jun 10, 2013 at 7:45
  • 4
    What size array are you trying to allocate and finding it slow? Note that in recent releases of Parallel Computing Toolbox, some operations execute asynchronously. Also, "a = a - a;" does not necessarily result in an array of all zeros, so I would avoid this pattern (hint: what if 'a' contained NaN or Inf?). (And rather contact The MathWorks with the details of your performance problem). Commented Jul 29, 2013 at 11:40
  • 3
    Here's what I've been able to pick from the web (part 1): In 2011, MathWorks and AccelerEyes sued and counter-sued each other over intellectual property issues. MathWorks alleged patent infringement of their Parallel Computing Toolbox product by AcceleEyes' Jacket product [ scribd.com/doc/59765193/MathWorks-v-AccelerEyes-et-al]. Commented Aug 5, 2013 at 17:07
  • 2
    I was happen to be at a Matlab seminar yesterday, and ask Loren Shure and some other TMW people this question. They refused to comment and the best I could get is that "there is something in the pipeline"... Commented Oct 11, 2013 at 18:03