def test_nvidia_driver1():
 a = numpy.random.rand(10000).astype('float32')
 A = cuda.shared_constructor(a)
 f = theano.function(inputs=[], outputs=A.sum(), mode=mode_with_gpu, profile=False)
 topo = f.maker.fgraph.toposort()
 assert (len(topo) == 2)
 if (sum((isinstance(node.op, B.GpuCAReduce) for node in topo)) != 1):
  msg = '\n DCTB '.join(([('Expected exactly one occurrence of GpuCAReduce ' + 'but got:')] + [str(app) for app in topo]))
  raise AssertionError(msg)
 if (not numpy.allclose(f(), a.sum())):
  raise Exception('The nvidia driver version installed with this OS does not give good results for reduction.Installing the nvidia driver available on the same download page as the cuda package will fix the problem: http://developer.nvidia.com/cuda-downloads')

def test_nvidia_driver1 ( ) : a = numpy . random . rand ( 10000 ) . astype ( 'float32' ) A = cuda . shared_constructor ( a ) f = theano . function ( inputs = [ ] , outputs = A . sum ( ) , mode = mode_with_gpu , profile = False ) topo = f . maker . fgraph . toposort ( ) assert ( len ( topo ) == 2 ) if ( sum ( ( isinstance ( node . op , B . GpuCAReduce ) for node in topo ) ) != 1 ) : msg = '\n DCTB ' . join ( ( [ ( 'Expected exactly one occurrence of GpuCAReduce ' + 'but got:' ) ] + [ str ( app ) for app in topo ] ) ) raise AssertionError ( msg ) if ( not numpy . allclose ( f ( ) , a . sum ( ) ) ) : raise Exception ( 'The nvidia driver version installed with this OS does not give good results for reduction.Installing the nvidia driver available on the same download page as the cuda package will fix the problem: http://developer.nvidia.com/cuda-downloads' )
some nvidia driver give bad result for reduction this execute some reduction test to ensure it run correctly .