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 8070633fc..68528f757 100644 --- a/tests/unit_tests/sparse_blas/source/sparse_spmm_usm.cpp +++ b/tests/unit_tests/sparse_blas/source/sparse_spmm_usm.cpp @@ -152,9 +152,8 @@ int test_spmm(sycl::device *dev, sparse_matrix_format_t format, intType nrows_A, shuffle_sparse_matrix_if_needed(format, matrix_properties, indexing, ia_host.data(), ja_host.data(), a_host.data(), reset_nnz, static_cast(nrows_A)); + ev_spmm.wait_and_throw(); if (reset_nnz > nnz) { - // Wait before freeing usm pointers - ev_spmm.wait_and_throw(); ia_usm_uptr = malloc_device_uptr(main_queue, ia_host.size()); ja_usm_uptr = malloc_device_uptr(main_queue, ja_host.size()); a_usm_uptr = malloc_device_uptr(main_queue, a_host.size()); 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 2852a2495..e6df1840d 100644 --- a/tests/unit_tests/sparse_blas/source/sparse_spmv_usm.cpp +++ b/tests/unit_tests/sparse_blas/source/sparse_spmv_usm.cpp @@ -144,9 +144,8 @@ int test_spmv(sycl::device *dev, sparse_matrix_format_t format, intType nrows_A, shuffle_sparse_matrix_if_needed(format, matrix_properties, indexing, ia_host.data(), ja_host.data(), a_host.data(), reset_nnz, static_cast(nrows_A)); + ev_spmv.wait_and_throw(); if (reset_nnz > nnz) { - // Wait before freeing usm pointers - ev_spmv.wait_and_throw(); ia_usm_uptr = malloc_device_uptr(main_queue, ia_host.size()); ja_usm_uptr = malloc_device_uptr(main_queue, ja_host.size()); a_usm_uptr = malloc_device_uptr(main_queue, a_host.size()); 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 03edf8d37..6a3f485a9 100644 --- a/tests/unit_tests/sparse_blas/source/sparse_spsv_usm.cpp +++ b/tests/unit_tests/sparse_blas/source/sparse_spsv_usm.cpp @@ -141,9 +141,8 @@ int test_spsv(sycl::device *dev, sparse_matrix_format_t format, intType m, doubl require_diagonal); shuffle_sparse_matrix_if_needed(format, matrix_properties, indexing, ia_host.data(), ja_host.data(), a_host.data(), reset_nnz, mu); + ev_spsv.wait_and_throw(); if (reset_nnz > nnz) { - // Wait before freeing usm pointers - ev_spsv.wait_and_throw(); ia_usm_uptr = malloc_device_uptr(main_queue, ia_host.size()); ja_usm_uptr = malloc_device_uptr(main_queue, ja_host.size()); a_usm_uptr = malloc_device_uptr(main_queue, a_host.size());