Undefined function or variable 'optIdx'. Error in sh (line 28) dev = gpuDevice( optIdx )? what is this

if dev = parallel.gpu.GPUDevice.select( optIdx );
else
dev = parallel.gpu.GPUDevice.current();
end
throw(E); % Strip off the stack.
end

Answers (1)

Sorry if this seems like a facetious answer - I may be missing the point. The error means you haven't defined the variable optIdx.
Ah, wait a minute, I'm just getting up to speed. You're displaying the contents of the function gpuDevice there aren't you? I'd have to know how you called gpuDevice to know how that went wrong.

Categories

Find more on Loops and Conditional Statements in Help Center and File Exchange

Products

Release

R2015a

Tags

Asked:

on 4 Nov 2018

Commented:

on 8 Nov 2018

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!