| 80 | |
| 81 | template<typename T> |
| 82 | Array<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); \ |
nothing calls this directly
no test coverage detected