Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .clang-tidy
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ Checks: >
readability-*,
-bugprone-casting-through-void,
-bugprone-easily-swappable-parameters,
-bugprone-implicit-widening-of-multiplication-result,
-cppcoreguidelines-avoid-magic-numbers,
-cppcoreguidelines-non-private-member-variables-in-classes,
-cppcoreguidelines-owning-memory,
Expand Down
15 changes: 8 additions & 7 deletions tasks/all/example/func_tests/main.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#include <gtest/gtest.h>

#include <cstddef>
#include <cstdint>
#include <stb_library.hpp>
#include <string>
Expand All @@ -15,7 +16,7 @@ class NesterovATestTaskAll : public ::testing::TestWithParam<int> {
std::string abs_path = ppc::util::GetAbsolutePath("all/example/data/pic_all.jpg");
data = stbi_load(abs_path.c_str(), &width, &height, &channels, 0);
ASSERT_TRUE(data != nullptr) << "Failed to load image: " << stbi_failure_reason();
img = std::vector<uint8_t>(data, data + (width * height * channels));
img = std::vector<uint8_t>(data, data + (static_cast<size_t>(width) * height * channels));
stbi_image_free(data);

ASSERT_EQ(width, height);
Expand All @@ -28,10 +29,10 @@ class NesterovATestTaskAll : public ::testing::TestWithParam<int> {

TEST_P(NesterovATestTaskAll, MatmulFromPic) {
int divider = GetParam();
const int k_count = (width + height) / divider;
const size_t k_count = (width + height) / divider;

std::vector<int> in(k_count * k_count, 0);
for (int i = 0; i < k_count; i++) {
for (size_t i = 0; i < k_count; i++) {
in[(i * k_count) + i] = 1;
}

Expand All @@ -45,10 +46,10 @@ TEST_P(NesterovATestTaskAll, MatmulFromPic) {

TEST_P(NesterovATestTaskAll, MatMulUtilFromPic) {
int divider = GetParam();
const int k_count = (width + height) / divider;
const size_t k_count = (width + height) / divider;

std::vector<int> in(k_count * k_count, 0);
for (int i = 0; i < k_count; i++) {
for (size_t i = 0; i < k_count; i++) {
in[(i * k_count) + i] = 1;
}
std::vector<int> out(k_count * k_count, 0);
Expand All @@ -59,10 +60,10 @@ TEST_P(NesterovATestTaskAll, MatMulUtilFromPic) {

TEST_P(NesterovATestTaskAll, MatMulTBBUtilFromPic) {
int divider = GetParam();
const int k_count = (width + height) / divider;
const size_t k_count = (width + height) / divider;

std::vector<int> in(k_count * k_count, 0);
for (int i = 0; i < k_count; i++) {
for (size_t i = 0; i < k_count; i++) {
in[(i * k_count) + i] = 1;
}
std::vector<int> out(k_count * k_count, 0);
Expand Down
5 changes: 3 additions & 2 deletions tasks/all/example/perf_tests/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
#include <mpi.h>

#include <chrono>
#include <cstddef>
#include <memory>
#include <vector>

Expand All @@ -11,12 +12,12 @@

class NesterovAllRunTest : public ::testing::TestWithParam<ppc::core::PerfResults::TypeOfRunning> {
protected:
static constexpr int kCount = 400;
static constexpr size_t kCount = 400;
std::vector<int> input_data;

void SetUp() override {
input_data.assign(kCount * kCount, 0);
for (int i = 0; i < kCount; ++i) {
for (size_t i = 0; i < kCount; ++i) {
input_data[(i * kCount) + i] = 1;
}
}
Expand Down
2 changes: 1 addition & 1 deletion tasks/mpi/example/perf_tests/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
class NesterovATaskMPITest : public ::testing::TestWithParam<ppc::core::PerfResults::TypeOfRunning> {
protected:
static void RunTest(ppc::core::PerfResults::TypeOfRunning mode) {
constexpr int kCount = 500;
constexpr size_t kCount = 500;

// Create data
std::vector<int> in(kCount * kCount, 0);
Expand Down
2 changes: 1 addition & 1 deletion tasks/omp/example/perf_tests/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
class NesterovTaskOMPTest : public ::testing::TestWithParam<ppc::core::PerfResults::TypeOfRunning> {
protected:
static void RunTest(ppc::core::PerfResults::TypeOfRunning mode) {
constexpr int kCount = 300;
constexpr size_t kCount = 300;

// Create data
std::vector<int> in(kCount * kCount, 0);
Expand Down
2 changes: 1 addition & 1 deletion tasks/seq/example/perf_tests/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
class NesterovTaskSeqTest : public ::testing::TestWithParam<ppc::core::PerfResults::TypeOfRunning> {
protected:
static void RunTest(ppc::core::PerfResults::TypeOfRunning mode) {
constexpr int kCount = 500;
constexpr size_t kCount = 500;

// Create data
std::vector<int> in(kCount * kCount, 0);
Expand Down
2 changes: 1 addition & 1 deletion tasks/stl/example/perf_tests/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
class NesterovTaskSTLTest : public ::testing::TestWithParam<ppc::core::PerfResults::TypeOfRunning> {
protected:
static void RunTest(ppc::core::PerfResults::TypeOfRunning mode) {
constexpr int kCount = 450;
constexpr size_t kCount = 450;

// Create data
std::vector<int> in(kCount * kCount, 0);
Expand Down
2 changes: 1 addition & 1 deletion tasks/tbb/example/perf_tests/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
class NesterovTaskTBBTest : public ::testing::TestWithParam<ppc::core::PerfResults::TypeOfRunning> {
protected:
static void RunTest(ppc::core::PerfResults::TypeOfRunning mode) {
constexpr int kCount = 450;
constexpr size_t kCount = 450;

// Create data
std::vector<int> in(kCount * kCount, 0);
Expand Down