Skip to content

Commit a61d117

Browse files
committed
clang-format
1 parent 20309ba commit a61d117

File tree

23 files changed

+74
-78
lines changed

23 files changed

+74
-78
lines changed

modules/core/util/util.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ inline int GetPPCNumThreads() {
2424
omp_env[0] = '\0';
2525
}
2626
#else
27-
const char* omp_env = std::getenv("OMP_NUM_THREADS");
27+
const char *omp_env = std::getenv("OMP_NUM_THREADS");
2828
#endif
2929
int num_threads = (omp_env != nullptr) ? std::atoi(omp_env) : 1;
3030
return num_threads;

tasks/all/example/func_tests/func_all.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,12 @@
88

99
TEST(nesterov_a_test_task_all, test_matmul_50) {
1010
const size_t count = 50;
11-
11+
1212
// Create data
1313
std::vector<int> in(count * count, 0);
1414
std::vector<int> out(count * count, 0);
1515

16-
for(size_t i = 0; i < count; i++) {
16+
for (size_t i = 0; i < count; i++) {
1717
in[(i * count) + i] = 1;
1818
}
1919

@@ -42,7 +42,7 @@ TEST(nesterov_a_test_task_all, test_matmul_from_pic) {
4242
std::vector<int> in(count * count, 0);
4343
std::vector<int> out(count * count, 0);
4444

45-
for(int i = 0; i < count; i++) {
45+
for (int i = 0; i < count; i++) {
4646
in[(i * count) + i] = 1;
4747
}
4848

tasks/all/example/include/ops_all.hpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
#pragma once
22

3+
#include <tbb/tbb.h>
4+
5+
#include <boost/mpi/collectives.hpp>
6+
#include <boost/mpi/communicator.hpp>
37
#include <string>
48
#include <vector>
59

610
#include "core/task/include/task.hpp"
711

8-
#include <boost/mpi/collectives.hpp>
9-
#include <boost/mpi/communicator.hpp>
10-
#include <tbb/tbb.h>
11-
1212
namespace nesterov_a_test_task_all {
1313

1414
class TestTaskALL : public ppc::core::Task {
@@ -25,4 +25,4 @@ class TestTaskALL : public ppc::core::Task {
2525
boost::mpi::communicator world_;
2626
};
2727

28-
} // namespace nesterov_a_test_task_all
28+
} // namespace nesterov_a_test_task_all

tasks/all/example/perf_tests/perf_all.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,17 @@
33
#include <boost/mpi/timer.hpp>
44
#include <vector>
55

6-
#include "core/perf/include/perf.hpp"
76
#include "all/example/include/ops_all.hpp"
7+
#include "core/perf/include/perf.hpp"
88

99
TEST(nesterov_a_test_task_all, test_pipeline_run) {
1010
const int count = 900;
11-
11+
1212
// Create data
1313
std::vector<int> in(count * count, 0);
1414
std::vector<int> out(count * count, 0);
1515

16-
for(size_t i = 0; i < count; i++) {
16+
for (size_t i = 0; i < count; i++) {
1717
in[(i * count) + i] = 1;
1818
}
1919

@@ -58,7 +58,7 @@ TEST(nesterov_a_test_task_all, test_task_run) {
5858
std::vector<int> in(count * count, 0);
5959
std::vector<int> out(count * count, 0);
6060

61-
for(size_t i = 0; i < count; i++) {
61+
for (size_t i = 0; i < count; i++) {
6262
in[(i * count) + i] = 1;
6363
}
6464

tasks/all/example/src/ops_all.cpp

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ bool nesterov_a_test_task_all::TestTaskALL::PreProcessingImpl() {
3030
unsigned int input_size = task_data->inputs_count[0];
3131
auto *in_ptr = reinterpret_cast<int *>(task_data->inputs[0]);
3232
input_ = std::vector<int>(in_ptr, in_ptr + input_size);
33-
33+
3434
unsigned int output_size = task_data->outputs_count[0];
3535
output_ = std::vector<int>(output_size, 0);
3636

@@ -46,9 +46,7 @@ bool nesterov_a_test_task_all::TestTaskALL::ValidationImpl() {
4646
bool nesterov_a_test_task_all::TestTaskALL::RunImpl() {
4747
if (world_.rank() == 0) {
4848
#pragma omp parallel
49-
{
50-
MatMul(input_, rc_size_, output_);
51-
}
49+
{ MatMul(input_, rc_size_, output_); }
5250
} else if (world_.rank() == 1) {
5351
const int num_threads = ppc::util::GetPPCNumThreads();
5452
std::vector<std::thread> threads(num_threads);
@@ -58,9 +56,7 @@ bool nesterov_a_test_task_all::TestTaskALL::RunImpl() {
5856
}
5957
} else if (world_.rank() == 2) {
6058
oneapi::tbb::task_arena arena;
61-
arena.execute([&] {
62-
MatMul(input_, rc_size_, output_);
63-
});
59+
arena.execute([&] { MatMul(input_, rc_size_, output_); });
6460
} else {
6561
MatMulElse(input_, rc_size_, output_);
6662
}

tasks/mpi/example/func_tests/main.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,12 @@
88

99
TEST(nesterov_a_test_task_mpi, test_matmul_50) {
1010
const size_t count = 50;
11-
11+
1212
// Create data
1313
std::vector<int> in(count * count, 0);
1414
std::vector<int> out(count * count, 0);
1515

16-
for(size_t i = 0; i < count; i++) {
16+
for (size_t i = 0; i < count; i++) {
1717
in[(i * count) + i] = 1;
1818
}
1919

@@ -48,7 +48,7 @@ TEST(nesterov_a_test_task_mpi, test_matmul_100_from_file) {
4848
std::vector<int> in(count * count, 0);
4949
std::vector<int> out(count * count, 0);
5050

51-
for(size_t i = 0; i < count; i++) {
51+
for (size_t i = 0; i < count; i++) {
5252
in[(i * count) + i] = 1;
5353
}
5454

tasks/mpi/example/perf_tests/main.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,12 @@
88

99
TEST(nesterov_a_test_task_mpi, test_pipeline_run) {
1010
const int count = 500;
11-
11+
1212
// Create data
1313
std::vector<int> in(count * count, 0);
1414
std::vector<int> out(count * count, 0);
1515

16-
for(size_t i = 0; i < count; i++) {
16+
for (size_t i = 0; i < count; i++) {
1717
in[(i * count) + i] = 1;
1818
}
1919

@@ -58,7 +58,7 @@ TEST(nesterov_a_test_task_mpi, test_task_run) {
5858
std::vector<int> in(count * count, 0);
5959
std::vector<int> out(count * count, 0);
6060

61-
for(size_t i = 0; i < count; i++) {
61+
for (size_t i = 0; i < count; i++) {
6262
in[(i * count) + i] = 1;
6363
}
6464

tasks/omp/example/func_tests/main.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,12 @@
88

99
TEST(nesterov_a_test_task_omp, test_matmul_50) {
1010
const size_t count = 50;
11-
11+
1212
// Create data
1313
std::vector<int> in(count * count, 0);
1414
std::vector<int> out(count * count, 0);
1515

16-
for(size_t i = 0; i < count; i++) {
16+
for (size_t i = 0; i < count; i++) {
1717
in[(i * count) + i] = 1;
1818
}
1919

@@ -47,7 +47,7 @@ TEST(nesterov_a_test_task_omp, test_matmul_100_from_file) {
4747
std::vector<int> in(count * count, 0);
4848
std::vector<int> out(count * count, 0);
4949

50-
for(size_t i = 0; i < count; i++) {
50+
for (size_t i = 0; i < count; i++) {
5151
in[(i * count) + i] = 1;
5252
}
5353

tasks/omp/example/perf_tests/main.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,12 @@
88

99
TEST(nesterov_a_test_task_omp, test_pipeline_run) {
1010
const int count = 500;
11-
11+
1212
// Create data
1313
std::vector<int> in(count * count, 0);
1414
std::vector<int> out(count * count, 0);
1515

16-
for(size_t i = 0; i < count; i++) {
16+
for (size_t i = 0; i < count; i++) {
1717
in[(i * count) + i] = 1;
1818
}
1919

@@ -54,7 +54,7 @@ TEST(nesterov_a_test_task_omp, test_task_run) {
5454
std::vector<int> in(count * count, 0);
5555
std::vector<int> out(count * count, 0);
5656

57-
for(size_t i = 0; i < count; i++) {
57+
for (size_t i = 0; i < count; i++) {
5858
in[(i * count) + i] = 1;
5959
}
6060

tasks/omp/example/src/ops_omp.cpp

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,12 @@
88
bool nesterov_a_test_task_omp::TestTaskOpenMP::PreProcessingImpl() {
99
// Init value for input and output
1010
unsigned int input_size = task_data->inputs_count[0];
11-
auto *in_ptr = reinterpret_cast<int*>(task_data->inputs[0]);
11+
auto *in_ptr = reinterpret_cast<int *>(task_data->inputs[0]);
1212
input_ = std::vector<int>(in_ptr, in_ptr + input_size);
13-
13+
1414
unsigned int output_size = task_data->outputs_count[0];
1515
output_ = std::vector<int>(output_size, 0);
16-
16+
1717
rc_size_ = static_cast<int>(sqrt(input_size));
1818
return true;
1919
}
@@ -25,16 +25,16 @@ bool nesterov_a_test_task_omp::TestTaskOpenMP::ValidationImpl() {
2525

2626
bool nesterov_a_test_task_omp::TestTaskOpenMP::RunImpl() {
2727
#pragma omp parallel
28-
{
29-
// Multiply matrices
30-
for (int i = 0; i < rc_size_; ++i) {
31-
for (int j = 0; j < rc_size_; ++j) {
32-
for (int k = 0; k < rc_size_; ++k) {
33-
output_[(i * rc_size_) + j] += input_[(i * rc_size_) + k] * input_[(k * rc_size_) + j];
28+
{
29+
// Multiply matrices
30+
for (int i = 0; i < rc_size_; ++i) {
31+
for (int j = 0; j < rc_size_; ++j) {
32+
for (int k = 0; k < rc_size_; ++k) {
33+
output_[(i * rc_size_) + j] += input_[(i * rc_size_) + k] * input_[(k * rc_size_) + j];
34+
}
3435
}
3536
}
3637
}
37-
}
3838
return true;
3939
}
4040

0 commit comments

Comments
 (0)