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

Function lu

src/backend/opencl/lu.cpp:40–58  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

38
39template<typename T>
40void lu(Array<T> &lower, Array<T> &upper, Array<int> &pivot,
41 const Array<T> &in) {
42 if (OpenCLCPUOffload()) { return cpu::lu(lower, upper, pivot, in); }
43
44 dim4 iDims = in.dims();
45 int M = iDims[0];
46 int N = iDims[1];
47 int MN = std::min(M, N);
48
49 Array<T> in_copy = copyArray<T>(in);
50 pivot = lu_inplace(in_copy);
51
52 // SPLIT into lower and upper
53 dim4 ldims(M, MN);
54 dim4 udims(MN, N);
55 lower = createEmptyArray<T>(ldims);
56 upper = createEmptyArray<T>(udims);
57 kernel::luSplit<T>(lower, upper, in_copy);
58}
59
60template<typename T>
61Array<int> lu_inplace(Array<T> &in, const bool convert_pivot) {

Callers

nothing calls this directly

Calls 4

OpenCLCPUOffloadFunction · 0.85
minFunction · 0.70
lu_inplaceFunction · 0.70
dimsMethod · 0.45

Tested by

no test coverage detected