Skip to content

Commit

Permalink
review updates
Browse files Browse the repository at this point in the history
Co-authored-by: Marcel Koch <marcel.koch@kit.edu>
  • Loading branch information
upsj and MarcelKoch committed Jun 7, 2023
1 parent 2f90a55 commit abf8f43
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
2 changes: 0 additions & 2 deletions core/test/utils/unsort_matrix.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,6 @@ void unsort_matrix(MtxPtr&& mtx, RandomEngine&& engine)
{
using value_type = typename gko::detail::pointee<MtxPtr>::value_type;
using index_type = typename gko::detail::pointee<MtxPtr>::index_type;
const auto exec = mtx->get_executor();
const auto master = exec->get_master();
matrix_data<value_type, index_type> data;
mtx->write(data);
auto& nonzeros = data.nonzeros;
Expand Down
7 changes: 4 additions & 3 deletions dpcpp/matrix/sparsity_csr_kernels.dp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -330,11 +330,12 @@ void is_sorted_by_column_index(
std::shared_ptr<const DpcppExecutor> exec,
const matrix::SparsityCsr<ValueType, IndexType>* to_check, bool* is_sorted)
{
array<bool> is_sorted_device_array{exec, {true}};
auto cpu_array = make_array_view(exec->get_master(), 1, is_sorted);
auto gpu_array = array<bool>{exec, cpu_array};
const auto num_rows = to_check->get_size()[0];
const auto row_ptrs = to_check->get_const_row_ptrs();
const auto cols = to_check->get_const_col_idxs();
auto is_sorted_device = is_sorted_device_array.get_data();
auto is_sorted_device = gpu_array.get_data();
exec->get_queue()->submit([&](sycl::handler& cgh) {
cgh.parallel_for(sycl::range<1>{num_rows}, [=](sycl::id<1> idx) {
const auto row = static_cast<size_type>(idx[0]);
Expand All @@ -350,7 +351,7 @@ void is_sorted_by_column_index(
}
});
});
*is_sorted = exec->copy_val_to_host(is_sorted_device);
cpu_array = gpu_array;
};

GKO_INSTANTIATE_FOR_EACH_VALUE_AND_INDEX_TYPE(
Expand Down

0 comments on commit abf8f43

Please sign in to comment.