| 356 | |
| 357 | template <typename Scalar, typename BufSizeFnT, typename SolverFnT> |
| 358 | static inline Status PotrfImpl(BufSizeFnT bufsize, SolverFnT solver, |
| 359 | CudaSolver* cuda_solver, |
| 360 | OpKernelContext* context, |
| 361 | cusolverDnHandle_t cusolver_dn_handle, |
| 362 | cublasFillMode_t uplo, int n, Scalar* A, int lda, |
| 363 | int* dev_lapack_info) { |
| 364 | mutex_lock lock(handle_map_mutex); |
| 365 | /* Get amount of workspace memory required. */ |
| 366 | int lwork; |
| 367 | TF_RETURN_IF_CUSOLVER_ERROR( |
| 368 | bufsize(cusolver_dn_handle, uplo, n, CUDAComplex(A), lda, &lwork)); |
| 369 | /* Allocate device memory for workspace. */ |
| 370 | auto dev_workspace = |
| 371 | cuda_solver->GetScratchSpace<Scalar>(lwork, "", /* on_host */ false); |
| 372 | /* Launch the solver kernel. */ |
| 373 | TF_RETURN_IF_CUSOLVER_ERROR(solver( |
| 374 | cusolver_dn_handle, uplo, n, CUDAComplex(A), lda, |
| 375 | CUDAComplex(dev_workspace.mutable_data()), lwork, dev_lapack_info)); |
| 376 | return Status::OK(); |
| 377 | } |
| 378 | |
| 379 | #define POTRF_INSTANCE(Scalar, type_prefix) \ |
| 380 | template <> \ |
nothing calls this directly
no test coverage detected