Skip to content

Commit

Permalink
Reword exception
Browse files Browse the repository at this point in the history
  • Loading branch information
Rbiessy committed Sep 2, 2024
1 parent 4f39b22 commit 0ecb032
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 18 deletions.
10 changes: 4 additions & 6 deletions src/sparse_blas/backends/mkl_common/mkl_spmm.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -123,9 +123,8 @@ inline void common_spmm_optimize(
check_valid_spmm(__func__, opA, A_view, A_handle, B_handle, C_handle, is_alpha_host_accessible,
is_beta_host_accessible);
if (!spmm_descr->buffer_size_called) {
throw mkl::uninitialized(
"sparse_blas", __func__,
"spmm_buffer_size must be called with the same arguments before spmm_optimize.");
throw mkl::uninitialized("sparse_blas", __func__,
"spmm_buffer_size must be called before spmm_optimize.");
}
spmm_descr->optimized_called = true;
spmm_descr->last_optimized_opA = opA;
Expand Down Expand Up @@ -226,9 +225,8 @@ sycl::event spmm(sycl::queue &queue, oneapi::mkl::transpose opA, oneapi::mkl::tr
is_beta_host_accessible);

if (!spmm_descr->optimized_called) {
throw mkl::uninitialized(
"sparse_blas", __func__,
"spmm_optimize must be called with the same arguments before spmm.");
throw mkl::uninitialized("sparse_blas", __func__,
"spmm_optimize must be called before spmm.");
}
CHECK_DESCR_MATCH(spmm_descr, opA, "spmm_optimize");
CHECK_DESCR_MATCH(spmm_descr, opB, "spmm_optimize");
Expand Down
10 changes: 4 additions & 6 deletions src/sparse_blas/backends/mkl_common/mkl_spmv.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -114,9 +114,8 @@ inline void common_spmv_optimize(sycl::queue &queue, oneapi::mkl::transpose opA,
check_valid_spmv(__func__, opA, A_view, A_handle, x_handle, y_handle, is_alpha_host_accessible,
is_beta_host_accessible);
if (!spmv_descr->buffer_size_called) {
throw mkl::uninitialized(
"sparse_blas", __func__,
"spmv_buffer_size must be called with the same arguments before spmv_optimize.");
throw mkl::uninitialized("sparse_blas", __func__,
"spmv_buffer_size must be called before spmv_optimize.");
}
spmv_descr->optimized_called = true;
spmv_descr->last_optimized_opA = opA;
Expand Down Expand Up @@ -259,9 +258,8 @@ sycl::event spmv(sycl::queue &queue, oneapi::mkl::transpose opA, const void *alp
is_beta_host_accessible);

if (!spmv_descr->optimized_called) {
throw mkl::uninitialized(
"sparse_blas", __func__,
"spmv_optimize must be called with the same arguments before spmv.");
throw mkl::uninitialized("sparse_blas", __func__,
"spmv_optimize must be called before spmv.");
}
CHECK_DESCR_MATCH(spmv_descr, opA, "spmv_optimize");
CHECK_DESCR_MATCH(spmv_descr, A_view, "spmv_optimize");
Expand Down
10 changes: 4 additions & 6 deletions src/sparse_blas/backends/mkl_common/mkl_spsv.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -110,9 +110,8 @@ inline void common_spsv_optimize(sycl::queue &queue, oneapi::mkl::transpose opA,
check_valid_spsv(__func__, opA, A_view, A_handle, x_handle, y_handle, is_alpha_host_accessible,
alg);
if (!spsv_descr->buffer_size_called) {
throw mkl::uninitialized(
"sparse_blas", __func__,
"spsv_buffer_size must be called with the same arguments before spsv_optimize.");
throw mkl::uninitialized("sparse_blas", __func__,
"spsv_buffer_size must be called before spsv_optimize.");
}
spsv_descr->optimized_called = true;
spsv_descr->last_optimized_opA = opA;
Expand Down Expand Up @@ -205,9 +204,8 @@ sycl::event spsv(sycl::queue &queue, oneapi::mkl::transpose opA, const void *alp
alg);

if (!spsv_descr->optimized_called) {
throw mkl::uninitialized(
"sparse_blas", __func__,
"spsv_optimize must be called with the same arguments before spsv.");
throw mkl::uninitialized("sparse_blas", __func__,
"spsv_optimize must be called before spsv.");
}
CHECK_DESCR_MATCH(spsv_descr, opA, "spsv_optimize");
CHECK_DESCR_MATCH(spsv_descr, A_view, "spsv_optimize");
Expand Down

0 comments on commit 0ecb032

Please sign in to comment.