MCPcopy Create free account
hub / github.com/arrayfire/arrayfire / cholesky_inplace

Function cholesky_inplace

src/backend/cuda/cholesky.cpp:95–116  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

93
94template<typename T>
95int 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); \

Callers 1

choleskyFunction · 0.70

Calls 4

solverDnHandleFunction · 0.85
dimsMethod · 0.45
getMethod · 0.45
stridesMethod · 0.45

Tested by

no test coverage detected