diff --git a/tests/unit_tests/sparse_blas/include/test_spmm.hpp b/tests/unit_tests/sparse_blas/include/test_spmm.hpp index d47b1732c..983c0e63c 100644 --- a/tests/unit_tests/sparse_blas/include/test_spmm.hpp +++ b/tests/unit_tests/sparse_blas/include/test_spmm.hpp @@ -58,6 +58,7 @@ void test_helper_with_format_with_transpose( const std::vector &non_default_algorithms, oneapi::mkl::transpose transpose_A, oneapi::mkl::transpose transpose_B, int &num_passed, int &num_skipped) { + sycl::property_list queue_properties; double density_A_matrix = 0.8; fpType fp_zero = set_fp_value()(0.f, 0.f); fpType fp_one = set_fp_value()(1.f, 0.f); @@ -85,108 +86,119 @@ void test_helper_with_format_with_transpose( // Basic test EXPECT_TRUE_OR_FUTURE_SKIP( - test_functor_i32(dev, format, nrows_A, ncols_A, ncols_C, density_A_matrix, index_zero, - col_major, transpose_A, transpose_B, fp_one, fp_zero, ldb, ldc, - default_alg, default_A_view, default_properties, no_reset_data, - no_scalars_on_device), + test_functor_i32(dev, queue_properties, format, nrows_A, ncols_A, ncols_C, + density_A_matrix, index_zero, col_major, transpose_A, transpose_B, + fp_one, fp_zero, ldb, ldc, default_alg, default_A_view, + default_properties, no_reset_data, no_scalars_on_device), num_passed, num_skipped); // Reset data EXPECT_TRUE_OR_FUTURE_SKIP( - test_functor_i32(dev, format, nrows_A, ncols_A, ncols_C, density_A_matrix, index_zero, - col_major, transpose_A, transpose_B, fp_one, fp_zero, ldb, ldc, - default_alg, default_A_view, default_properties, true, - no_scalars_on_device), + test_functor_i32(dev, queue_properties, format, nrows_A, ncols_A, ncols_C, + density_A_matrix, index_zero, col_major, transpose_A, transpose_B, + fp_one, fp_zero, ldb, ldc, default_alg, default_A_view, + default_properties, true, no_scalars_on_device), num_passed, num_skipped); // Test alpha and beta on the device EXPECT_TRUE_OR_FUTURE_SKIP( - test_functor_i32(dev, format, nrows_A, ncols_A, ncols_C, density_A_matrix, index_zero, - col_major, transpose_A, transpose_B, fp_one, fp_zero, ldb, ldc, - default_alg, default_A_view, default_properties, no_reset_data, true), + test_functor_i32(dev, queue_properties, format, nrows_A, ncols_A, ncols_C, + density_A_matrix, index_zero, col_major, transpose_A, transpose_B, + fp_one, fp_zero, ldb, ldc, default_alg, default_A_view, + default_properties, no_reset_data, true), num_passed, num_skipped); // Test index_base 1 EXPECT_TRUE_OR_FUTURE_SKIP( - test_functor_i32(dev, format, nrows_A, ncols_A, ncols_C, density_A_matrix, - oneapi::mkl::index_base::one, col_major, transpose_A, transpose_B, - fp_one, fp_zero, ldb, ldc, default_alg, default_A_view, + test_functor_i32(dev, queue_properties, format, nrows_A, ncols_A, ncols_C, + density_A_matrix, oneapi::mkl::index_base::one, col_major, transpose_A, + transpose_B, fp_one, fp_zero, ldb, ldc, default_alg, default_A_view, default_properties, no_reset_data, no_scalars_on_device), num_passed, num_skipped); // Test non-default alpha EXPECT_TRUE_OR_FUTURE_SKIP( - test_functor_i32(dev, format, nrows_A, ncols_A, ncols_C, density_A_matrix, index_zero, - col_major, transpose_A, transpose_B, set_fp_value()(2.f, 1.5f), - fp_zero, ldb, ldc, default_alg, default_A_view, default_properties, - no_reset_data, no_scalars_on_device), + test_functor_i32(dev, queue_properties, format, nrows_A, ncols_A, ncols_C, + density_A_matrix, index_zero, col_major, transpose_A, transpose_B, + set_fp_value()(2.f, 1.5f), fp_zero, ldb, ldc, default_alg, + default_A_view, default_properties, no_reset_data, + no_scalars_on_device), num_passed, num_skipped); // Test non-default beta EXPECT_TRUE_OR_FUTURE_SKIP( - test_functor_i32(dev, format, nrows_A, ncols_A, ncols_C, density_A_matrix, index_zero, - col_major, transpose_A, transpose_B, fp_one, - set_fp_value()(3.2f, 1.f), ldb, ldc, default_alg, + test_functor_i32(dev, queue_properties, format, nrows_A, ncols_A, ncols_C, + density_A_matrix, index_zero, col_major, transpose_A, transpose_B, + fp_one, set_fp_value()(3.2f, 1.f), ldb, ldc, default_alg, default_A_view, default_properties, no_reset_data, no_scalars_on_device), num_passed, num_skipped); // Test 0 alpha EXPECT_TRUE_OR_FUTURE_SKIP( - test_functor_i32(dev, format, nrows_A, ncols_A, ncols_C, density_A_matrix, index_zero, - col_major, transpose_A, transpose_B, fp_zero, fp_one, ldb, ldc, - default_alg, default_A_view, default_properties, no_reset_data, - no_scalars_on_device), + test_functor_i32(dev, queue_properties, format, nrows_A, ncols_A, ncols_C, + density_A_matrix, index_zero, col_major, transpose_A, transpose_B, + fp_zero, fp_one, ldb, ldc, default_alg, default_A_view, + default_properties, no_reset_data, no_scalars_on_device), num_passed, num_skipped); // Test 0 alpha and beta EXPECT_TRUE_OR_FUTURE_SKIP( - test_functor_i32(dev, format, nrows_A, ncols_A, ncols_C, density_A_matrix, index_zero, - col_major, transpose_A, transpose_B, fp_zero, fp_zero, ldb, ldc, - default_alg, default_A_view, default_properties, no_reset_data, - no_scalars_on_device), + test_functor_i32(dev, queue_properties, format, nrows_A, ncols_A, ncols_C, + density_A_matrix, index_zero, col_major, transpose_A, transpose_B, + fp_zero, fp_zero, ldb, ldc, default_alg, default_A_view, + default_properties, no_reset_data, no_scalars_on_device), num_passed, num_skipped); // Test non-default ldb EXPECT_TRUE_OR_FUTURE_SKIP( - test_functor_i32(dev, format, nrows_A, ncols_A, ncols_C, density_A_matrix, index_zero, - col_major, transpose_A, transpose_B, fp_one, fp_zero, ldb + 5, ldc, - default_alg, default_A_view, default_properties, no_reset_data, - no_scalars_on_device), + test_functor_i32(dev, queue_properties, format, nrows_A, ncols_A, ncols_C, + density_A_matrix, index_zero, col_major, transpose_A, transpose_B, + fp_one, fp_zero, ldb + 5, ldc, default_alg, default_A_view, + default_properties, no_reset_data, no_scalars_on_device), num_passed, num_skipped); // Test non-default ldc EXPECT_TRUE_OR_FUTURE_SKIP( - test_functor_i32(dev, format, nrows_A, ncols_A, ncols_C, density_A_matrix, index_zero, - col_major, transpose_A, transpose_B, fp_one, fp_zero, ldb, ldc + 6, - default_alg, default_A_view, default_properties, no_reset_data, - no_scalars_on_device), + test_functor_i32(dev, queue_properties, format, nrows_A, ncols_A, ncols_C, + density_A_matrix, index_zero, col_major, transpose_A, transpose_B, + fp_one, fp_zero, ldb, ldc + 6, default_alg, default_A_view, + default_properties, no_reset_data, no_scalars_on_device), num_passed, num_skipped); // Test row major layout EXPECT_TRUE_OR_FUTURE_SKIP( - test_functor_i32(dev, format, nrows_A, ncols_A, ncols_C, density_A_matrix, index_zero, - oneapi::mkl::layout::row_major, transpose_A, transpose_B, fp_one, - fp_zero, ncols_B, ncols_C, default_alg, default_A_view, - default_properties, no_reset_data, no_scalars_on_device), + test_functor_i32(dev, queue_properties, format, nrows_A, ncols_A, ncols_C, + density_A_matrix, index_zero, oneapi::mkl::layout::row_major, + transpose_A, transpose_B, fp_one, fp_zero, ncols_B, ncols_C, + default_alg, default_A_view, default_properties, no_reset_data, + no_scalars_on_device), num_passed, num_skipped); // Test int64 indices long long_nrows_A = 27, long_ncols_A = 13, long_ncols_C = 6; auto [long_ldc, long_ldb] = swap_if_transposed(transpose_A, long_nrows_A, long_ncols_A); EXPECT_TRUE_OR_FUTURE_SKIP( - test_functor_i64(dev, format, long_nrows_A, long_ncols_A, long_ncols_C, - density_A_matrix, index_zero, col_major, transpose_A, transpose_B, - fp_one, fp_zero, long_ldb, long_ldc, default_alg, default_A_view, - default_properties, no_reset_data, no_scalars_on_device), + test_functor_i64(dev, queue_properties, format, long_nrows_A, long_ncols_A, + long_ncols_C, density_A_matrix, index_zero, col_major, transpose_A, + transpose_B, fp_one, fp_zero, long_ldb, long_ldc, default_alg, + default_A_view, default_properties, no_reset_data, + no_scalars_on_device), num_passed, num_skipped); // Test other algorithms for (auto alg : non_default_algorithms) { EXPECT_TRUE_OR_FUTURE_SKIP( - test_functor_i32(dev, format, nrows_A, ncols_A, ncols_C, density_A_matrix, - index_zero, col_major, transpose_A, transpose_B, fp_one, fp_zero, - ldb, ldc, alg, default_A_view, default_properties, no_reset_data, - no_scalars_on_device), + test_functor_i32(dev, queue_properties, format, nrows_A, ncols_A, ncols_C, + density_A_matrix, index_zero, col_major, transpose_A, transpose_B, + fp_one, fp_zero, ldb, ldc, alg, default_A_view, default_properties, + no_reset_data, no_scalars_on_device), num_passed, num_skipped); } // Test matrix properties for (auto properties : get_all_matrix_properties_combinations(properties_queue, format)) { EXPECT_TRUE_OR_FUTURE_SKIP( - test_functor_i32(dev, format, nrows_A, ncols_A, ncols_C, density_A_matrix, - index_zero, col_major, transpose_A, transpose_B, fp_one, fp_zero, - ldb, ldc, default_alg, default_A_view, properties, no_reset_data, - no_scalars_on_device), + test_functor_i32(dev, queue_properties, format, nrows_A, ncols_A, ncols_C, + density_A_matrix, index_zero, col_major, transpose_A, transpose_B, + fp_one, fp_zero, ldb, ldc, default_alg, default_A_view, properties, + no_reset_data, no_scalars_on_device), num_passed, num_skipped); } + // In-order queue + EXPECT_TRUE_OR_FUTURE_SKIP( + test_functor_i32(dev, { property::queue::in_order::in_order() }, format, nrows_A, + ncols_A, ncols_C, density_A_matrix, index_zero, col_major, transpose_A, + transpose_B, fp_one, fp_zero, ldb, ldc, default_alg, default_A_view, + default_properties, no_reset_data, no_scalars_on_device), + num_passed, num_skipped); } { // Test different sizes @@ -199,10 +211,10 @@ void test_helper_with_format_with_transpose( int ldb = nrows_B; int ldc = nrows_C; EXPECT_TRUE_OR_FUTURE_SKIP( - test_functor_i32(dev, format, nrows_A, ncols_A, ncols_C, density_A_matrix, index_zero, - col_major, transpose_A, transpose_B, fp_one, fp_zero, ldb, ldc, - default_alg, default_A_view, default_properties, no_reset_data, - no_scalars_on_device), + test_functor_i32(dev, queue_properties, format, nrows_A, ncols_A, ncols_C, + density_A_matrix, index_zero, col_major, transpose_A, transpose_B, + fp_one, fp_zero, ldb, ldc, default_alg, default_A_view, + default_properties, no_reset_data, no_scalars_on_device), num_passed, num_skipped); } } diff --git a/tests/unit_tests/sparse_blas/include/test_spmv.hpp b/tests/unit_tests/sparse_blas/include/test_spmv.hpp index 66af38a7c..e22b5a9e7 100644 --- a/tests/unit_tests/sparse_blas/include/test_spmv.hpp +++ b/tests/unit_tests/sparse_blas/include/test_spmv.hpp @@ -56,6 +56,7 @@ void test_helper_with_format_with_transpose( sparse_matrix_format_t format, const std::vector &non_default_algorithms, oneapi::mkl::transpose transpose_val, int &num_passed, int &num_skipped) { + sycl::property_list queue_properties; double density_A_matrix = 0.8; fpType fp_zero = set_fp_value()(0.f, 0.f); fpType fp_one = set_fp_value()(1.f, 0.f); @@ -72,133 +73,143 @@ void test_helper_with_format_with_transpose( // Basic test EXPECT_TRUE_OR_FUTURE_SKIP( - test_functor_i32(dev, format, nrows_A, ncols_A, density_A_matrix, index_zero, transpose_val, - fp_one, fp_zero, default_alg, default_A_view, default_properties, - no_reset_data, no_scalars_on_device), + test_functor_i32(dev, queue_properties, format, nrows_A, ncols_A, density_A_matrix, + index_zero, transpose_val, fp_one, fp_zero, default_alg, default_A_view, + default_properties, no_reset_data, no_scalars_on_device), num_passed, num_skipped); // Reset data EXPECT_TRUE_OR_FUTURE_SKIP( - test_functor_i32(dev, format, nrows_A, ncols_A, density_A_matrix, index_zero, transpose_val, - fp_one, fp_zero, default_alg, default_A_view, default_properties, true, - no_scalars_on_device), + test_functor_i32(dev, queue_properties, format, nrows_A, ncols_A, density_A_matrix, + index_zero, transpose_val, fp_one, fp_zero, default_alg, default_A_view, + default_properties, true, no_scalars_on_device), num_passed, num_skipped); // Test alpha and beta on the device EXPECT_TRUE_OR_FUTURE_SKIP( - test_functor_i32(dev, format, nrows_A, ncols_A, density_A_matrix, index_zero, transpose_val, - fp_one, fp_zero, default_alg, default_A_view, default_properties, - no_reset_data, true), + test_functor_i32(dev, queue_properties, format, nrows_A, ncols_A, density_A_matrix, + index_zero, transpose_val, fp_one, fp_zero, default_alg, default_A_view, + default_properties, no_reset_data, true), num_passed, num_skipped); // Test index_base 1 EXPECT_TRUE_OR_FUTURE_SKIP( - test_functor_i32(dev, format, nrows_A, ncols_A, density_A_matrix, + test_functor_i32(dev, queue_properties, format, nrows_A, ncols_A, density_A_matrix, oneapi::mkl::index_base::one, transpose_val, fp_one, fp_zero, default_alg, default_A_view, default_properties, no_reset_data, no_scalars_on_device), num_passed, num_skipped); // Test non-default alpha EXPECT_TRUE_OR_FUTURE_SKIP( - test_functor_i32(dev, format, nrows_A, ncols_A, density_A_matrix, index_zero, transpose_val, - set_fp_value()(2.f, 1.5f), fp_zero, default_alg, default_A_view, - default_properties, no_reset_data, no_scalars_on_device), + test_functor_i32(dev, queue_properties, format, nrows_A, ncols_A, density_A_matrix, + index_zero, transpose_val, set_fp_value()(2.f, 1.5f), fp_zero, + default_alg, default_A_view, default_properties, no_reset_data, + no_scalars_on_device), num_passed, num_skipped); // Test non-default beta EXPECT_TRUE_OR_FUTURE_SKIP( - test_functor_i32(dev, format, nrows_A, ncols_A, density_A_matrix, index_zero, transpose_val, - fp_one, set_fp_value()(3.2f, 1.f), default_alg, default_A_view, - default_properties, no_reset_data, no_scalars_on_device), + test_functor_i32(dev, queue_properties, format, nrows_A, ncols_A, density_A_matrix, + index_zero, transpose_val, fp_one, set_fp_value()(3.2f, 1.f), + default_alg, default_A_view, default_properties, no_reset_data, + no_scalars_on_device), num_passed, num_skipped); // Test 0 alpha EXPECT_TRUE_OR_FUTURE_SKIP( - test_functor_i32(dev, format, nrows_A, ncols_A, density_A_matrix, index_zero, transpose_val, - fp_zero, fp_one, default_alg, default_A_view, default_properties, - no_reset_data, no_scalars_on_device), + test_functor_i32(dev, queue_properties, format, nrows_A, ncols_A, density_A_matrix, + index_zero, transpose_val, fp_zero, fp_one, default_alg, default_A_view, + default_properties, no_reset_data, no_scalars_on_device), num_passed, num_skipped); // Test 0 alpha and beta EXPECT_TRUE_OR_FUTURE_SKIP( - test_functor_i32(dev, format, nrows_A, ncols_A, density_A_matrix, index_zero, transpose_val, - fp_zero, fp_zero, default_alg, default_A_view, default_properties, - no_reset_data, no_scalars_on_device), + test_functor_i32(dev, queue_properties, format, nrows_A, ncols_A, density_A_matrix, + index_zero, transpose_val, fp_zero, fp_zero, default_alg, default_A_view, + default_properties, no_reset_data, no_scalars_on_device), num_passed, num_skipped); // Test int64 indices EXPECT_TRUE_OR_FUTURE_SKIP( - test_functor_i64(dev, format, 27L, 13L, density_A_matrix, index_zero, transpose_val, fp_one, - fp_zero, default_alg, default_A_view, default_properties, no_reset_data, - no_scalars_on_device), + test_functor_i64(dev, queue_properties, format, 27L, 13L, density_A_matrix, index_zero, + transpose_val, fp_one, fp_zero, default_alg, default_A_view, + 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); EXPECT_TRUE_OR_FUTURE_SKIP( - test_functor_i32(dev, format, nrows_A, ncols_A, density_A_matrix, index_zero, transpose_val, - fp_one, fp_zero, default_alg, triangular_A_view, default_properties, - no_reset_data, no_scalars_on_device), + 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, + default_properties, no_reset_data, no_scalars_on_device), num_passed, num_skipped); // Upper triangular triangular_A_view.uplo_view = oneapi::mkl::uplo::upper; EXPECT_TRUE_OR_FUTURE_SKIP( - test_functor_i32(dev, format, nrows_A, ncols_A, density_A_matrix, index_zero, transpose_val, - fp_one, fp_zero, default_alg, triangular_A_view, default_properties, - no_reset_data, no_scalars_on_device), + 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, + 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); triangular_unit_A_view.diag_view = oneapi::mkl::diag::unit; EXPECT_TRUE_OR_FUTURE_SKIP( - test_functor_i32(dev, format, nrows_A, ncols_A, density_A_matrix, index_zero, transpose_val, - fp_one, fp_zero, default_alg, triangular_unit_A_view, default_properties, - no_reset_data, no_scalars_on_device), + 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_unit_A_view, default_properties, no_reset_data, + no_scalars_on_device), num_passed, num_skipped); // Upper triangular unit diagonal triangular_A_view.uplo_view = oneapi::mkl::uplo::upper; EXPECT_TRUE_OR_FUTURE_SKIP( - test_functor_i32(dev, format, nrows_A, ncols_A, density_A_matrix, index_zero, transpose_val, - fp_one, fp_zero, default_alg, triangular_unit_A_view, default_properties, - no_reset_data, no_scalars_on_device), + 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_unit_A_view, default_properties, no_reset_data, + no_scalars_on_device), num_passed, num_skipped); // Lower symmetric oneapi::mkl::sparse::matrix_view symmetric_view(oneapi::mkl::sparse::matrix_descr::symmetric); EXPECT_TRUE_OR_FUTURE_SKIP( - test_functor_i32(dev, format, nrows_A, ncols_A, density_A_matrix, index_zero, transpose_val, - fp_one, fp_zero, default_alg, symmetric_view, default_properties, - no_reset_data, no_scalars_on_device), + 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, + default_properties, no_reset_data, no_scalars_on_device), num_passed, num_skipped); // Upper symmetric symmetric_view.uplo_view = oneapi::mkl::uplo::upper; EXPECT_TRUE_OR_FUTURE_SKIP( - test_functor_i32(dev, format, nrows_A, ncols_A, density_A_matrix, index_zero, transpose_val, - fp_one, fp_zero, default_alg, symmetric_view, default_properties, - no_reset_data, no_scalars_on_device), + 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, + 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); EXPECT_TRUE_OR_FUTURE_SKIP( - test_functor_i32(dev, format, nrows_A, ncols_A, density_A_matrix, index_zero, transpose_val, - fp_one, fp_zero, default_alg, hermitian_view, default_properties, - no_reset_data, no_scalars_on_device), + 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, + default_properties, no_reset_data, no_scalars_on_device), num_passed, num_skipped); // Upper hermitian hermitian_view.uplo_view = oneapi::mkl::uplo::upper; EXPECT_TRUE_OR_FUTURE_SKIP( - test_functor_i32(dev, format, nrows_A, ncols_A, density_A_matrix, index_zero, transpose_val, - fp_one, fp_zero, default_alg, hermitian_view, default_properties, - no_reset_data, no_scalars_on_device), + 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, + default_properties, no_reset_data, no_scalars_on_device), num_passed, num_skipped); // Test other algorithms for (auto alg : non_default_algorithms) { EXPECT_TRUE_OR_FUTURE_SKIP( - test_functor_i32(dev, format, nrows_A, ncols_A, density_A_matrix, index_zero, - transpose_val, fp_one, fp_zero, alg, default_A_view, + test_functor_i32(dev, queue_properties, format, nrows_A, ncols_A, density_A_matrix, + index_zero, transpose_val, fp_one, fp_zero, alg, default_A_view, default_properties, no_reset_data, no_scalars_on_device), num_passed, num_skipped); } // Test matrix properties for (auto properties : get_all_matrix_properties_combinations(properties_queue, format)) { EXPECT_TRUE_OR_FUTURE_SKIP( - test_functor_i32(dev, format, nrows_A, ncols_A, density_A_matrix, index_zero, - transpose_val, fp_one, fp_zero, default_alg, default_A_view, - properties, no_reset_data, no_scalars_on_device), + test_functor_i32(dev, queue_properties, format, nrows_A, ncols_A, density_A_matrix, + index_zero, transpose_val, fp_one, fp_zero, default_alg, + default_A_view, properties, no_reset_data, no_scalars_on_device), num_passed, num_skipped); } + // In-order queue + EXPECT_TRUE_OR_FUTURE_SKIP( + test_functor_i32(dev, { property::queue::in_order::in_order() }, format, nrows_A, ncols_A, + density_A_matrix, index_zero, transpose_val, fp_one, fp_zero, default_alg, + default_A_view, default_properties, no_reset_data, no_scalars_on_device), + num_passed, num_skipped); } /** diff --git a/tests/unit_tests/sparse_blas/include/test_spsv.hpp b/tests/unit_tests/sparse_blas/include/test_spsv.hpp index ca58dfd7a..aabc0f569 100644 --- a/tests/unit_tests/sparse_blas/include/test_spsv.hpp +++ b/tests/unit_tests/sparse_blas/include/test_spsv.hpp @@ -51,6 +51,7 @@ void test_helper_with_format(testFunctorI32 test_functor_i32, testFunctorI64 tes sycl::device *dev, sparse_matrix_format_t format, oneapi::mkl::transpose transpose_val, int &num_passed, int &num_skipped) { + sycl::property_list queue_properties; double density_A_matrix = 0.144; fpType alpha = set_fp_value()(1.f, 0.f); int m = 277; @@ -69,87 +70,95 @@ void test_helper_with_format(testFunctorI32 test_functor_i32, testFunctorI64 tes // Basic test EXPECT_TRUE_OR_FUTURE_SKIP( - test_functor_i32(dev, format, m, density_A_matrix, index_zero, transpose_val, alpha, - default_alg, default_A_view, default_properties, no_reset_data, - no_scalars_on_device), + test_functor_i32(dev, queue_properties, format, m, density_A_matrix, index_zero, + transpose_val, alpha, default_alg, default_A_view, default_properties, + no_reset_data, no_scalars_on_device), num_passed, num_skipped); // Reset data - EXPECT_TRUE_OR_FUTURE_SKIP(test_functor_i32(dev, format, m, density_A_matrix, index_zero, - transpose_val, alpha, default_alg, default_A_view, - default_properties, true, no_scalars_on_device), - num_passed, num_skipped); + EXPECT_TRUE_OR_FUTURE_SKIP( + test_functor_i32(dev, queue_properties, format, m, density_A_matrix, index_zero, + transpose_val, alpha, default_alg, default_A_view, default_properties, + true, no_scalars_on_device), + num_passed, num_skipped); // Test alpha on the device EXPECT_TRUE_OR_FUTURE_SKIP( - test_functor_i32(dev, format, m, density_A_matrix, index_zero, transpose_val, alpha, - default_alg, default_A_view, default_properties, no_reset_data, true), + test_functor_i32(dev, queue_properties, format, m, density_A_matrix, index_zero, + transpose_val, alpha, default_alg, default_A_view, default_properties, + no_reset_data, true), num_passed, num_skipped); // Test index_base 1 EXPECT_TRUE_OR_FUTURE_SKIP( - test_functor_i32(dev, format, m, density_A_matrix, oneapi::mkl::index_base::one, - transpose_val, alpha, default_alg, default_A_view, default_properties, - no_reset_data, no_scalars_on_device), + test_functor_i32(dev, queue_properties, format, m, density_A_matrix, + oneapi::mkl::index_base::one, transpose_val, alpha, default_alg, + default_A_view, default_properties, no_reset_data, no_scalars_on_device), num_passed, num_skipped); // Test upper triangular matrix EXPECT_TRUE_OR_FUTURE_SKIP( - test_functor_i32(dev, format, m, density_A_matrix, index_zero, transpose_val, alpha, - default_alg, upper_A_view, default_properties, no_reset_data, - no_scalars_on_device), + test_functor_i32(dev, queue_properties, format, m, density_A_matrix, index_zero, + transpose_val, alpha, default_alg, upper_A_view, default_properties, + 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; EXPECT_TRUE_OR_FUTURE_SKIP( - test_functor_i32(dev, 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), + 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), num_passed, num_skipped); // Test upper triangular unit diagonal matrix triangular_unit_A_view.uplo_view = oneapi::mkl::uplo::upper; EXPECT_TRUE_OR_FUTURE_SKIP( - test_functor_i32(dev, 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), + 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), num_passed, num_skipped); // Test non-default alpha EXPECT_TRUE_OR_FUTURE_SKIP( - test_functor_i32(dev, format, m, density_A_matrix, index_zero, transpose_val, - set_fp_value()(2.f, 1.5f), default_alg, default_A_view, - default_properties, no_reset_data, no_scalars_on_device), + test_functor_i32(dev, queue_properties, format, m, density_A_matrix, index_zero, + transpose_val, set_fp_value()(2.f, 1.5f), default_alg, + default_A_view, default_properties, no_reset_data, no_scalars_on_device), num_passed, num_skipped); // Test int64 indices EXPECT_TRUE_OR_FUTURE_SKIP( - test_functor_i64(dev, format, 15L, density_A_matrix, index_zero, transpose_val, alpha, - default_alg, default_A_view, default_properties, no_reset_data, - no_scalars_on_device), + test_functor_i64(dev, queue_properties, format, 15L, density_A_matrix, index_zero, + transpose_val, alpha, default_alg, default_A_view, default_properties, + no_reset_data, no_scalars_on_device), num_passed, num_skipped); // Test lower no_optimize_alg EXPECT_TRUE_OR_FUTURE_SKIP( - test_functor_i32(dev, format, m, density_A_matrix, index_zero, transpose_val, alpha, - no_optimize_alg, default_A_view, default_properties, no_reset_data, - no_scalars_on_device), + test_functor_i32(dev, queue_properties, format, m, density_A_matrix, index_zero, + transpose_val, alpha, no_optimize_alg, default_A_view, default_properties, + no_reset_data, no_scalars_on_device), num_passed, num_skipped); // Test upper no_optimize_alg EXPECT_TRUE_OR_FUTURE_SKIP( - test_functor_i32(dev, format, m, density_A_matrix, index_zero, transpose_val, alpha, - no_optimize_alg, upper_A_view, default_properties, no_reset_data, - no_scalars_on_device), + test_functor_i32(dev, queue_properties, format, m, density_A_matrix, index_zero, + transpose_val, alpha, no_optimize_alg, upper_A_view, default_properties, + no_reset_data, no_scalars_on_device), num_passed, num_skipped); // Test matrix properties for (auto properties : get_all_matrix_properties_combinations(properties_queue, format)) { // Basic test with matrix properties EXPECT_TRUE_OR_FUTURE_SKIP( - test_functor_i32(dev, format, m, density_A_matrix, index_zero, transpose_val, alpha, - default_alg, default_A_view, properties, no_reset_data, - no_scalars_on_device), + test_functor_i32(dev, queue_properties, format, m, density_A_matrix, index_zero, + transpose_val, alpha, default_alg, default_A_view, properties, + no_reset_data, no_scalars_on_device), num_passed, num_skipped); // Test lower no_optimize_alg with matrix properties EXPECT_TRUE_OR_FUTURE_SKIP( - test_functor_i32(dev, format, m, density_A_matrix, index_zero, transpose_val, alpha, - no_optimize_alg, default_A_view, properties, no_reset_data, - no_scalars_on_device), + test_functor_i32(dev, queue_properties, format, m, density_A_matrix, index_zero, + transpose_val, alpha, no_optimize_alg, default_A_view, properties, + no_reset_data, no_scalars_on_device), num_passed, num_skipped); } + // In-order queue + EXPECT_TRUE_OR_FUTURE_SKIP( + test_functor_i32(dev, { property::queue::in_order::in_order() }, format, m, + density_A_matrix, index_zero, transpose_val, alpha, default_alg, + default_A_view, default_properties, no_reset_data, no_scalars_on_device), + num_passed, num_skipped); } /** diff --git a/tests/unit_tests/sparse_blas/source/sparse_spmm_buffer.cpp b/tests/unit_tests/sparse_blas/source/sparse_spmm_buffer.cpp index 4a37e8c7c..f76048386 100644 --- a/tests/unit_tests/sparse_blas/source/sparse_spmm_buffer.cpp +++ b/tests/unit_tests/sparse_blas/source/sparse_spmm_buffer.cpp @@ -28,8 +28,9 @@ extern std::vector devices; namespace { template -int test_spmm(sycl::device *dev, sparse_matrix_format_t format, intType nrows_A, intType ncols_A, - intType ncols_C, double density_A_matrix, oneapi::mkl::index_base index, +int test_spmm(sycl::device *dev, sycl::property_list queue_properties, + sparse_matrix_format_t format, intType nrows_A, intType ncols_A, intType ncols_C, + double density_A_matrix, oneapi::mkl::index_base index, oneapi::mkl::layout dense_matrix_layout, oneapi::mkl::transpose transpose_A, oneapi::mkl::transpose transpose_B, fpType alpha, fpType beta, intType ldb, intType ldc, oneapi::mkl::sparse::spmm_alg alg, @@ -40,7 +41,7 @@ int test_spmm(sycl::device *dev, sparse_matrix_format_t format, intType nrows_A, // Scalars on the device is not planned to be supported with the buffer API return 1; } - sycl::queue main_queue(*dev, exception_handler_t()); + sycl::queue main_queue(*dev, exception_handler_t(), queue_properties); if (require_square_matrix(A_view, matrix_properties)) { ncols_A = nrows_A; diff --git a/tests/unit_tests/sparse_blas/source/sparse_spmm_usm.cpp b/tests/unit_tests/sparse_blas/source/sparse_spmm_usm.cpp index f74403d6c..9618ef870 100644 --- a/tests/unit_tests/sparse_blas/source/sparse_spmm_usm.cpp +++ b/tests/unit_tests/sparse_blas/source/sparse_spmm_usm.cpp @@ -28,15 +28,16 @@ extern std::vector devices; namespace { template -int test_spmm(sycl::device *dev, sparse_matrix_format_t format, intType nrows_A, intType ncols_A, - intType ncols_C, double density_A_matrix, oneapi::mkl::index_base index, +int test_spmm(sycl::device *dev, sycl::property_list queue_properties, + sparse_matrix_format_t format, intType nrows_A, intType ncols_A, intType ncols_C, + double density_A_matrix, oneapi::mkl::index_base index, oneapi::mkl::layout dense_matrix_layout, oneapi::mkl::transpose transpose_A, oneapi::mkl::transpose transpose_B, fpType alpha, fpType beta, intType ldb, intType ldc, oneapi::mkl::sparse::spmm_alg alg, oneapi::mkl::sparse::matrix_view A_view, const std::set &matrix_properties, bool reset_data, bool test_scalar_on_device) { - sycl::queue main_queue(*dev, exception_handler_t()); + sycl::queue main_queue(*dev, exception_handler_t(), queue_properties); if (require_square_matrix(A_view, matrix_properties)) { ncols_A = nrows_A; diff --git a/tests/unit_tests/sparse_blas/source/sparse_spmv_buffer.cpp b/tests/unit_tests/sparse_blas/source/sparse_spmv_buffer.cpp index f56deaf91..20a4b6f16 100644 --- a/tests/unit_tests/sparse_blas/source/sparse_spmv_buffer.cpp +++ b/tests/unit_tests/sparse_blas/source/sparse_spmv_buffer.cpp @@ -28,7 +28,8 @@ extern std::vector devices; namespace { template -int test_spmv(sycl::device *dev, sparse_matrix_format_t format, intType nrows_A, intType ncols_A, +int test_spmv(sycl::device *dev, sycl::property_list queue_properties, + sparse_matrix_format_t format, intType nrows_A, intType ncols_A, double density_A_matrix, oneapi::mkl::index_base index, oneapi::mkl::transpose transpose_val, fpType alpha, fpType beta, oneapi::mkl::sparse::spmv_alg alg, oneapi::mkl::sparse::matrix_view A_view, @@ -38,7 +39,7 @@ int test_spmv(sycl::device *dev, sparse_matrix_format_t format, intType nrows_A, // Scalars on the device is not planned to be supported with the buffer API return 1; } - sycl::queue main_queue(*dev, exception_handler_t()); + sycl::queue main_queue(*dev, exception_handler_t(), queue_properties); if (require_square_matrix(A_view, matrix_properties)) { ncols_A = nrows_A; diff --git a/tests/unit_tests/sparse_blas/source/sparse_spmv_usm.cpp b/tests/unit_tests/sparse_blas/source/sparse_spmv_usm.cpp index 7f083003b..bf5fac9da 100644 --- a/tests/unit_tests/sparse_blas/source/sparse_spmv_usm.cpp +++ b/tests/unit_tests/sparse_blas/source/sparse_spmv_usm.cpp @@ -28,13 +28,14 @@ extern std::vector devices; namespace { template -int test_spmv(sycl::device *dev, sparse_matrix_format_t format, intType nrows_A, intType ncols_A, +int test_spmv(sycl::device *dev, sycl::property_list queue_properties, + sparse_matrix_format_t format, intType nrows_A, intType ncols_A, double density_A_matrix, oneapi::mkl::index_base index, oneapi::mkl::transpose transpose_val, fpType alpha, fpType beta, oneapi::mkl::sparse::spmv_alg alg, oneapi::mkl::sparse::matrix_view A_view, const std::set &matrix_properties, bool reset_data, bool test_scalar_on_device) { - sycl::queue main_queue(*dev, exception_handler_t()); + sycl::queue main_queue(*dev, exception_handler_t(), queue_properties); if (require_square_matrix(A_view, matrix_properties)) { ncols_A = nrows_A; diff --git a/tests/unit_tests/sparse_blas/source/sparse_spsv_buffer.cpp b/tests/unit_tests/sparse_blas/source/sparse_spsv_buffer.cpp index ebf47fd5e..163285e07 100644 --- a/tests/unit_tests/sparse_blas/source/sparse_spsv_buffer.cpp +++ b/tests/unit_tests/sparse_blas/source/sparse_spsv_buffer.cpp @@ -28,7 +28,8 @@ extern std::vector devices; namespace { template -int test_spsv(sycl::device *dev, sparse_matrix_format_t format, intType m, double density_A_matrix, +int test_spsv(sycl::device *dev, sycl::property_list queue_properties, + sparse_matrix_format_t format, intType m, double density_A_matrix, oneapi::mkl::index_base index, oneapi::mkl::transpose transpose_val, fpType alpha, oneapi::mkl::sparse::spsv_alg alg, oneapi::mkl::sparse::matrix_view A_view, const std::set &matrix_properties, @@ -37,7 +38,7 @@ int test_spsv(sycl::device *dev, sparse_matrix_format_t format, intType m, doubl // Scalars on the device is not planned to be supported with the buffer API return 1; } - sycl::queue main_queue(*dev, exception_handler_t()); + sycl::queue main_queue(*dev, exception_handler_t(), queue_properties); intType indexing = (index == oneapi::mkl::index_base::zero) ? 0 : 1; const std::size_t mu = static_cast(m); diff --git a/tests/unit_tests/sparse_blas/source/sparse_spsv_usm.cpp b/tests/unit_tests/sparse_blas/source/sparse_spsv_usm.cpp index 755bdd155..a5d24829f 100644 --- a/tests/unit_tests/sparse_blas/source/sparse_spsv_usm.cpp +++ b/tests/unit_tests/sparse_blas/source/sparse_spsv_usm.cpp @@ -28,12 +28,13 @@ extern std::vector devices; namespace { template -int test_spsv(sycl::device *dev, sparse_matrix_format_t format, intType m, double density_A_matrix, +int test_spsv(sycl::device *dev, sycl::property_list queue_properties, + sparse_matrix_format_t format, intType m, double density_A_matrix, oneapi::mkl::index_base index, oneapi::mkl::transpose transpose_val, fpType alpha, oneapi::mkl::sparse::spsv_alg alg, oneapi::mkl::sparse::matrix_view A_view, const std::set &matrix_properties, bool reset_data, bool test_scalar_on_device) { - sycl::queue main_queue(*dev, exception_handler_t()); + sycl::queue main_queue(*dev, exception_handler_t(), queue_properties); intType indexing = (index == oneapi::mkl::index_base::zero) ? 0 : 1; const std::size_t mu = static_cast(m);