Commit 493e779847dd36345af68cc043bda7db3c393a08

  • avatar
  • MichaƂ Januszewski <spock @gen…oo.org>
  • Tue Jan 26 09:38:24 CET 2010
Add a check for the presence of supported backends.
  
9393 grids = [x.__name__ for x in sym.KNOWN_GRIDS if x.dim == geo_class.dim]
9494 default_grid = grids[0]
9595
96 supported_backends = get_backends()
97
98 if not supported_backends:
99 raise ValueError('There are no supported compute backends on your system. Make sure pycuda or pyopencl are correctly installed.')
100
96101 parser = OptionParser()
97102
98103 parser.add_option('-q', '--quiet', dest='quiet', help='reduce verbosity', action='store_true', default=False)
126126 parser.add_option_group(group)
127127
128128 group = OptionGroup(parser, 'Run mode settings')
129 group.add_option('--backend', dest='backend', help='backend', type='choice', choices=get_backends(), default=get_backends()[0])
129 group.add_option('--backend', dest='backend', help='backend', type='choice', choices=supported_backends, default=supported_backends[0])
130130 group.add_option('--benchmark', dest='benchmark', help='benchmark mode, implies no visualization', action='store_true', default=False)
131131 group.add_option('--max_iters', dest='max_iters', help='number of iterations to run in benchmark/batch mode', action='store', type='int', default=0)
132132 group.add_option('--batch', dest='batch', help='run in batch mode, with no visualization', action='store_true', default=False)