UseParallel + mexcuda: how to obtain CPU thread number?
Show older comments
I am using fsolve to solve a root-finding problem. The function evaluation component is expensive so I have written a mexcuda program to make use of GPUs. I have multiple GPUs on my system.
I would like to enable the "UseParallel" feature to compute Jacobians in parallel, with each instance of the evaluation calling a separate GPU. So my final program will look something like this:
root = fsolve(@objfun, "UseParallel", true);
function z = objfun(x)
z = GPUfunction(x, GPUdeviceToUse)
end
I would like to set the GPUdeviceToUse variable to depend on the CPU thread ID used within the "UseParallel" feature.
How can I obtain the CPU thread ID?
Accepted Answer
More Answers (0)
Categories
Find more on GPU Computing in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!