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

Function qr_inplace

src/backend/opencl/qr.cpp:82–103  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

80
81template<typename T>
82Array<T> qr_inplace(Array<T> &in) {
83 if (OpenCLCPUOffload()) { return cpu::qr_inplace(in); }
84
85 dim4 iDims = in.dims();
86 int M = iDims[0];
87 int N = iDims[1];
88 int MN = std::min(M, N);
89
90 getQueue().finish(); // FIXME: Does this need to be here?
91 cl::CommandQueue Queue2(getContext(), getDevice());
92 cl_command_queue queues[] = {getQueue()(), Queue2()};
93
94 std::vector<T> h_tau(MN);
95 cl::Buffer *in_buf = in.get();
96
97 int info = 0;
98 magma_geqrf2_gpu<T>(M, N, (*in_buf)(), in.getOffset(), in.strides()[1],
99 &h_tau[0], queues, &info);
100
101 Array<T> t = createHostDataArray(dim4(MN), &h_tau[0]);
102 return t;
103}
104
105#define INSTANTIATE_QR(T) \
106 template Array<T> qr_inplace<T>(Array<T> & in); \

Callers

nothing calls this directly

Calls 11

OpenCLCPUOffloadFunction · 0.85
getDeviceFunction · 0.85
minFunction · 0.70
createHostDataArrayFunction · 0.70
getQueueFunction · 0.50
getContextFunction · 0.50
dim4Class · 0.50
dimsMethod · 0.45
getMethod · 0.45
getOffsetMethod · 0.45
stridesMethod · 0.45

Tested by

no test coverage detected