Undefined function or variable 'optIdx'. Error in sh (line 28) dev = gpuDevice( optIdx )? what is this
Show older comments
if dev = parallel.gpu.GPUDevice.select( optIdx );
else
dev = parallel.gpu.GPUDevice.current();
end
throw(E); % Strip off the stack.
end
1 Comment
Walter Roberson
on 8 Nov 2018
That code appears incomplete. You cannot have a = inside an if statement.
Answers (1)
Joss Knight
on 5 Nov 2018
Edited: Joss Knight
on 7 Nov 2018
0 votes
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
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!