Skip to content

Commit 9d8e567

Browse files
committed
Fix formatting
1 parent 7e874d8 commit 9d8e567

File tree

1 file changed

+7
-9
lines changed

1 file changed

+7
-9
lines changed

src/example7.cpp

+7-9
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
#include <dr/mp.hpp>
66
#include <fmt/core.h>
77

8-
98
/* Sparse band matrix vector multiplication */
109
int main() {
1110
dr::mp::init(sycl::default_selector_v);
@@ -14,10 +13,10 @@ int main() {
1413
dr::views::csr_matrix_view<V, I> local_data;
1514
auto root = 0;
1615
auto n = 10;
17-
auto up = 1; // number of diagonals above main diagonal
16+
auto up = 1; // number of diagonals above main diagonal
1817
auto down = up; // number of diagonals below main diagonal
1918
if (root == dr::mp::rank()) {
20-
local_data = dr::generate_band_csr<V, I>(n, up, down);
19+
local_data = dr::generate_band_csr<V, I>(n, up, down);
2120
}
2221

2322
dr::mp::distributed_sparse_matrix<
@@ -34,23 +33,22 @@ int main() {
3433

3534
dr::mp::broadcasted_vector<double> broadcasted_b;
3635
broadcasted_b.broadcast_data(matrix.shape().second, 0, b,
37-
dr::mp::default_comm());
36+
dr::mp::default_comm());
3837

3938
gemv(root, res, matrix, broadcasted_b);
4039

4140
if (root == dr::mp::rank()) {
4241
fmt::print("Band matrix {} x {} with bandwitch {}\n", n, n, up * 2);
4342
fmt::print("Input: ");
44-
for (auto x: b) {
45-
fmt::print("{} ", x);
43+
for (auto x : b) {
44+
fmt::print("{} ", x);
4645
}
4746
fmt::print("\n");
4847
fmt::print("Matrix vector multiplication res: ");
49-
for (auto x: res) {
50-
fmt::print("{} ", x);
48+
for (auto x : res) {
49+
fmt::print("{} ", x);
5150
}
5251
fmt::print("\n");
53-
5452
}
5553

5654
dr::mp::finalize();

0 commit comments

Comments
 (0)