提交 eccac8d6 authored 作者: Frederic Bastien's avatar Frederic Bastien 提交者: Reyhane Askari

Make the memory profiler see the new back-end as GPU memory.

Conflicts: theano/compile/profiling.py
上级 0c299535
...@@ -829,8 +829,8 @@ class ProfileStats(object): ...@@ -829,8 +829,8 @@ class ProfileStats(object):
new allocation. new allocation.
""" """
from theano.sandbox.cuda import CudaNdarrayType
from theano.gpuarray import GpuArrayType from theano.gpuarray import GpuArrayType
# Initial Mem info values [CPU, GPU] # Initial Mem info values [CPU, GPU]
node_memory_size = [0, 0] node_memory_size = [0, 0]
running_memory_size = [0, 0] running_memory_size = [0, 0]
...@@ -880,7 +880,7 @@ class ProfileStats(object): ...@@ -880,7 +880,7 @@ class ProfileStats(object):
# allocated by the node # allocated by the node
idx2 = 0 idx2 = 0
for out in node.outputs: for out in node.outputs:
if isinstance(out.type, GpuArrayType): if isinstance(out.type, (CudaNdarrayType, GpuArrayType)):
cg = 1 cg = 1
else: else:
cg = 0 cg = 0
...@@ -922,7 +922,7 @@ class ProfileStats(object): ...@@ -922,7 +922,7 @@ class ProfileStats(object):
for ins in set(node.inputs): for ins in set(node.inputs):
assert not (ins in view_of and viewed_by[ins]) assert not (ins in view_of and viewed_by[ins])
# we trac the original var, so this shouldn't happen # we trac the original var, so this shouldn't happen
if isinstance(ins.type, GpuArrayType): if isinstance(ins.type, (CudaNdarrayType, GpuArrayType)):
cg = 1 cg = 1
else: else:
cg = 0 cg = 0
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论