Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[oneMKL][Sparse BLAS] Add oneapi::mkl::sparse::spsm() API #584

Open
gajanan-choudhary opened this issue Sep 24, 2024 · 0 comments
Open

[oneMKL][Sparse BLAS] Add oneapi::mkl::sparse::spsm() API #584

gajanan-choudhary opened this issue Sep 24, 2024 · 0 comments
Labels

Comments

@gajanan-choudhary
Copy link
Contributor

This is a request tracker to add an API for sparse triangular solve with a dense matrix right-hand-side to the sparse BLAS domain in the oneMKL Specification.

  • The operation performed is, $\text{op}(A)\cdot Y = \alpha\cdot\text{op}(X)$, where:
    • $A$ is a sparse matrix,
    • $X$ and $Y$ are dense matrices,
    • $\alpha$ is a scalar, and
    • $\text{op}(\cdot)$ is one non-transpose/transpose/conjugate-transpose.
  • Going by the recent overhaul in [oneMKL][spblas] Update sparse blas API #522, in all likelihood, the APIs will look like:
    namespace oneapi::mkl::sparse {
    
        struct spsm_descr;
        using spsm_descr_t = spsm_descr*;
    
        void init_spsm_descr (sycl::queue                       &queue,
                              oneapi::mkl::sparse::spsm_descr_t *p_spsm_descr);
    
        sycl::event release_spsm_descr (sycl::queue                       &queue,
                                        oneapi::mkl::sparse::spsm_descr_t spsm_descr,
                                        const std::vector<sycl::event>    &dependencies = {});
    
        enum class spsm_alg {
            default_alg,
            no_optimize_alg,
        };
    
        void spsm_buffer_size(
            sycl::queue                                &queue,
            oneapi::mkl::transpose                     opA,
            oneapi::mkl::transpose                     opX,
            const void*                                alpha,
            oneapi::mkl::sparse::matrix_view           A_view,
            oneapi::mkl::sparse::matrix_handle_t       A_handle,
            oneapi::mkl::sparse::dense_matrix_handle_t X_handle,
            oneapi::mkl::sparse::dense_matrix_handle_t Y_handle,
            oneapi::mkl::sparse::spsm_alg              alg,
            oneapi::mkl::sparse::spsm_descr_t          spsm_descr,
            std::size_t                                &temp_buffer_size);
    
        void spsm_optimize(
            sycl::queue                                &queue,
            oneapi::mkl::transpose                     opA,
            oneapi::mkl::transpose                     opX,
            const void*                                alpha,
            oneapi::mkl::sparse::matrix_view           A_view,
            oneapi::mkl::sparse::matrix_handle_t       A_handle,
            oneapi::mkl::sparse::dense_matrix_handle_t X_handle,
            oneapi::mkl::sparse::dense_matrix_handle_t Y_handle,
            oneapi::mkl::sparse::spsm_alg              alg,
            oneapi::mkl::sparse::spsm_descr_t          spsm_descr,
            sycl::buffer<std::uint8_t, 1>              workspace);
    
        sycl::event spsm_optimize(
            sycl::queue                                &queue,
            oneapi::mkl::transpose                     opA,
            oneapi::mkl::transpose                     opX,
            const void*                                alpha,
            oneapi::mkl::sparse::matrix_view           A_view,
            oneapi::mkl::sparse::matrix_handle_t       A_handle,
            oneapi::mkl::sparse::dense_matrix_handle_t X_handle,
            oneapi::mkl::sparse::dense_matrix_handle_t Y_handle,
            oneapi::mkl::sparse::spsm_alg              alg,
            oneapi::mkl::sparse::spsm_descr_t          spsm_descr,
            void*                                      workspace,
            const std::vector<sycl::event>             &dependencies = {});
    
        sycl::event spsm(
            sycl::queue                                &queue,
            oneapi::mkl::transpose                     opA,
            oneapi::mkl::transpose                     opX,
            const void*                                alpha,
            oneapi::mkl::sparse::matrix_view           A_view,
            oneapi::mkl::sparse::matrix_handle_t       A_handle,
            oneapi::mkl::sparse::dense_matrix_handle_t X_handle,
            oneapi::mkl::sparse::dense_matrix_handle_t Y_handle,
            oneapi::mkl::sparse::spsm_alg              alg,
            oneapi::mkl::sparse::spsm_descr_t          spsm_descr,
            const std::vector<sycl::event>             &dependencies = {});
    
    }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant