提交 1003abb0 authored 作者: abergeron's avatar abergeron

Merge pull request #2953 from nouiz/small

Small
...@@ -179,9 +179,10 @@ Manual Openblas instruction ...@@ -179,9 +179,10 @@ Manual Openblas instruction
I believe this is outdated, my machine seems to be using 8 threads I believe this is outdated, my machine seems to be using 8 threads
happily with the binary openblas... happily with the binary openblas...
The openblas included in Ubuntu is limited to 2 threads. If you want The openblas included in some older Ubuntu version is limited to 2
to use more cores at the same time, you will need to compile it threads. Ubuntu 14.04 do not have this limit. If you want to use more
yourself. Here is some code that will help you. cores at the same time, you will need to compile it yourself. Here is
some code that will help you.
.. code-block:: bash .. code-block:: bash
......
...@@ -1499,7 +1499,8 @@ class NavigatorOptimizer(Optimizer): ...@@ -1499,7 +1499,8 @@ class NavigatorOptimizer(Optimizer):
replacements = replacements.values() replacements = replacements.values()
elif not isinstance(replacements, (tuple, list)): elif not isinstance(replacements, (tuple, list)):
raise TypeError('Optimizer %s gave wrong type of replacement. ' raise TypeError('Optimizer %s gave wrong type of replacement. '
'Expected list or tuple.' % lopt) 'Expected list or tuple. Got %s' % (
lopt, replacements))
if len(old_vars) != len(replacements): if len(old_vars) != len(replacements):
raise ValueError('Optimizer %s gave wrong number of replacements' raise ValueError('Optimizer %s gave wrong number of replacements'
% lopt) % lopt)
......
...@@ -307,7 +307,7 @@ static size_t work_size = 0; ...@@ -307,7 +307,7 @@ static size_t work_size = 0;
* request a single chunk of memory at a time since it is reused. * request a single chunk of memory at a time since it is reused.
*/ */
void *get_work_mem(size_t sz) { void *get_work_mem(size_t sz) {
if (sz < work_size) if (sz <= work_size)
return work_mem; return work_mem;
device_free(work_mem); device_free(work_mem);
work_mem = device_malloc(sz); work_mem = device_malloc(sz);
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论