+
Skip to content

Usage question: cusolverDnDgeqrf #461

@matteosantama

Description

@matteosantama

Hi @coreylowman

Amazing library you've put together! I was hoping you could help me understand how to use the cusolverDnDgeqrf function.

I currently have a struct

pub(crate) struct CudaMatrix {
    nrows: usize,
    ncols: usize,
    data: CudaSlice<f64>,
}

and I'm trying to write a function

    fn geqrf(&self, mut matrix: CudaMatrix) -> CudaMatrix {
        let stream = self.ctx.default_stream();

        let dn_handle = DnHandle::new(stream).unwrap();
        let m = matrix.nrows as c_int;
        let n = matrix.ncols as c_int;
        let lda = matrix.nrows as c_int;

        unsafe {
            // cusolverDnSgeqrf_bufferSize()
            cusolverDnDgeqrf(dn_handle.cu(), m, n, matrix.data, lda, );
        }
        todo!()
    }

It doesn't seem that passing matrix.data to cusolverDnDgeqrf is right, though. What should I be doing here?

As a follow-up, would it take a lot to write a safe wrapper for this function? If it's not an incredibly complicated undertaking, I would be happy to contribute a PR in that direction.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载