Skip to content

Commit f89317d

Browse files
committed
run clang-format on all files
1 parent dde4316 commit f89317d

File tree

6 files changed

+112
-104
lines changed

6 files changed

+112
-104
lines changed

core/test/base/deferred_factory.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,8 +86,8 @@ struct test_impl<gko::xstd::void_t<decltype(T(std::declval<Args>()...))>, T,
8686

8787
// specialization for DF2 with_factory_list
8888
template <typename... Args>
89-
struct test_impl<gko::xstd::void_t<decltype(DF2::param{}.with_factory_list(
90-
std::declval<Args>()...))>,
89+
struct test_impl<gko::xstd::void_t<decltype(
90+
DF2::param{}.with_factory_list(std::declval<Args>()...))>,
9191
DummyFlag, Args...> : std::true_type {};
9292

9393
// test the object can be constructable or not with Args.

dpcpp/factorization/par_ilut_filter_kernels.hpp.inc

Lines changed: 32 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -115,12 +115,13 @@ void threshold_filter_nnz(dim3 grid, dim3 block,
115115
remove_complex<ValueType> threshold, IndexType* nnz,
116116
bool lower)
117117
{
118-
queue->parallel_for(
119-
sycl_nd_range(grid, block), [=
120-
](sycl::nd_item<3> item_ct1) [[sycl::reqd_sub_group_size(subgroup_size)]] {
121-
threshold_filter_nnz<subgroup_size>(
122-
row_ptrs, vals, num_rows, threshold, nnz, lower, item_ct1);
123-
});
118+
queue->parallel_for(sycl_nd_range(grid, block),
119+
[=](sycl::nd_item<3> item_ct1)
120+
[[sycl::reqd_sub_group_size(subgroup_size)]] {
121+
threshold_filter_nnz<subgroup_size>(
122+
row_ptrs, vals, num_rows, threshold, nnz,
123+
lower, item_ct1);
124+
});
124125
}
125126

126127

@@ -152,14 +153,15 @@ void threshold_filter(dim3 grid, dim3 block, size_type dynamic_shared_memory,
152153
const IndexType* new_row_ptrs, IndexType* new_row_idxs,
153154
IndexType* new_col_idxs, ValueType* new_vals, bool lower)
154155
{
155-
queue->parallel_for(
156-
sycl_nd_range(grid, block), [=
157-
](sycl::nd_item<3> item_ct1) [[sycl::reqd_sub_group_size(subgroup_size)]] {
158-
threshold_filter<subgroup_size>(
159-
old_row_ptrs, old_col_idxs, old_vals, num_rows, threshold,
160-
new_row_ptrs, new_row_idxs, new_col_idxs, new_vals, lower,
161-
item_ct1);
162-
});
156+
queue->parallel_for(sycl_nd_range(grid, block),
157+
[=](sycl::nd_item<3> item_ct1)
158+
[[sycl::reqd_sub_group_size(subgroup_size)]] {
159+
threshold_filter<subgroup_size>(
160+
old_row_ptrs, old_col_idxs, old_vals,
161+
num_rows, threshold, new_row_ptrs,
162+
new_row_idxs, new_col_idxs, new_vals, lower,
163+
item_ct1);
164+
});
163165
}
164166

165167

@@ -183,12 +185,13 @@ void bucket_filter_nnz(dim3 grid, dim3 block, size_type dynamic_shared_memory,
183185
const BucketType* buckets, IndexType num_rows,
184186
BucketType bucket, IndexType* nnz)
185187
{
186-
queue->parallel_for(
187-
sycl_nd_range(grid, block), [=
188-
](sycl::nd_item<3> item_ct1) [[sycl::reqd_sub_group_size(subgroup_size)]] {
189-
bucket_filter_nnz<subgroup_size>(row_ptrs, buckets, num_rows,
190-
bucket, nnz, item_ct1);
191-
});
188+
queue->parallel_for(sycl_nd_range(grid, block),
189+
[=](sycl::nd_item<3> item_ct1)
190+
[[sycl::reqd_sub_group_size(subgroup_size)]] {
191+
bucket_filter_nnz<subgroup_size>(
192+
row_ptrs, buckets, num_rows, bucket, nnz,
193+
item_ct1);
194+
});
192195
}
193196

194197

