diff --git a/python/taichi/linalg/sparse_cg.py b/python/taichi/linalg/sparse_cg.py index e0aba8112c690..05ce7e543cb4d 100644 --- a/python/taichi/linalg/sparse_cg.py +++ b/python/taichi/linalg/sparse_cg.py @@ -24,13 +24,14 @@ def __init__(self, A, b, x0=None, max_iter=50, atol=1e-6): self.ti_arch = get_runtime().prog.config().arch self.matrix = A self.b = b + verbose = get_runtime().prog.config().verbose if self.ti_arch == _ti_core.Arch.cuda: - self.cg_solver = _ti_core.make_cucg_solver(A.matrix, max_iter, atol, True) + self.cg_solver = _ti_core.make_cucg_solver(A.matrix, max_iter, atol, verbose) elif self.ti_arch == _ti_core.Arch.x64 or self.ti_arch == _ti_core.Arch.arm64: if self.dtype == f32: - self.cg_solver = _ti_core.make_float_cg_solver(A.matrix, max_iter, atol, True) + self.cg_solver = _ti_core.make_float_cg_solver(A.matrix, max_iter, atol, verbose) elif self.dtype == f64: - self.cg_solver = _ti_core.make_double_cg_solver(A.matrix, max_iter, atol, True) + self.cg_solver = _ti_core.make_double_cg_solver(A.matrix, max_iter, atol, verbose) else: raise TaichiRuntimeError(f"Unsupported CG dtype: {self.dtype}") if isinstance(b, Ndarray):