提交 9b0f65a8 authored 作者: Frédéric Bastien's avatar Frédéric Bastien 提交者: GitHub

Merge pull request #5436 from abergeron/init_blas

Initialize the blas kernels when creating the contexts.
......@@ -93,6 +93,12 @@ def init_dev(dev, name=None):
(gmem//MB, context.total_gmem//MB,
gmem/context.total_gmem, dev),
file=sys.stderr)
# Initialise the blas kernels. We do this after the
# preallocation to not fragment the heap accidentally.
tmp = pygpu.empty((2, 2), dtype='float32', context=context)
pygpu.blas.gemm(0, tmp, tmp, 0, tmp, overwrite_c=True)
del tmp
else:
context = init_dev.devmap[dev]
# This will map the context name to the real context object.
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论