             std::shared_ptr<void> devInfo = device.Allocate(sizeof(int));
 
             int buffersize = 0;
-            device_internals.cusolverdn_handle().Call(gesvd_bufferSize, m, n, &buffersize);
+            device_internals.cusolverdn_handle().Call(GesvdBuffersize<T>, m, n, &buffersize);
 
             Array work = Empty(Shape({buffersize}), dtype, device);
             T* work_ptr = static_cast<T*>(internal::GetRawOffsetData(work));


        Array s = Empty(Shape({mn}), dtype, device);

        auto svd_impl = [&](auto pt, auto gesvd_bufferSize, auto gesvd) -> std::tuple<Array, Array, Array> {
            using T = typename decltype(pt)::type;
            cuda_internal::DeviceInternals& device_internals = cuda_internal::GetDeviceInternals(static_cast<CudaDevice&>(device));


            }

            device_internals.cusolverdn_handle().Call(
                    Gesvd<T>,
                    job,
                    job,
                    m,