@@ -222,13 +225,15 @@ void bucket_filter(dim3 grid, dim3 block, size_type dynamic_shared_memory,
222225
IndexType* new_row_idxs, IndexType* new_col_idxs,
223226
ValueType* new_vals)
224227
{
225-
queue->parallel_for(
226-
sycl_nd_range(grid, block), [=
227-
](sycl::nd_item<3> item_ct1) [[sycl::reqd_sub_group_size(subgroup_size)]] {
228-
bucket_filter<subgroup_size>(
229-
old_row_ptrs, old_col_idxs, old_vals, buckets, num_rows, bucket,
230-
new_row_ptrs, new_row_idxs, new_col_idxs, new_vals, item_ct1);
231-
});
228+
queue->parallel_for(sycl_nd_range(grid, block),
229+
[=](sycl::nd_item<3> item_ct1)
230+
[[sycl::reqd_sub_group_size(subgroup_size)]] {
231+
bucket_filter<subgroup_size>(
232+
old_row_ptrs, old_col_idxs, old_vals,
233+
buckets, num_rows, bucket, new_row_ptrs,
234+
new_row_idxs, new_col_idxs, new_vals,
235+
item_ct1);
236+
});
232237
}
233238

234239

dpcpp/factorization/par_ilut_select_kernels.hpp.inc

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -68,13 +68,13 @@ void build_searchtree(dim3 grid, dim3 block, size_type dynamic_shared_memory,
6868
sycl::access::target::local>
6969
sh_samples_acc_ct1(sycl::range<1>(1024 /*sample_size*/), cgh);
7070

71-
cgh.parallel_for(
72-
sycl_nd_range(grid, block), [=
73-
](sycl::nd_item<3> item_ct1) [[sycl::reqd_sub_group_size(
74-
config::warp_size)]] {
75-
build_searchtree(input, size, tree_output, item_ct1,
76-
sh_samples_acc_ct1.get_pointer());
77-
});
71+
cgh.parallel_for(sycl_nd_range(grid, block),
72+
[=](sycl::nd_item<3> item_ct1)
73+
[[sycl::reqd_sub_group_size(config::warp_size)]] {
74+
build_searchtree(
75+
input, size, tree_output, item_ct1,
76+
sh_samples_acc_ct1.get_pointer());
77+
});
7878
});
7979
}
8080

@@ -256,12 +256,13 @@ void block_prefix_sum(dim3 grid, dim3 block, size_type dynamic_shared_memory,
256256
cgh);
257257

258258
cgh.parallel_for(
259-
sycl_nd_range(grid, block), [=
260-
](sycl::nd_item<3> item_ct1) [[sycl::reqd_sub_group_size(
261-
config::warp_size)]] {
262-
block_prefix_sum(counters, totals, num_blocks, item_ct1,
263-
(IndexType*)warp_sums_acc_ct1.get_pointer());
264-
});
259+
sycl_nd_range(grid, block),
260+
[=](sycl::nd_item<3> item_ct1)
261+
[[sycl::reqd_sub_group_size(config::warp_size)]] {
262+
block_prefix_sum(
263+
counters, totals, num_blocks, item_ct1,
264+
(IndexType*)warp_sums_acc_ct1.get_pointer());
265+
});
265266
});
266267
}
267268

@@ -363,12 +364,12 @@ void basecase_select(dim3 grid, dim3 block, size_type dynamic_shared_memory,
363364
sh_local_acc_ct1(sycl::range<1>(1024 /*basecase_size*/), cgh);
364365

365366
cgh.parallel_for(
366-
sycl_nd_range(grid, block), [=
367-
](sycl::nd_item<3> item_ct1) [[sycl::reqd_sub_group_size(
368-
config::warp_size)]] {
369-
basecase_select(input, size, rank, out, item_ct1,
370-
(ValueType*)sh_local_acc_ct1.get_pointer());
371-
});
367+
sycl_nd_range(grid, block),
368+
[=](sycl::nd_item<3> item_ct1)
369+
[[sycl::reqd_sub_group_size(config::warp_size)]] {
370+
basecase_select(input, size, rank, out, item_ct1,
371+
(ValueType*)sh_local_acc_ct1.get_pointer());
372+
});
372373
});
373374
}
374375

@@ -403,12 +404,11 @@ template <typename IndexType>
403404
void find_bucket(dim3 grid, dim3 block, size_type dynamic_shared_memory,
404405
sycl::queue* queue, IndexType* prefix_sum, IndexType rank)
405406
{
406-
queue->parallel_for(
407-
sycl_nd_range(grid, block), [=
408-
](sycl::nd_item<3> item_ct1) [[sycl::reqd_sub_group_size(
409-
config::warp_size)]] {
410-
find_bucket(prefix_sum, rank, item_ct1);
411-
});
407+
queue->parallel_for(sycl_nd_range(grid, block),
408+
[=](sycl::nd_item<3> item_ct1)
409+
[[sycl::reqd_sub_group_size(config::warp_size)]] {
410+
find_bucket(prefix_sum, rank, item_ct1);
411+
});
412412
}
413413

414414

dpcpp/solver/common_gmres_kernels.dp.inc

