Skip to content

Commit

Permalink
passing the accessors with their ptrs
Browse files Browse the repository at this point in the history
  • Loading branch information
phu0ngng committed Mar 9, 2023
1 parent 997ef8c commit d24a473
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 15 deletions.
5 changes: 1 addition & 4 deletions dpcpp/preconditioner/batch_block_jacobi.hpp.inc
Original file line number Diff line number Diff line change
Expand Up @@ -164,10 +164,7 @@ template <typename ValueType>
__dpct_inline__ void batch_block_jacobi_apply(
BatchBlockJacobi<ValueType> prec, const size_type batch_id, const int nrows,
const ValueType* const b_values, ValueType* const x_values,
sycl::accessor<ValueType, 1, sycl::access_mode::read_write,
sycl::access::target::local>
sh_mem,
sycl::nd_item<3> item_ct1)
ValueType* sh_mem, sycl::nd_item<3> item_ct1)
{
ValueType* work = &sh_mem[0];

Expand Down
15 changes: 9 additions & 6 deletions dpcpp/preconditioner/batch_jacobi_kernels.dp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -110,9 +110,11 @@ void batch_jacobi_apply_helper(
cgh.parallel_for(
sycl_nd_range(grid, block), [=](sycl::nd_item<3> item_ct1) {
auto batch_id = item_ct1.get_group_linear_id();
batch_scalar_jacobi_apply(prec_scalar_jacobi, sys_mat_batch,
batch_id, nrows, r_values,
z_values, slm_storage, item_ct1);
batch_scalar_jacobi_apply(
prec_scalar_jacobi, sys_mat_batch, batch_id, nrows,
r_values, z_values,
static_cast<ValueType*>(slm_storage.get_pointer()),
item_ct1);
});
});

Expand All @@ -133,9 +135,10 @@ void batch_jacobi_apply_helper(
cgh.parallel_for(
sycl_nd_range(grid, block), [=](sycl::nd_item<3> item_ct1) {
auto batch_id = item_ct1.get_group_linear_id();
batch_block_jacobi_apply(prec_block_jacobi, batch_id, nrows,
r_values, z_values, slm_storage,
item_ct1);
batch_block_jacobi_apply(
prec_block_jacobi, batch_id, nrows, r_values, z_values,
static_cast<ValueType*>(slm_storage.get_pointer()),
item_ct1);
});
});
}
Expand Down
6 changes: 1 addition & 5 deletions dpcpp/preconditioner/batch_scalar_jacobi.hpp.inc
Original file line number Diff line number Diff line change
Expand Up @@ -165,11 +165,7 @@ template <typename BatchMatrixType, typename ValueType>
__dpct_inline__ void batch_scalar_jacobi_apply(
BatchScalarJacobi<ValueType> prec, const BatchMatrixType sys_mat_batch,
const size_type batch_id, const int nrows, const ValueType* const b_values,
ValueType* const x_values,
sycl::accessor<ValueType, 1, sycl::access_mode::read_write,
sycl::access::target::local>
sh_mem,
sycl::nd_item<3> item_ct1)
ValueType* const x_values, ValueType* sh_mem, sycl::nd_item<3> item_ct1)
{
const auto sys_mat_batch_entry =
batch::batch_entry(sys_mat_batch, batch_id);
Expand Down

0 comments on commit d24a473

Please sign in to comment.