提交 4b667dac authored 作者: Frédéric Bastien's avatar Frédéric Bastien

Merge pull request #3796 from abergeron/gpuarray_prealloc

Cap memory preallocation to 98% of the total.
...@@ -53,7 +53,7 @@ def init_dev(dev, name=None): ...@@ -53,7 +53,7 @@ def init_dev(dev, name=None):
init_dev.devmap[dev] = ctx init_dev.devmap[dev] = ctx
if config.gpuarray.preallocate != 0: if config.gpuarray.preallocate != 0:
if config.gpuarray.preallocate < 1: if config.gpuarray.preallocate < 1:
gmem = config.gpuarray.preallocate * ctx.total_gmem gmem = min(config.gpuarray.preallocate, 0.98) * ctx.total_gmem
else: else:
gmem = config.gpuarray.preallocate * (1024*1024) gmem = config.gpuarray.preallocate * (1024*1024)
# This will allocate and immediatly free an object of size gmem # This will allocate and immediatly free an object of size gmem
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论