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

Function convertPivot

src/backend/cuda/lu.cpp:78–93  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

76LU_FUNC(getrf, cdouble, Z)
77
78void convertPivot(Array<int> &pivot, int out_sz) {
79 dim_t d0 = pivot.dims()[0];
80
81 std::vector<int> d_po(out_sz);
82 for (int i = 0; i < out_sz; i++) { d_po[i] = i; }
83
84 std::vector<int> d_pi(d0);
85 copyData(&d_pi[0], pivot);
86
87 for (int j = 0; j < d0; j++) {
88 // 1 indexed in pivot
89 std::swap(d_po[j], d_po[d_pi[j] - 1]);
90 }
91
92 pivot = createHostDataArray<int>(out_sz, &d_po[0]);
93}
94
95template<typename T>
96void lu(Array<T> &lower, Array<T> &upper, Array<int> &pivot,

Callers 1

lu_inplaceFunction · 0.70

Calls 3

swapFunction · 0.85
copyDataFunction · 0.70
dimsMethod · 0.45

Tested by

no test coverage detected