Skip to content

Commit

Permalink
Format files
Browse files Browse the repository at this point in the history
Co-authored-by: Pratik Nayak <[email protected]>
  • Loading branch information
ginkgo-bot and pratikvn committed Oct 8, 2023
1 parent 0e05617 commit 648baa2
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 33 deletions.
54 changes: 27 additions & 27 deletions dpcpp/matrix/batch_ell_kernels.dp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -100,17 +100,17 @@ void simple_apply(std::shared_ptr<const DefaultExecutor> exec,
// Launch a kernel that has nbatches blocks, each block has max group size
(exec->get_queue())->submit([&](sycl::handler& cgh) {
cgh.parallel_for(
sycl_nd_range(grid, block), [=
](sycl::nd_item<3> item_ct1) [[sycl::reqd_sub_group_size(
config::warp_size)]] {
auto group = item_ct1.get_group();
auto group_id = group.get_group_linear_id();
const auto mat_b =
batch::matrix::extract_batch_item(mat_ub, group_id);
const auto b_b = batch::extract_batch_item(b_ub, group_id);
const auto x_b = batch::extract_batch_item(x_ub, group_id);
simple_apply_kernel(mat_b, b_b, x_b, item_ct1);
});
sycl_nd_range(grid, block),
[=](sycl::nd_item<3> item_ct1)
[[sycl::reqd_sub_group_size(config::warp_size)]] {
auto group = item_ct1.get_group();
auto group_id = group.get_group_linear_id();
const auto mat_b =
batch::matrix::extract_batch_item(mat_ub, group_id);
const auto b_b = batch::extract_batch_item(b_ub, group_id);
const auto x_b = batch::extract_batch_item(x_ub, group_id);
simple_apply_kernel(mat_b, b_b, x_b, item_ct1);
});
});
}

Expand Down Expand Up @@ -147,22 +147,22 @@ void advanced_apply(std::shared_ptr<const DefaultExecutor> exec,
// Launch a kernel that has nbatches blocks, each block has max group size
(exec->get_queue())->submit([&](sycl::handler& cgh) {
cgh.parallel_for(
sycl_nd_range(grid, block), [=
](sycl::nd_item<3> item_ct1) [[sycl::reqd_sub_group_size(
config::warp_size)]] {
auto group = item_ct1.get_group();
auto group_id = group.get_group_linear_id();
const auto mat_b =
batch::matrix::extract_batch_item(mat_ub, group_id);
const auto b_b = batch::extract_batch_item(b_ub, group_id);
const auto x_b = batch::extract_batch_item(x_ub, group_id);
const auto alpha_b =
batch::extract_batch_item(alpha_ub, group_id);
const auto beta_b =
batch::extract_batch_item(beta_ub, group_id);
advanced_apply_kernel(alpha_b, mat_b, b_b, beta_b, x_b,
item_ct1);
});
sycl_nd_range(grid, block),
[=](sycl::nd_item<3> item_ct1)
[[sycl::reqd_sub_group_size(config::warp_size)]] {
auto group = item_ct1.get_group();
auto group_id = group.get_group_linear_id();
const auto mat_b =
batch::matrix::extract_batch_item(mat_ub, group_id);
const auto b_b = batch::extract_batch_item(b_ub, group_id);
const auto x_b = batch::extract_batch_item(x_ub, group_id);
const auto alpha_b =
batch::extract_batch_item(alpha_ub, group_id);
const auto beta_b =
batch::extract_batch_item(beta_ub, group_id);
advanced_apply_kernel(alpha_b, mat_b, b_b, beta_b, x_b,
item_ct1);
});
});
}

Expand Down
4 changes: 2 additions & 2 deletions include/ginkgo/core/base/batch_multi_vector.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -213,8 +213,8 @@ class MultiVector
* significantly more memory efficient than the non-constant version,
* so always prefer this version.
*/
const value_type* get_const_values_for_item(size_type batch_id) const
noexcept
const value_type* get_const_values_for_item(
size_type batch_id) const noexcept
{
GKO_ASSERT(batch_id < this->get_num_batch_items());
return values_.get_const_data() +
Expand Down
8 changes: 4 additions & 4 deletions include/ginkgo/core/matrix/batch_ell.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -214,8 +214,8 @@ class Ell final
* significantly more memory efficient than the non-constant version,
* so always prefer this version.
*/
const index_type* get_const_col_idxs_for_item(size_type batch_id) const
noexcept
const index_type* get_const_col_idxs_for_item(
size_type batch_id) const noexcept
{
GKO_ASSERT(batch_id < this->get_num_batch_items());
return col_idxs_.get_const_data();
Expand Down Expand Up @@ -243,8 +243,8 @@ class Ell final
* significantly more memory efficient than the non-constant version,
* so always prefer this version.
*/
const value_type* get_const_values_for_item(size_type batch_id) const
noexcept
const value_type* get_const_values_for_item(
size_type batch_id) const noexcept
{
GKO_ASSERT(batch_id < this->get_num_batch_items());
return values_.get_const_data() +
Expand Down
1 change: 1 addition & 0 deletions include/ginkgo/ginkgo.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include <ginkgo/core/log/stream.hpp>

#include <ginkgo/core/matrix/batch_dense.hpp>
#include <ginkgo/core/matrix/batch_ell.hpp>
#include <ginkgo/core/matrix/coo.hpp>
#include <ginkgo/core/matrix/csr.hpp>
#include <ginkgo/core/matrix/dense.hpp>
Expand Down

0 comments on commit 648baa2

Please sign in to comment.