 
         Array out_contiguous = AsContiguous(out);
 
-        auto cholesky_impl = [&](auto pt, auto bufsize_func, auto solver_func) {
+        auto cholesky_impl = [&](auto pt) {
             CHAINERX_ASSERT(a.dtype() == out_contiguous.dtype());
 
             using T = typename decltype(pt)::type;

                throw DtypeError{"Half-precision (float16) is not supported by Cholesky decomposition"};
                break;
            case Dtype::kFloat32:
                cholesky_impl(PrimitiveType<float>{}, cusolverDnSpotrf_bufferSize, cusolverDnSpotrf);
                break;
            case Dtype::kFloat64:
                cholesky_impl(PrimitiveType<double>{}, cusolverDnDpotrf_bufferSize, cusolverDnDpotrf);
                break;
            default:
                CHAINERX_NEVER_REACH();

            T* out_ptr = static_cast<T*>(internal::GetRawOffsetData(out_contiguous));
            int work_size = 0;
            const int N = a.shape()[0];
            device_internals.cusolverdn_handle().Call(PotrfBuffersize<T>, uplo, N, out_ptr, N, &work_size);

            // POTRF execution
            Array work = Empty(Shape({work_size}), dtype, device);
