 #include "chainerx/kernels/linalg.h"
 #include "chainerx/kernels/misc.h"
 #include "chainerx/macro.h"
+#include "chainerx/native/native_device.h"
 #include "chainerx/routines/creation.h"
 #include "chainerx/routines/linalg.h"
 


            work = Empty(Shape({buffersize_orgqr}), dtype, device);

            device_internals.cusolverdn_handle().Call(orgqr, m, mc, mn, q_ptr, m, tau_ptr, work_ptr, buffersize_orgqr, devInfo);

            CheckCudaError(cudaMemcpy(&devInfo_h, devInfo, sizeof(int), cudaMemcpyDeviceToHost));
            if (devInfo_h != 0) {
                throw ChainerxError{"Unsuccessfull orgqr (QR) execution. Info = ", devInfo_h};
            }

            T* r_ptr = static_cast<T*>(internal::GetRawOffsetData(R));
            T* tau_ptr = static_cast<T*>(internal::GetRawOffsetData(tau));

            std::shared_ptr<void> devInfo = device.Allocate(sizeof(int));

            int buffersize_geqrf = 0;
            device_internals.cusolverdn_handle().Call(geqrf_bufferSize, m, n, r_ptr, n, &buffersize_geqrf);
