You are now following this question
- You will see updates in your followed content feed.
- You may receive emails, depending on your communication preferences.
fminunc : A VERY STRANGE PROBLEM!


23 Comments
Accepted Answer
-
-
Direct link to this answer
https://se.mathworks.com/matlabcentral/answers/1845178-fminunc-a-very-strange-problem#answer_1093113
-
-
Direct link to this answer
https://se.mathworks.com/matlabcentral/answers/1845178-fminunc-a-very-strange-problem#answer_1093113
10 Comments
More Answers (2)
-
-
Direct link to this answer
https://se.mathworks.com/matlabcentral/answers/1845178-fminunc-a-very-strange-problem#answer_1093743
-
-
Direct link to this answer
https://se.mathworks.com/matlabcentral/answers/1845178-fminunc-a-very-strange-problem#answer_1093743
- Allocate memory once and reuse it for subsequent calls. Use cfg.GpuConfig.EnableMemoryManager = true; to enable this.
- Take MATLAB gpuArray as input. You are doing this already. But this may not always help. for example, if GPU Coder choices to keep the first use a particular input on CPU (for some reason), it would incur an additional copy.
- you may use gpucoder.profile ( https://www.mathworks.com/help/gpucoder/ref/gpucoder.profile.html ) to find the bottlenecks.
- Use of cell arrays and structures may not play will with GPU Coder with regards to copies. consider break the cell array elements to separate variables.
- Take a look at the generated code and see GPU Coder is able to parallelize the key piece of your code.
- If you are open to share your code, I can take a quick look.
5 Comments
-
-
Direct link to this answer
https://se.mathworks.com/matlabcentral/answers/1845178-fminunc-a-very-strange-problem#answer_1094023
-
-
Direct link to this answer
https://se.mathworks.com/matlabcentral/answers/1845178-fminunc-a-very-strange-problem#answer_1094023
11 Comments
See Also
Categories
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!An Error Occurred
Unable to complete the action because of changes made to the page. Reload the page to see its updated state.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina (Español)
- Canada (English)
- United States (English)
Europe
- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)
- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)
Asia Pacific
- Australia (English)
- India (English)
- New Zealand (English)
- 中国
- 日本Japanese (日本語)
- 한국Korean (한국어)