CUDA: Customize number of used processors

  • Follow


Hey there,

I want to calculate a jacobi matrix with a finite-difference-method and want to benchmark and compare it to CPU calculation. Now I have a simple function which calculates the Difference quotient for a certain working point (x,y,z). I want to bench the times to calculate it on 20 processors, on 30 processors, on 40...50, 60, 70 etc etc.

So is there any possibility to define how many processors should be used in parallel and to define that each processor runs ONE calculation (like in MPI, where I can say:

processor 1 -> calculate f(1,1,1)
processor 2 -> calculate f(1,1,2)
....
processor N -> caulculate (1,1,n)

), so it's like a master-slave-system. And at the end, I gather the calculations together and put them together.
Is this possible in matlab, or is it at least (if not in matlab) possible in C++-Cuda to control and manage which processors does what?

Thanks so far!
0
Reply Björn 1/31/2011 5:12:04 PM

"Björn" wrote in message <ii6qh4$bmm$1@fred.mathworks.com>...
> Is this possible in matlab, or is it at least (if not in matlab) possible in C++-Cuda to control and manage which processors does what?

You'll have to do this in CUDA yourself.  You'll want to use if-else statements to control what gets executed in each of the blocks. And you can set how many threads get assigned to the blocks.

If you want to call this CUDA code from MATLAB, the most efficient way is to use the Jacket SDK, learn more here:  http://blog.accelereyes.com/blog/2010/10/29/jacket_sdk_trumps_mex/
0
Reply John 1/31/2011 9:38:04 PM


Okay thanks so far. What is meant by blocks and processors per block? Do you know any example which does what I'm looking for?

Thanks so far!
0
Reply Björn 2/1/2011 10:44:04 AM

2 Replies
291 Views

(page loaded in 0.125 seconds)

Similiar Articles:













7/25/2012 6:35:53 PM


Reply: