def test(problem, **kwargs): """ Test numerical correctness with different parameters. """ run = model_type[problem]['run'] sweep_options = ('space_order', 'time_order', 'dse', 'dle', 'autotune') last_res = None for params in sweep(kwargs, keys=sweep_options): kwargs.update(params) _, _, _, res = run(**kwargs) if last_res is None: last_res = res else: for i in range(len(res)): assert np.isclose(res[i], last_res[i])
def test(problem, **kwargs): """ Test numerical correctness with different parameters. """ run = tti_run if problem == 'tti' else acoustic_run sweep_options = ('space_order', 'time_order', 'dse', 'dle', 'autotune') last_res = None for params in sweep(kwargs, keys=sweep_options): kwargs.update(params) _, _, _, res = run(**kwargs) if last_res is None: last_res = res else: for i in range(len(res)): assert np.isclose(res[i], last_res[i])