| 426 | |
| 427 | template <typename Scalar, typename BufSizeFnT, typename SolverFnT> |
| 428 | static inline Status GetrfImpl(BufSizeFnT bufsize, SolverFnT solver, |
| 429 | CudaSolver* cuda_solver, |
| 430 | OpKernelContext* context, |
| 431 | cusolverDnHandle_t cusolver_dn_handle, int m, |
| 432 | int n, Scalar* A, int lda, int* dev_pivots, |
| 433 | int* dev_lapack_info) { |
| 434 | mutex_lock lock(handle_map_mutex); |
| 435 | /* Get amount of workspace memory required. */ |
| 436 | int lwork; |
| 437 | TF_RETURN_IF_CUSOLVER_ERROR( |
| 438 | bufsize(cusolver_dn_handle, m, n, CUDAComplex(A), lda, &lwork)); |
| 439 | /* Allocate device memory for workspace. */ |
| 440 | auto dev_workspace = |
| 441 | cuda_solver->GetScratchSpace<Scalar>(lwork, "", /* on_host */ false); |
| 442 | /* Launch the solver kernel. */ |
| 443 | TF_RETURN_IF_CUSOLVER_ERROR(solver( |
| 444 | cusolver_dn_handle, m, n, CUDAComplex(A), lda, |
| 445 | CUDAComplex(dev_workspace.mutable_data()), dev_pivots, dev_lapack_info)); |
| 446 | return Status::OK(); |
| 447 | } |
| 448 | |
| 449 | #define GETRF_INSTANCE(Scalar, type_prefix) \ |
| 450 | template <> \ |
nothing calls this directly
no test coverage detected