| 486 | |
| 487 | template <typename Scalar, typename BufSizeFnT, typename SolverFnT> |
| 488 | static inline Status GeqrfImpl(BufSizeFnT bufsize, SolverFnT solver, |
| 489 | CudaSolver* cuda_solver, |
| 490 | OpKernelContext* context, |
| 491 | cusolverDnHandle_t cusolver_dn_handle, int m, |
| 492 | int n, Scalar* A, int lda, Scalar* tau, |
| 493 | int* dev_lapack_info) { |
| 494 | mutex_lock lock(handle_map_mutex); |
| 495 | /* Get amount of workspace memory required. */ |
| 496 | int lwork; |
| 497 | TF_RETURN_IF_CUSOLVER_ERROR( |
| 498 | bufsize(cusolver_dn_handle, m, n, CUDAComplex(A), lda, &lwork)); |
| 499 | /* Allocate device memory for workspace. */ |
| 500 | auto dev_workspace = |
| 501 | cuda_solver->GetScratchSpace<Scalar>(lwork, "", /* on_host */ false); |
| 502 | /* Launch the solver kernel. */ |
| 503 | TF_RETURN_IF_CUSOLVER_ERROR(solver( |
| 504 | cusolver_dn_handle, m, n, CUDAComplex(A), lda, CUDAComplex(tau), |
| 505 | CUDAComplex(dev_workspace.mutable_data()), lwork, dev_lapack_info)); |
| 506 | return Status::OK(); |
| 507 | } |
| 508 | |
| 509 | #define GEQRF_INSTANCE(Scalar, type_prefix) \ |
| 510 | template <> \ |
nothing calls this directly
no test coverage detected