Skip to content

Commit

Permalink
clang-format
Browse files Browse the repository at this point in the history
  • Loading branch information
Rbiessy committed Oct 4, 2024
1 parent f98e720 commit bc6bd6c
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 16 deletions.
20 changes: 12 additions & 8 deletions src/sparse_blas/backends/cusparse/cusparse_handles.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -263,8 +263,9 @@ void init_coo_matrix(sycl::queue &queue, matrix_handle_t *p_smhandle, std::int64
CUSPARSE_ERR_FUNC(cusparseCreateCoo, &cu_smhandle, num_rows, num_cols, nnz,
sc.get_mem(row_acc), sc.get_mem(col_acc), sc.get_mem(val_acc),
cuda_index_type, cuda_index_base, cuda_value_type);
*p_smhandle = new matrix_handle(cu_smhandle, row_ind, col_ind, val, detail::sparse_format::COO,
num_rows, num_cols, nnz, index);
*p_smhandle =
new matrix_handle(cu_smhandle, row_ind, col_ind, val, detail::sparse_format::COO,
num_rows, num_cols, nnz, index);
});
});
event.wait_and_throw();
Expand All @@ -284,8 +285,9 @@ void init_coo_matrix(sycl::queue &queue, matrix_handle_t *p_smhandle, std::int64
cusparseSpMatDescr_t cu_smhandle;
CUSPARSE_ERR_FUNC(cusparseCreateCoo, &cu_smhandle, num_rows, num_cols, nnz, row_ind,
col_ind, val, cuda_index_type, cuda_index_base, cuda_value_type);
*p_smhandle = new matrix_handle(cu_smhandle, row_ind, col_ind, val, detail::sparse_format::COO,
num_rows, num_cols, nnz, index);
*p_smhandle =
new matrix_handle(cu_smhandle, row_ind, col_ind, val, detail::sparse_format::COO,
num_rows, num_cols, nnz, index);
});
});
event.wait_and_throw();
Expand Down Expand Up @@ -388,8 +390,9 @@ void init_csr_matrix(sycl::queue &queue, matrix_handle_t *p_smhandle, std::int64
CUSPARSE_ERR_FUNC(cusparseCreateCsr, &cu_smhandle, num_rows, num_cols, nnz,
sc.get_mem(row_acc), sc.get_mem(col_acc), sc.get_mem(val_acc),
cuda_index_type, cuda_index_type, cuda_index_base, cuda_value_type);
*p_smhandle = new matrix_handle(cu_smhandle, row_ptr, col_ind, val, detail::sparse_format::CSR,
num_rows, num_cols, nnz, index);
*p_smhandle =
new matrix_handle(cu_smhandle, row_ptr, col_ind, val, detail::sparse_format::CSR,
num_rows, num_cols, nnz, index);
});
});
event.wait_and_throw();
Expand All @@ -410,8 +413,9 @@ void init_csr_matrix(sycl::queue &queue, matrix_handle_t *p_smhandle, std::int64
CUSPARSE_ERR_FUNC(cusparseCreateCsr, &cu_smhandle, num_rows, num_cols, nnz, row_ptr,
col_ind, val, cuda_index_type, cuda_index_type, cuda_index_base,
cuda_value_type);
*p_smhandle = new matrix_handle(cu_smhandle, row_ptr, col_ind, val, detail::sparse_format::CSR,
num_rows, num_cols, nnz, index);
*p_smhandle =
new matrix_handle(cu_smhandle, row_ptr, col_ind, val, detail::sparse_format::CSR,
num_rows, num_cols, nnz, index);
});
});
event.wait_and_throw();
Expand Down
20 changes: 12 additions & 8 deletions src/sparse_blas/backends/mkl_common/mkl_handles.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -109,8 +109,9 @@ void init_coo_matrix(sycl::queue &queue, oneapi::mkl::sparse::matrix_handle_t *p
sycl::buffer<intType, 1> col_ind, sycl::buffer<fpType, 1> val) {
oneapi::mkl::sparse::matrix_handle_t mkl_handle;
oneapi::mkl::sparse::init_matrix_handle(&mkl_handle);
auto internal_smhandle = new detail::sparse_matrix_handle(
mkl_handle, row_ind, col_ind, val, detail::sparse_format::COO, num_rows, num_cols, nnz, index);
auto internal_smhandle = new detail::sparse_matrix_handle(mkl_handle, row_ind, col_ind, val,
detail::sparse_format::COO, num_rows,
num_cols, nnz, index);
// The backend handle must use the buffers from the internal handle as they will be kept alive until the handle is released.
oneapi::mkl::sparse::set_coo_data(queue, mkl_handle, static_cast<intType>(num_rows),
static_cast<intType>(num_cols), static_cast<intType>(nnz),
Expand All @@ -127,8 +128,9 @@ void init_coo_matrix(sycl::queue &queue, oneapi::mkl::sparse::matrix_handle_t *p
fpType *val) {
oneapi::mkl::sparse::matrix_handle_t mkl_handle;
oneapi::mkl::sparse::init_matrix_handle(&mkl_handle);
auto internal_smhandle = new detail::sparse_matrix_handle(
mkl_handle, row_ind, col_ind, val, detail::sparse_format::COO, num_rows, num_cols, nnz, index);
auto internal_smhandle = new detail::sparse_matrix_handle(mkl_handle, row_ind, col_ind, val,
detail::sparse_format::COO, num_rows,
num_cols, nnz, index);
auto event = oneapi::mkl::sparse::set_coo_data(
queue, mkl_handle, static_cast<intType>(num_rows), static_cast<intType>(num_cols),
static_cast<intType>(nnz), index, row_ind, col_ind, val);
Expand Down Expand Up @@ -189,8 +191,9 @@ void init_csr_matrix(sycl::queue &queue, oneapi::mkl::sparse::matrix_handle_t *p
sycl::buffer<intType, 1> col_ind, sycl::buffer<fpType, 1> val) {
oneapi::mkl::sparse::matrix_handle_t mkl_handle;
oneapi::mkl::sparse::init_matrix_handle(&mkl_handle);
auto internal_smhandle = new detail::sparse_matrix_handle(
mkl_handle, row_ptr, col_ind, val, detail::sparse_format::CSR, num_rows, num_cols, nnz, index);
auto internal_smhandle = new detail::sparse_matrix_handle(mkl_handle, row_ptr, col_ind, val,
detail::sparse_format::CSR, num_rows,
num_cols, nnz, index);
// The backend deduces nnz from row_ptr.
// The backend handle must use the buffers from the internal handle as they will be kept alive until the handle is released.
oneapi::mkl::sparse::set_csr_data(queue, mkl_handle, static_cast<intType>(num_rows),
Expand All @@ -208,8 +211,9 @@ void init_csr_matrix(sycl::queue &queue, oneapi::mkl::sparse::matrix_handle_t *p
fpType *val) {
oneapi::mkl::sparse::matrix_handle_t mkl_handle;
oneapi::mkl::sparse::init_matrix_handle(&mkl_handle);
auto internal_smhandle = new detail::sparse_matrix_handle(
mkl_handle, row_ptr, col_ind, val, detail::sparse_format::CSR, num_rows, num_cols, nnz, index);
auto internal_smhandle = new detail::sparse_matrix_handle(mkl_handle, row_ptr, col_ind, val,
detail::sparse_format::CSR, num_rows,
num_cols, nnz, index);
// The backend deduces nnz from row_ptr.
auto event = oneapi::mkl::sparse::set_csr_data(
queue, mkl_handle, static_cast<intType>(num_rows), static_cast<intType>(num_cols), index,
Expand Down

0 comments on commit bc6bd6c

Please sign in to comment.