Lines changed: 50 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,14 @@
66
// Must be called with at least `max(stride_b * num_rows, krylov_dim *
77
// num_cols)` threads in total.
88
template <size_type block_size, typename ValueType>
9-
void initialize_kernel(
10-
size_type num_rows, size_type num_cols, size_type krylov_dim,
11-
const ValueType *__restrict__ b, size_type stride_b,
12-
ValueType *__restrict__ residual, size_type stride_residual,
13-
ValueType *__restrict__ givens_sin, size_type stride_sin,
14-
ValueType *__restrict__ givens_cos, size_type stride_cos,
15-
stopping_status *__restrict__ stop_status, sycl::nd_item<3> item_ct1)
9+
void initialize_kernel(size_type num_rows, size_type num_cols,
10+
size_type krylov_dim, const ValueType* __restrict__ b,
11+
size_type stride_b, ValueType* __restrict__ residual,
12+
size_type stride_residual,
13+
ValueType* __restrict__ givens_sin, size_type stride_sin,
14+
ValueType* __restrict__ givens_cos, size_type stride_cos,
15+
stopping_status* __restrict__ stop_status,
16+
sycl::nd_item<3> item_ct1)
1617
{
1718
const auto global_id = thread::get_thread_id_flat(item_ct1);
1819

@@ -39,15 +40,15 @@ void initialize_kernel(
3940

4041
template <size_type block_size, typename ValueType>
4142
void initialize_kernel(dim3 grid, dim3 block, size_type dynamic_shared_memory,
42-
sycl::queue *queue, size_type num_rows,
43-
size_type num_cols, size_type krylov_dim,
44-
const ValueType *b, size_type stride_b,
45-
ValueType *residual, size_type stride_residual,
46-
ValueType *givens_sin, size_type stride_sin,
47-
ValueType *givens_cos, size_type stride_cos,
48-
stopping_status *stop_status)
43+
sycl::queue* queue, size_type num_rows,
44+
size_type num_cols, size_type krylov_dim,
45+
const ValueType* b, size_type stride_b,
46+
ValueType* residual, size_type stride_residual,
47+
ValueType* givens_sin, size_type stride_sin,
48+
ValueType* givens_cos, size_type stride_cos,
49+
stopping_status* stop_status)
4950
{
50-
queue->submit([&](sycl::handler &cgh) {
51+
queue->submit([&](sycl::handler& cgh) {
5152
cgh.parallel_for(
5253
sycl_nd_range(grid, block), [=](sycl::nd_item<3> item_ct1) {
5354
initialize_kernel<block_size>(
@@ -61,12 +62,12 @@ void initialize_kernel(dim3 grid, dim3 block, size_type dynamic_shared_memory,
6162

6263
template <typename ValueType>
6364
void calculate_sin_and_cos_kernel(size_type col_idx, size_type num_cols,
64-
size_type iter, const ValueType &this_hess,
65-
const ValueType &next_hess,
66-
ValueType *givens_sin, size_type stride_sin,
67-
ValueType *givens_cos, size_type stride_cos,
68-
ValueType &register_sin,
69-
ValueType &register_cos)
65+
size_type iter, const ValueType& this_hess,
66+
const ValueType& next_hess,
67+
ValueType* givens_sin, size_type stride_sin,
68+
ValueType* givens_cos, size_type stride_cos,
69+
ValueType& register_sin,
70+
ValueType& register_cos)
7071
{
7172
if (is_zero(this_hess)) {
7273
register_cos = zero<ValueType>();
@@ -89,10 +90,10 @@ void calculate_sin_and_cos_kernel(size_type col_idx, size_type num_cols,
8990
template <typename ValueType>
9091
void calculate_residual_norm_kernel(size_type col_idx, size_type num_cols,
9192
size_type iter,
92-
const ValueType &register_sin,
93-
const ValueType &register_cos,
94-
remove_complex<ValueType> *residual_norm,
95-
ValueType *residual_norm_collection,
93+
const ValueType& register_sin,
94+
const ValueType& register_cos,
95+
remove_complex<ValueType>* residual_norm,
96+
ValueType* residual_norm_collection,
9697
size_type stride_residual_norm_collection)
9798
{
9899
const auto this_rnc =
@@ -112,13 +113,13 @@ void calculate_residual_norm_kernel(size_type col_idx, size_type num_cols,
112113
template <size_type block_size, typename ValueType>
113114
void givens_rotation_kernel(
114115
size_type num_rows, size_type num_cols, size_type iter,
115-
ValueType *__restrict__ hessenberg_iter, size_type stride_hessenberg,
116-
ValueType *__restrict__ givens_sin, size_type stride_sin,
117-
ValueType *__restrict__ givens_cos, size_type stride_cos,
118-
remove_complex<ValueType> *__restrict__ residual_norm,
119-
ValueType *__restrict__ residual_norm_collection,
116+
ValueType* __restrict__ hessenberg_iter, size_type stride_hessenberg,
117+
ValueType* __restrict__ givens_sin, size_type stride_sin,
118+
ValueType* __restrict__ givens_cos, size_type stride_cos,
119+
remove_complex<ValueType>* __restrict__ residual_norm,
120+
ValueType* __restrict__ residual_norm_collection,
120121
size_type stride_residual_norm_collection,
121-
const stopping_status *__restrict__ stop_status, sycl::nd_item<3> item_ct1)
122+
const stopping_status* __restrict__ stop_status, sycl::nd_item<3> item_ct1)
122123
{
123124
const auto col_idx = thread::get_thread_id_flat(item_ct1);
124125

@@ -167,18 +168,18 @@ void givens_rotation_kernel(
167168

168169
template <size_type block_size, typename ValueType>
169170
void givens_rotation_kernel(dim3 grid, dim3 block,
170-
size_type dynamic_shared_memory, sycl::queue *queue,
171+
size_type dynamic_shared_memory, sycl::queue* queue,
171172
size_type num_rows, size_type num_cols,
172-
size_type iter, ValueType *hessenberg_iter,
173-
size_type stride_hessenberg, ValueType *givens_sin,
174-
size_type stride_sin, ValueType *givens_cos,
173+
size_type iter, ValueType* hessenberg_iter,
174+
size_type stride_hessenberg, ValueType* givens_sin,
175+
size_type stride_sin, ValueType* givens_cos,
175176
size_type stride_cos,
176-
remove_complex<ValueType> *residual_norm,
177-
ValueType *residual_norm_collection,
177+
remove_complex<ValueType>* residual_norm,
178+
ValueType* residual_norm_collection,
178179
size_type stride_residual_norm_collection,
179-
const stopping_status *stop_status)
180+
const stopping_status* stop_status)
180181
{
181-
queue->submit([&](sycl::handler &cgh) {
182+
queue->submit([&](sycl::handler& cgh) {
182183
cgh.parallel_for(
183184
sycl_nd_range(grid, block), [=](sycl::nd_item<3> item_ct1) {
184185
givens_rotation_kernel<block_size>(
@@ -195,11 +196,11 @@ void givens_rotation_kernel(dim3 grid, dim3 block,
195196
template <size_type block_size, typename ValueType>
196197
void solve_upper_triangular_kernel(
197198
size_type num_cols, size_type num_rhs,
198-
const ValueType *__restrict__ residual_norm_collection,
199+
const ValueType* __restrict__ residual_norm_collection,
199200
size_type stride_residual_norm_collection,
200-
const ValueType *__restrict__ hessenberg, size_type stride_hessenberg,
201-
ValueType *__restrict__ y, size_type stride_y,
202-
const size_type *__restrict__ final_iter_nums, sycl::nd_item<3> item_ct1)
201+
const ValueType* __restrict__ hessenberg, size_type stride_hessenberg,
202+
ValueType* __restrict__ y, size_type stride_y,
203+
const size_type* __restrict__ final_iter_nums, sycl::nd_item<3> item_ct1)
203204
{
204205
const auto col_idx = thread::get_thread_id_flat(item_ct1);
205206

@@ -225,14 +226,14 @@ void solve_upper_triangular_kernel(
225226

226227
template <size_type block_size, typename ValueType>
227228
void solve_upper_triangular_kernel(
228-
dim3 grid, dim3 block, size_type dynamic_shared_memory, sycl::queue *queue,
229+
dim3 grid, dim3 block, size_type dynamic_shared_memory, sycl::queue* queue,
229230
size_type num_cols, size_type num_rhs,
230-
const ValueType *residual_norm_collection,
231-
size_type stride_residual_norm_collection, const ValueType *hessenberg,
232-
size_type stride_hessenberg, ValueType *y, size_type stride_y,
233-
const size_type *final_iter_nums)
231+
const ValueType* residual_norm_collection,
232+
size_type stride_residual_norm_collection, const ValueType* hessenberg,
233+
size_type stride_hessenberg, ValueType* y, size_type stride_y,
234+
const size_type* final_iter_nums)
234235
{
235-
queue->submit([&](sycl::handler &cgh) {
236+
queue->submit([&](sycl::handler& cgh) {
236237
cgh.parallel_for(
237238
sycl_nd_range(grid, block), [=](sycl::nd_item<3> item_ct1) {
238239
solve_upper_triangular_kernel<block_size>(

examples/kokkos_assembly/kokkos_assembly.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88

99

1010
#include <omp.h>
11-
#include <Kokkos_Core.hpp>
1211
#include <ginkgo/ginkgo.hpp>
12+
#include <Kokkos_Core.hpp>
1313

1414

1515
// Creates a stencil matrix in CSR format for the given number of discretization

include/ginkgo/core/log/papi.hpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@
1616
#include <iostream>
1717
#include <map>
1818
#include <mutex>
19+
20+
1921
#include <sde_lib.h>
2022

2123

0 commit comments

Comments
 (0)