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

Function lu_inplace

src/backend/cpu/lu.cpp:68–87  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

66
67template<typename T>
68Array<int> lu_inplace(Array<T> &in, const bool convert_pivot) {
69 dim4 iDims = in.dims();
70 Array<int> pivot =
71 createEmptyArray<int>(af::dim4(min(iDims[0], iDims[1]), 1, 1, 1));
72
73 auto func = [=](Param<T> in, Param<int> pivot) {
74 dim4 iDims = in.dims();
75 getrf_func<T>()(AF_LAPACK_COL_MAJOR, iDims[0], iDims[1], in.get(),
76 in.strides(1), pivot.get());
77 };
78 getQueue().enqueue(func, in, pivot);
79
80 if (convert_pivot) {
81 Array<int> p = range<int>(dim4(iDims[0]), 0);
82 getQueue().enqueue(kernel::convertPivot, p, pivot);
83 return p;
84 } else {
85 return pivot;
86 }
87}
88
89bool isLAPACKAvailable() { return true; }
90

Callers 1

luFunction · 0.70

Calls 7

dim4Class · 0.70
minFunction · 0.70
getQueueFunction · 0.50
dimsMethod · 0.45
getMethod · 0.45
stridesMethod · 0.45
enqueueMethod · 0.45

Tested by

no test coverage detected