提交 3b9783bc authored 作者: Alexander Matyasko's avatar Alexander Matyasko

Wrap magma_init `with ctx`

上级 411b616e
...@@ -379,6 +379,7 @@ class GpuMagmaBase(COp): ...@@ -379,6 +379,7 @@ class GpuMagmaBase(COp):
from skcuda.magma import magma_init from skcuda.magma import magma_init
ctx = node.inputs[0].type.context ctx = node.inputs[0].type.context
if not getattr(ctx, 'is_magma_initialized', False): if not getattr(ctx, 'is_magma_initialized', False):
with ctx:
magma_init() magma_init()
ctx.is_magma_initialized = True ctx.is_magma_initialized = True
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论