Skip to content

[oneMKL][Sparse BLAS] Missing constructor for oneapi::mkl::sparse::matrix_view #578

Open
uxlfoundation/oneMath
#608
@gajanan-choudhary

Description

@gajanan-choudhary

It appears that we are missing a constructor:

    matrix_view(matrix_descr type_view, uplo uplo_view, diag diag_view);

in the oneapi::mkl::sparse::matrix_view data structure.
While it is possible for users to individually have:

    matrix_view view;
    view.type_view = ...;
    view.uplo_view = ...;
    view.diag_view = ...;

in their code, it would be helpful to allow:

    using namespace oneapi::mkl;
    sparse::matrix_view view{sparse::matrix_descr::triangular, uplo::upper, diag::unit};

Without a triplet constructor, we have errors like so:

foo.cpp:28:87: error: no matching function for call to ‘oneapi::mkl::sparse::matrix_view::matrix_view(<brace-enclosed initializer list>)’
   28 |     sparse::matrix_view view{sparse::matrix_descr::triangular, uplo::upper, diag::unit};
      |                                                                                       ^
foo.cpp:19:9: note: candidate: ‘oneapi::mkl::sparse::matrix_view::matrix_view(oneapi::mkl::sparse::matrix_descr)’
   19 |         matrix_view(matrix_descr type_view);
      |         ^~~~~~~~~~~
foo.cpp:19:9: note:   candidate expects 1 argument, 3 provided
foo.cpp:17:9: note: candidate: ‘constexpr oneapi::mkl::sparse::matrix_view::matrix_view()’
   17 |         matrix_view() = default;
      |         ^~~~~~~~~~~
foo.cpp:17:9: note:   candidate expects 0 arguments, 3 provided
foo.cpp:12:12: note: candidate: ‘constexpr oneapi::mkl::sparse::matrix_view::matrix_view(const oneapi::mkl::sparse::matrix_view&)’
   12 |     struct matrix_view {
      |            ^~~~~~~~~~~
foo.cpp:12:12: note:   candidate expects 1 argument, 3 provided
foo.cpp:12:12: note: candidate: ‘constexpr oneapi::mkl::sparse::matrix_view::matrix_view(oneapi::mkl::sparse::matrix_view&&)’
foo.cpp:12:12: note:   candidate expects 1 argument, 3 provided

@Rbiessy, @spencerpatty, @baeseung-intel

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions