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

[SPARSE] Turn matrix_view into an aggregate #608

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions include/oneapi/mkl/sparse_blas/matrix_view.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,6 @@ struct matrix_view {
matrix_descr type_view = matrix_descr::general;
uplo uplo_view = uplo::lower;
diag diag_view = diag::nonunit;

matrix_view() = default;

matrix_view(matrix_descr type_view) : type_view(type_view) {}
};

} // namespace sparse
Expand Down
14 changes: 8 additions & 6 deletions tests/unit_tests/sparse_blas/include/test_spmv.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -128,8 +128,9 @@ void test_helper_with_format_with_transpose(
default_properties, no_reset_data, no_scalars_on_device),
num_passed, num_skipped);
// Lower triangular
oneapi::mkl::sparse::matrix_view triangular_A_view(
oneapi::mkl::sparse::matrix_descr::triangular);
oneapi::mkl::sparse::matrix_view triangular_A_view{
oneapi::mkl::sparse::matrix_descr::triangular
};
EXPECT_TRUE_OR_FUTURE_SKIP(
test_functor_i32(dev, queue_properties, format, nrows_A, ncols_A, density_A_matrix,
index_zero, transpose_val, fp_one, fp_zero, default_alg, triangular_A_view,
Expand All @@ -143,8 +144,9 @@ void test_helper_with_format_with_transpose(
default_properties, no_reset_data, no_scalars_on_device),
num_passed, num_skipped);
// Lower triangular unit diagonal
oneapi::mkl::sparse::matrix_view triangular_unit_A_view(
oneapi::mkl::sparse::matrix_descr::triangular);
oneapi::mkl::sparse::matrix_view triangular_unit_A_view{
oneapi::mkl::sparse::matrix_descr::triangular
};
triangular_unit_A_view.diag_view = oneapi::mkl::diag::unit;
EXPECT_TRUE_OR_FUTURE_SKIP(
test_functor_i32(dev, queue_properties, format, nrows_A, ncols_A, density_A_matrix,
Expand All @@ -161,7 +163,7 @@ void test_helper_with_format_with_transpose(
no_scalars_on_device),
num_passed, num_skipped);
// Lower symmetric
oneapi::mkl::sparse::matrix_view symmetric_view(oneapi::mkl::sparse::matrix_descr::symmetric);
oneapi::mkl::sparse::matrix_view symmetric_view{ oneapi::mkl::sparse::matrix_descr::symmetric };
EXPECT_TRUE_OR_FUTURE_SKIP(
test_functor_i32(dev, queue_properties, format, nrows_A, ncols_A, density_A_matrix,
index_zero, transpose_val, fp_one, fp_zero, default_alg, symmetric_view,
Expand All @@ -175,7 +177,7 @@ void test_helper_with_format_with_transpose(
default_properties, no_reset_data, no_scalars_on_device),
num_passed, num_skipped);
// Lower hermitian
oneapi::mkl::sparse::matrix_view hermitian_view(oneapi::mkl::sparse::matrix_descr::hermitian);
oneapi::mkl::sparse::matrix_view hermitian_view{ oneapi::mkl::sparse::matrix_descr::hermitian };
EXPECT_TRUE_OR_FUTURE_SKIP(
test_functor_i32(dev, queue_properties, format, nrows_A, ncols_A, density_A_matrix,
index_zero, transpose_val, fp_one, fp_zero, default_alg, hermitian_view,
Expand Down
29 changes: 18 additions & 11 deletions tests/unit_tests/sparse_blas/include/test_spsv.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,9 +58,12 @@ void test_helper_with_format(testFunctorI32 test_functor_i32, testFunctorI64 tes
oneapi::mkl::index_base index_zero = oneapi::mkl::index_base::zero;
oneapi::mkl::sparse::spsv_alg default_alg = oneapi::mkl::sparse::spsv_alg::default_alg;
oneapi::mkl::sparse::spsv_alg no_optimize_alg = oneapi::mkl::sparse::spsv_alg::no_optimize_alg;
oneapi::mkl::sparse::matrix_view default_A_view(oneapi::mkl::sparse::matrix_descr::triangular);
oneapi::mkl::sparse::matrix_view upper_A_view(oneapi::mkl::sparse::matrix_descr::triangular);
upper_A_view.uplo_view = oneapi::mkl::uplo::upper;
oneapi::mkl::sparse::matrix_view default_A_view{
oneapi::mkl::sparse::matrix_descr::triangular
};
oneapi::mkl::sparse::matrix_view upper_A_view{ oneapi::mkl::sparse::matrix_descr::triangular,
oneapi::mkl::uplo::upper,
oneapi::mkl::diag::nonunit };
bool no_reset_data = false;
bool no_scalars_on_device = false;

Expand Down Expand Up @@ -99,20 +102,24 @@ void test_helper_with_format(testFunctorI32 test_functor_i32, testFunctorI64 tes
no_reset_data, no_scalars_on_device),
num_passed, num_skipped);
// Test lower triangular unit diagonal matrix
oneapi::mkl::sparse::matrix_view triangular_unit_A_view(
oneapi::mkl::sparse::matrix_descr::triangular);
triangular_unit_A_view.diag_view = oneapi::mkl::diag::unit;
oneapi::mkl::sparse::matrix_view lower_unit_A_view{
oneapi::mkl::sparse::matrix_descr::triangular, oneapi::mkl::uplo::lower,
oneapi::mkl::diag::unit
};
EXPECT_TRUE_OR_FUTURE_SKIP(
test_functor_i32(dev, queue_properties, format, m, density_A_matrix, index_zero,
transpose_val, alpha, default_alg, triangular_unit_A_view,
default_properties, no_reset_data, no_scalars_on_device),
transpose_val, alpha, default_alg, lower_unit_A_view, default_properties,
no_reset_data, no_scalars_on_device),
num_passed, num_skipped);
// Test upper triangular unit diagonal matrix
triangular_unit_A_view.uplo_view = oneapi::mkl::uplo::upper;
oneapi::mkl::sparse::matrix_view upper_unit_A_view{
oneapi::mkl::sparse::matrix_descr::triangular, oneapi::mkl::uplo::upper,
oneapi::mkl::diag::unit
};
EXPECT_TRUE_OR_FUTURE_SKIP(
test_functor_i32(dev, queue_properties, format, m, density_A_matrix, index_zero,
transpose_val, alpha, default_alg, triangular_unit_A_view,
default_properties, no_reset_data, no_scalars_on_device),
transpose_val, alpha, default_alg, upper_unit_A_view, default_properties,
no_reset_data, no_scalars_on_device),
num_passed, num_skipped);
// Test non-default alpha
EXPECT_TRUE_OR_FUTURE_SKIP(
Expand Down
Loading