MCPcopy Create free account
hub / github.com/DeepRec-AI/DeepRec / GesvdImpl

Function GesvdImpl

tensorflow/core/kernels/cuda_solvers.cc:649–667  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

647
648template <typename Scalar, typename BufSizeFnT, typename SolverFnT>
649static inline Status GesvdImpl(
650 BufSizeFnT bufsize, SolverFnT solver, CudaSolver* cuda_solver,
651 OpKernelContext* context, cusolverDnHandle_t cusolver_dn_handle,
652 signed char jobu, signed char jobvt, int m, int n, Scalar* A, int lda,
653 Scalar* S, Scalar* U, int ldu, Scalar* VT, int ldvt, int* dev_lapack_info) {
654 mutex_lock lock(handle_map_mutex);
655 /* Get amount of workspace memory required. */
656 int lwork;
657 TF_RETURN_IF_CUSOLVER_ERROR(bufsize(cusolver_dn_handle, m, n, &lwork));
658 /* Allocate device memory for workspace. */
659 auto dev_workspace =
660 cuda_solver->GetScratchSpace<Scalar>(lwork, "", /* on_host */ false);
661 TF_RETURN_IF_CUSOLVER_ERROR(solver(cusolver_dn_handle, jobu, jobvt, m, n,
662 CUDAComplex(A), lda, S, CUDAComplex(U),
663 ldu, CUDAComplex(VT), ldvt,
664 CUDAComplex(dev_workspace.mutable_data()),
665 lwork, nullptr, dev_lapack_info));
666 return Status::OK();
667}
668
669#define GESVD_INSTANCE(Scalar, type_prefix) \
670 template <> \

Callers

nothing calls this directly

Calls 2

CUDAComplexFunction · 0.85
mutable_dataMethod · 0.80

Tested by

no test coverage detected