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

Tell if it where run on cpu or gpu.

上级 598a531f
...@@ -65,10 +65,10 @@ def execute(execute=True, verbose=True, M=2000, N=2000, K=2000, ...@@ -65,10 +65,10 @@ def execute(execute=True, verbose=True, M=2000, N=2000, K=2000,
if any([x.op.__class__.__name__ == 'Gemm' for x in if any([x.op.__class__.__name__ == 'Gemm' for x in
f.maker.env.toposort()]): f.maker.env.toposort()]):
impl = 'Used the cpu' impl = 'cpu'
elif any([x.op.__class__.__name__ == 'GpuGemm' for x in elif any([x.op.__class__.__name__ == 'GpuGemm' for x in
f.maker.env.toposort()]): f.maker.env.toposort()]):
impl = 'Used the gpu' impl = 'gpu'
else: else:
impl = 'ERROR, unable to tell if Theano used the cpu or the gpu:\n' impl = 'ERROR, unable to tell if Theano used the cpu or the gpu:\n'
impl += str(f.maker.env.toposort()) impl += str(f.maker.env.toposort())
...@@ -207,7 +207,7 @@ if __name__ == "__main__": ...@@ -207,7 +207,7 @@ if __name__ == "__main__":
options.N, options.K) options.N, options.K)
print print
print 'Total execution time: %.2fs' % t print 'Total execution time: %.2fs on %s.' % (t, impl)
print print
print ('Try to run this script a few times. Experience shows that' print ('Try to run this script a few times. Experience shows that'
' the first time is not as fast as followings calls. The' ' the first time is not as fast as followings calls. The'
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论