| 93 | |
| 94 | template<typename T> |
| 95 | int cholesky_inplace(Array<T> &in, const bool is_upper) { |
| 96 | dim4 iDims = in.dims(); |
| 97 | int N = iDims[0]; |
| 98 | |
| 99 | int lwork = 0; |
| 100 | |
| 101 | cublasFillMode_t uplo = CUBLAS_FILL_MODE_LOWER; |
| 102 | if (is_upper) { uplo = CUBLAS_FILL_MODE_UPPER; } |
| 103 | |
| 104 | CUSOLVER_CHECK(potrf_buf_func<T>()(solverDnHandle(), uplo, N, in.get(), |
| 105 | in.strides()[1], &lwork)); |
| 106 | |
| 107 | auto workspace = memAlloc<T>(lwork); |
| 108 | auto d_info = memAlloc<int>(1); |
| 109 | |
| 110 | CUSOLVER_CHECK(potrf_func<T>()(solverDnHandle(), uplo, N, in.get(), |
| 111 | in.strides()[1], workspace.get(), lwork, |
| 112 | d_info.get())); |
| 113 | |
| 114 | // FIXME: should return h_info |
| 115 | return 0; |
| 116 | } |
| 117 | |
| 118 | #define INSTANTIATE_CH(T) \ |
| 119 | template int cholesky_inplace<T>(Array<T> & in, const bool is_upper); \ |
no test coverage detected