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
Binary file modified tasks/example_processes/data/pic.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 3 additions & 2 deletions tasks/example_processes/tests/functional/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,14 @@ class NesterovARunFuncTestsProcesses : public ppc::util::BaseRunFuncTests<InType
int height = -1;
int channels = -1;
std::vector<uint8_t> img;
// Read image
// Read image in RGB to ensure consistent channel count
{
std::string abs_path = ppc::util::GetAbsoluteTaskPath(PPC_ID_example_processes, "pic.jpg");
auto *data = stbi_load(abs_path.c_str(), &width, &height, &channels, 0);
auto *data = stbi_load(abs_path.c_str(), &width, &height, &channels, STBI_rgb);
if (data == nullptr) {
throw std::runtime_error("Failed to load image: " + std::string(stbi_failure_reason()));
}
channels = STBI_rgb;
img = std::vector<uint8_t>(data, data + (static_cast<ptrdiff_t>(width * height * channels)));
stbi_image_free(data);
if (std::cmp_not_equal(width, height)) {
Expand Down
Binary file modified tasks/example_processes_2/data/pic.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 3 additions & 2 deletions tasks/example_processes_2/tests/functional/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,14 @@ class NesterovARunFuncTestsProcesses2 : public ppc::util::BaseRunFuncTests<InTyp
int height = -1;
int channels = -1;
std::vector<uint8_t> img;
// Read image
// Read image in RGB to ensure consistent channel count
{
std::string abs_path = ppc::util::GetAbsoluteTaskPath(PPC_ID_example_processes_2, "pic.jpg");
auto *data = stbi_load(abs_path.c_str(), &width, &height, &channels, 0);
auto *data = stbi_load(abs_path.c_str(), &width, &height, &channels, STBI_rgb);
if (data == nullptr) {
throw std::runtime_error("Failed to load image: " + std::string(stbi_failure_reason()));
}
channels = STBI_rgb;
img = std::vector<uint8_t>(data, data + (static_cast<ptrdiff_t>(width * height * channels)));
stbi_image_free(data);
if (std::cmp_not_equal(width, height)) {
Expand Down
Binary file modified tasks/example_processes_3/data/pic.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 3 additions & 2 deletions tasks/example_processes_3/tests/functional/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,14 @@ class NesterovARunFuncTestsProcesses3 : public ppc::util::BaseRunFuncTests<InTyp
int height = -1;
int channels = -1;
std::vector<uint8_t> img;
// Read image
// Read image in RGB to ensure consistent channel count
{
std::string abs_path = ppc::util::GetAbsoluteTaskPath(PPC_ID_example_processes_3, "pic.jpg");
auto *data = stbi_load(abs_path.c_str(), &width, &height, &channels, 0);
auto *data = stbi_load(abs_path.c_str(), &width, &height, &channels, STBI_rgb);
if (data == nullptr) {
throw std::runtime_error("Failed to load image: " + std::string(stbi_failure_reason()));
}
channels = STBI_rgb;
img = std::vector<uint8_t>(data, data + (static_cast<ptrdiff_t>(width * height * channels)));
stbi_image_free(data);
if (std::cmp_not_equal(width, height)) {
Expand Down
Binary file modified tasks/example_threads/data/pic.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 4 additions & 4 deletions tasks/example_threads/tests/functional/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,14 @@ class NesterovARunFuncTestsThreads : public ppc::util::BaseRunFuncTests<InType,
int height = -1;
int channels = -1;
std::vector<uint8_t> img;
// Read image
// Read image in RGB to ensure consistent channel count
{
std::string abs_path = ppc::util::GetAbsoluteTaskPath(std::string(PPC_ID_example_threads), "pic.jpg");
auto *data = stbi_load(abs_path.c_str(), &width, &height, &channels, 0);
auto *data = stbi_load(abs_path.c_str(), &width, &height, &channels, STBI_rgb);
if (data == nullptr) {
throw std::runtime_error("Failed to load image: " + std::string(stbi_failure_reason()));
}
channels = STBI_rgb;
img = std::vector<uint8_t>(data, data + (static_cast<ptrdiff_t>(width * height * channels)));
stbi_image_free(data);
if (std::cmp_not_equal(width, height)) {
Expand All @@ -67,8 +68,7 @@ class NesterovARunFuncTestsThreads : public ppc::util::BaseRunFuncTests<InType,

namespace {

// TODO(allnes): Fix & enable back this test
TEST_P(NesterovARunFuncTestsThreads, DISABLED_MatmulFromPic) {
TEST_P(NesterovARunFuncTestsThreads, MatmulFromPic) {
ExecuteTest(GetParam());
}

Expand Down
Loading