Skip to content

Commit

Permalink
USM tests using reset_data wait before updating device values
Browse files Browse the repository at this point in the history
  • Loading branch information
Rbiessy committed Oct 24, 2024
1 parent c0eae1e commit 2149e39
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 6 deletions.
3 changes: 1 addition & 2 deletions tests/unit_tests/sparse_blas/source/sparse_spmm_usm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<std::size_t>(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<intType>(main_queue, ia_host.size());
ja_usm_uptr = malloc_device_uptr<intType>(main_queue, ja_host.size());
a_usm_uptr = malloc_device_uptr<fpType>(main_queue, a_host.size());
Expand Down
3 changes: 1 addition & 2 deletions tests/unit_tests/sparse_blas/source/sparse_spmv_usm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<std::size_t>(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<intType>(main_queue, ia_host.size());
ja_usm_uptr = malloc_device_uptr<intType>(main_queue, ja_host.size());
a_usm_uptr = malloc_device_uptr<fpType>(main_queue, a_host.size());
Expand Down
3 changes: 1 addition & 2 deletions tests/unit_tests/sparse_blas/source/sparse_spsv_usm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<intType>(main_queue, ia_host.size());
ja_usm_uptr = malloc_device_uptr<intType>(main_queue, ja_host.size());
a_usm_uptr = malloc_device_uptr<fpType>(main_queue, a_host.size());
Expand Down

0 comments on commit 2149e39

Please sign in to comment.