SDK functions in concert with Jacket MGL

[Old posts from the commercial version of ArrayFire] Discussion of ArrayFire using CUDA or OpenCL.

Moderator: pavanky

SDK functions in concert with Jacket MGL

Postby melonakos » Thu Jul 29, 2010 10:34 pm

One user just emailed the following question to us:

Let's say I have a compiled CUDA mex file (with or without Jacket SDK involved). Can I utilize Jacket MGL to run it across 8 GPU's (residing in the same box) using let's say a parfor loop, or something of that nature. Or would I have to run 8 different instances of Matlab with Jacket on it, to take advantage of the multiple GPU setup?

Great question! The short answer is "Yes" and SDK function (or MEX function for that matter) is compatible with Jacket MGL. So yes, you can generate using MEX or the Jacket SDK, a function "myfun.mexw64" and then you can call that function in a PARFOR loop. In the case of Jacket SDK functions, Jacket will ensure that the computations are evenly allocated across all GPUs in the system. So in the case of a system with 8 GPUs, you would have 8 workers with each worker launching an instance of your CUDA code on that worker's designated GPU.

Of course, you can also do this in 8 separate MATLAB sessions, but that is not as nice as actually using Jacket MGL (

Hope this helps!

John Melonakos (
User avatar
Posts: 503
Joined: Tue Jun 10, 2008 9:49 am

Return to [archive-commercial] Programming & Development with ArrayFire