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

Function qr_inplace

src/backend/cuda/qr.cpp:182–202  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

180
181template<typename T>
182Array<T> qr_inplace(Array<T> &in) {
183 dim4 iDims = in.dims();
184 int M = iDims[0];
185 int N = iDims[1];
186
187 Array<T> t = createEmptyArray<T>(af::dim4(min(M, N), 1, 1, 1));
188
189 int lwork = 0;
190
191 CUSOLVER_CHECK(geqrf_buf_func<T>()(solverDnHandle(), M, N, in.get(),
192 in.strides()[1], &lwork));
193
194 auto workspace = memAlloc<T>(lwork);
195 auto info = memAlloc<int>(1);
196
197 CUSOLVER_CHECK(geqrf_func<T>()(solverDnHandle(), M, N, in.get(),
198 in.strides()[1], t.get(), workspace.get(),
199 lwork, info.get()));
200
201 return t;
202}
203
204#define INSTANTIATE_QR(T) \
205 template Array<T> qr_inplace<T>(Array<T> & in); \

Callers

nothing calls this directly

Calls 6

solverDnHandleFunction · 0.85
minFunction · 0.70
dim4Class · 0.50
dimsMethod · 0.45
getMethod · 0.45
stridesMethod · 0.45

Tested by

no test coverage detected