def get_context(backend): if backend == 'cuda': from compyle.cuda import set_context set_context() from pycuda.autoinit import context return context elif backend == 'opencl': from compyle.opencl import get_context return get_context() else: raise RuntimeError('Unsupported GPU backend %s' % backend)
def setUpClass(cls): print("SetupClass") pytest.importorskip("pycuda") from compyle.cuda import set_context set_context()