def test_set_stream(): host = occa.host() stream = host.stream assert host == occa.get_device() stream2 = host.create_stream() assert stream != stream2 occa.set_stream(stream2) assert stream != occa.get_stream()
def test_set_device(): host = occa.host() assert host == occa.get_device() occa.set_device(mode='Serial') dev = occa.get_device() assert isinstance(dev, occa.Device) assert host != dev occa.set_device(host) dev = occa.get_device() assert isinstance(dev, occa.Device) assert host == dev
def test_host(): host = occa.host() assert isinstance(host, occa.Device) assert host.is_initialized == True assert host.mode == 'Serial'