提交 e8f61bf9 authored 作者: Frederic's avatar Frederic

Don't profile function used to test the driver at init time.

上级 632c17c0
...@@ -1049,6 +1049,7 @@ class FunctionMaker(object): ...@@ -1049,6 +1049,7 @@ class FunctionMaker(object):
mode.optimizer_time += opt_time mode.optimizer_time += opt_time
if profile: if profile:
profile.optimizer_time += opt_time profile.optimizer_time += opt_time
profile.validate_time += env.validate_time
_logger.debug('Optimizing took %f seconds', opt_time) _logger.debug('Optimizing took %f seconds', opt_time)
#Add deep copy to respect the memory interface #Add deep copy to respect the memory interface
......
...@@ -24,7 +24,8 @@ def test_nvidia_driver1(): ...@@ -24,7 +24,8 @@ def test_nvidia_driver1():
""" """
a = numpy.random.rand(10000).astype("float32") a = numpy.random.rand(10000).astype("float32")
A = cuda.shared_constructor(a) A = cuda.shared_constructor(a)
f = theano.function(inputs=[], outputs=A.sum(), mode=mode_with_gpu) f = theano.function(inputs=[], outputs=A.sum(), mode=mode_with_gpu,
profile=False)
topo = f.maker.env.toposort() topo = f.maker.env.toposort()
assert len(topo) == 2 assert len(topo) == 2
assert sum(isinstance(node.op, B.GpuSum) for node in topo) == 1 assert sum(isinstance(node.op, B.GpuSum) for node in topo) == 1
...@@ -56,7 +57,8 @@ def test_nvidia_driver3(): ...@@ -56,7 +57,8 @@ def test_nvidia_driver3():
of the gpu device of the gpu device
""" """
var = cuda.fvector() var = cuda.fvector()
f = theano.function([var], var + 1, mode=mode_with_gpu) f = theano.function([var], var + 1, mode=mode_with_gpu,
profile=False)
topo = f.maker.env.toposort() topo = f.maker.env.toposort()
assert any([isinstance(node.op, cuda.GpuElemwise) for node in topo]) assert any([isinstance(node.op, cuda.GpuElemwise) for node in topo])
assert theano.sandbox.cuda.use.device_number is not None assert theano.sandbox.cuda.use.device_number is not None
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论