From 7953558272cf18d9aa36dc202b638b44b9bbb208 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 3 Apr 2023 14:32:53 +0200 Subject: [PATCH 1/8] Creating files & implementing funtions --- clic/include/core/clesperanto.hpp | 3 ++ clic/include/tier1/cleLaplaceBoxKernel.hpp | 32 ++++++++++++++++++++++ 2 files changed, 35 insertions(+) create mode 100644 clic/include/tier1/cleLaplaceBoxKernel.hpp diff --git a/clic/include/core/clesperanto.hpp b/clic/include/core/clesperanto.hpp index c1fc8561e..9e9136668 100644 --- a/clic/include/core/clesperanto.hpp +++ b/clic/include/core/clesperanto.hpp @@ -177,6 +177,9 @@ class Clesperanto const float & min_intensity = FloatLimits::infinity(), const float & max_intensity = FloatLimits::infinity()) -> void; + auto + LaplaceBox(const Image & source, const Image & destination) -> void; + auto Mask(const Image & source, const Image & t_mask, const Image & destination) -> void; diff --git a/clic/include/tier1/cleLaplaceBoxKernel.hpp b/clic/include/tier1/cleLaplaceBoxKernel.hpp new file mode 100644 index 000000000..2f2203bd8 --- /dev/null +++ b/clic/include/tier1/cleLaplaceBoxKernel.hpp @@ -0,0 +1,32 @@ + + +#ifndef __TIER1_CLELAPLACEBOXKERNEL_HPP +#define __TIER1_CLELAPLACEBOXKERNEL_HPP + +#include "cleOperation.hpp" + +namespace cle +{ + +class LaplaceBoxKernel : public Operation +{ +public: + explicit LaplaceBoxKernel(const ProcessorPointer & device); + auto + SetInput(const Image & object) -> void; + auto + SetOutput(const Image & object) -> void; +}; + +inline auto +LaplaceBoxKernel_Call(const std::shared_ptr & device, const Image & src, const Image & dst) -> void +{ + LaplaceBoxKernel kernel(device); + kernel.SetInput(src); + kernel.SetOutput(dst); + kernel.Execute(); +} + +} // namespace cle + +#endif // __TIER1_CLELAPLACEBOXKERNEL_HPP \ No newline at end of file From e6055a683996be93285a00c87928b60fc567431e Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 3 Apr 2023 14:34:52 +0200 Subject: [PATCH 2/8] Creating cpp file & implementing functions --- clic/src/core/clesperanto.cpp | 6 ++++++ clic/src/tier1/cleLaplaceBoxKernel.cpp | 28 ++++++++++++++++++++++++++ 2 files changed, 34 insertions(+) create mode 100644 clic/src/tier1/cleLaplaceBoxKernel.cpp diff --git a/clic/src/core/clesperanto.cpp b/clic/src/core/clesperanto.cpp index 94b21cb8e..3ed498ceb 100644 --- a/clic/src/core/clesperanto.cpp +++ b/clic/src/core/clesperanto.cpp @@ -289,6 +289,12 @@ Clesperanto::GreaterOrEqualConstant(const Image & source, const Image & destinat kernel.Execute(); } +auto +Clesperanto::LaplaceBox(const Image & source, const Image & destination) -> void +{ + LaplaceBoxKernel_Call(this->GetDevice(), source, destination); +} + auto Clesperanto::Mask(const Image & source, const Image & t_mask, const Image & destination) -> void { diff --git a/clic/src/tier1/cleLaplaceBoxKernel.cpp b/clic/src/tier1/cleLaplaceBoxKernel.cpp new file mode 100644 index 000000000..f46a4ecba --- /dev/null +++ b/clic/src/tier1/cleLaplaceBoxKernel.cpp @@ -0,0 +1,28 @@ + +#include "cleLaplaceBoxKernel.hpp" + +namespace cle +{ + +LaplaceBoxKernel::LaplaceBoxKernel(const ProcessorPointer & device) + : Operation(device, 2) +{ + std::string cl_header = { +#include "cle_laplace_box.h" + }; + this->SetSource("laplace_box", cl_header); +} + +auto +LaplaceBoxKernel::SetInput(const Image & object) -> void +{ + this->AddParameter("src", object); +} + +auto +LaplaceBoxKernel::SetOutput(const Image & object) -> void +{ + this->AddParameter("dst", object); +} + +} // namespace cle \ No newline at end of file From 76ba4a8a6cc7e1a41fc074e2cfd7d4253805cba7 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 3 Apr 2023 14:37:57 +0200 Subject: [PATCH 3/8] Adding tests --- tests/CMakeLists.txt | 8 +++ tests/laplace_box_test.cpp | 102 +++++++++++++++++++++++++++++++++++++ 2 files changed, 110 insertions(+) create mode 100644 tests/laplace_box_test.cpp diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index e16fcd5e3..927046683 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -208,6 +208,12 @@ target_link_libraries(histogram_test PRIVATE CLIc::CLIc) set_target_properties(histogram_test PROPERTIES FOLDER "Tests") # target_compile_features(histogram_test PRIVATE cxx_std_17) +add_executable(laplace_box_test laplace_box_test.cpp) +add_dependencies(laplace_box_test CLIc) +target_link_libraries(laplace_box_test PRIVATE CLIc::CLIc) +set_target_properties(laplace_box_test PROPERTIES FOLDER "Tests") +# target_compile_features(laplace_box_test PRIVATE cxx_std_17) + add_executable(mask_test mask_test.cpp) add_dependencies(mask_test CLIc) target_link_libraries(mask_test PRIVATE CLIc::CLIc) @@ -492,6 +498,7 @@ add_test(NAME greater_or_equal_constant_test WORKING_DIRECTORY ${CMAKE_CURRENT_B add_test(NAME greater_or_equal_test WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} COMMAND greater_or_equal_test) add_test(NAME greater_test WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} COMMAND greater_test) add_test(NAME histogram_test WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} COMMAND histogram_test) +add_test(NAME laplace_box_test WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} COMMAND laplace_box_test) add_test(NAME mask_test WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} COMMAND mask_test) add_test(NAME masked_voronoi_labeling_test WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} COMMAND masked_voronoi_labeling_test) add_test(NAME maximum_all_pixels_test WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} COMMAND maximum_all_pixels_test) @@ -571,6 +578,7 @@ set_tests_properties(absolute_test greater_or_equal_test greater_test histogram_test + laplace_box_test mask_test masked_voronoi_labeling_test maximum_all_pixels_test diff --git a/tests/laplace_box_test.cpp b/tests/laplace_box_test.cpp new file mode 100644 index 000000000..df0273075 --- /dev/null +++ b/tests/laplace_box_test.cpp @@ -0,0 +1,102 @@ + + +#include "clesperanto.hpp" + +template +auto +run_test(const std::array & shape, const cle::MemoryType & mem_type) -> bool +{ + std::vector input(shape[0] * shape[1] * shape[2]); + std::vector valid(shape[0] * shape[1] * shape[2]); + + if (shape[2] > 1) + { + input = { 0, 1, 2, 3, 0, 1, 2, 3, 0, 1, 2, 3, 1, 2, 3, 0, 1, 2 }; + valid = { -34, -29, -24, -20, -39, -30, -21, -20, -47, -27, -26, -25, -29, -32, -35, -27, -34, -41 }; + } + else if (shape[1] > 1) + { + input = { 0, 1, 2, 3, 0, 1, 0, 1, 2, 3, 0, 1 }; + valid = { -3, -4, -8, -9, -9, -6, -12, -9, -9, -2, -10, -3 }; + } + else + { + input = { 0, -1, -2, 3, -2 }; + valid = { 1, 2, -2, 4, -1 }; + } + + cle::Clesperanto cle; + cle.GetDevice()->WaitForKernelToFinish(); + auto gpu_input = cle.Push(input, shape, mem_type); + auto gpu_output = cle.Create(shape, mem_type); + cle.LaplaceBox(gpu_input, gpu_output); + auto output = cle.Pull(gpu_output); + + return std::equal(output.begin(), output.end(), valid.begin()); +} + +auto +main(int argc, char ** argv) -> int +{ + if (!run_test({ 5, 1, 1 }, cle::BUFFER)) + { + return EXIT_FAILURE; + } + + if (!run_test({ 5, 1, 1 }, cle::BUFFER)) + { + return EXIT_FAILURE; + } + + if (!run_test({ 5, 1, 1 }, cle::BUFFER)) + { + return EXIT_FAILURE; + } + + if (!run_test({ 5, 1, 1 }, cle::BUFFER)) + { + return EXIT_FAILURE; + } + + if (!run_test({ 4, 3, 1 }, cle::BUFFER)) + { + return EXIT_FAILURE; + } + + if (!run_test({ 4, 3, 1 }, cle::BUFFER)) + { + return EXIT_FAILURE; + } + + if (!run_test({ 4, 3, 1 }, cle::BUFFER)) + { + return EXIT_FAILURE; + } + + if (!run_test({ 4, 3, 1 }, cle::BUFFER)) + { + return EXIT_FAILURE; + } + + if (!run_test({ 3, 2, 3 }, cle::BUFFER)) + { + return EXIT_FAILURE; + } + + if (!run_test({ 3, 2, 3 }, cle::BUFFER)) + { + return EXIT_FAILURE; + } + + if (!run_test({ 3, 2, 3 }, cle::BUFFER)) + { + return EXIT_FAILURE; + } + + if (!run_test({ 3, 2, 3 }, cle::BUFFER)) + { + return EXIT_FAILURE; + } + + return EXIT_SUCCESS; +} \ No newline at end of file From 93ebf2cb81efbf6190f2e7c64a647cee241ab45d Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 12 Apr 2023 15:07:14 +0200 Subject: [PATCH 4/8] test modification --- tests/laplace_box_test.cpp | 144 +++++++++++++++++++++++++++++++++---- 1 file changed, 130 insertions(+), 14 deletions(-) diff --git a/tests/laplace_box_test.cpp b/tests/laplace_box_test.cpp index df0273075..3a4a5b13b 100644 --- a/tests/laplace_box_test.cpp +++ b/tests/laplace_box_test.cpp @@ -11,18 +11,129 @@ run_test(const std::array & shape, const cle::MemoryType & mem_type) if (shape[2] > 1) { - input = { 0, 1, 2, 3, 0, 1, 2, 3, 0, 1, 2, 3, 1, 2, 3, 0, 1, 2 }; - valid = { -34, -29, -24, -20, -39, -30, -21, -20, -47, -27, -26, -25, -29, -32, -35, -27, -34, -41 }; + input = { 1, 0, 2, 1, 0, 1, 0, 3, 0, 2, 0, 1, 3, 0, 0, 1, 0, 1, 1, 0, 2, 0, 2, 1 }; + valid = { 3, -4, 11, 0, -2, 3, -7, 16, -4, 11, -5, 2, 17, -4, -4, 5, -6, 4, 3, -6, 12, -7, 10, 3 }; + + // Below is the CPU version + // The input is extended by filling values beyond the edges with the same constant value (0) + + // int height = shape[0]; + // int width = shape[1]; + // int depth = shape[2]; + + // std::vector kernel = { 0, 0, 0, 0, -1, 0, 0, 0, 0, 0, -1, 0, -1, 6, -1, 0, -1, 0, 0, 0, 0, 0, -1, 0, 0, 0, 0 }; + + // int padding = 1; + // int padded_height = height + 2 * padding; + // int padded_width = width + 2 * padding; + // int padded_depth = depth + 2 * padding; + + // std::vector input_padded(padded_height * padded_width * padded_depth); + + // for (int k = padding; k < depth + padding; k++) + // { + // for (int i = padding; i < height + padding; i++) + // { + // for (int j = padding; j < width + padding; j++) + // { + // input_padded[(k * padded_height + i) * padded_width + j] = + // input[((k - padding) * height + i - padding) * width + (j - padding)]; + // } + // } + // } + + // for (int k = padding; k < depth + padding; k++) + // { + // for (int i = padding; i < height + padding; i++) + // { + // for (int j = padding; j < width + padding; j++) + // { + // int sum = 0; + // for (int m = -padding; m <= padding; m++) + // { + // for (int n = -padding; n <= padding; n++) + // { + // for (int p = -padding; p <= padding; p++) + // { + // sum += kernel[((m + padding) * (2 * padding + 1) + (n + padding)) * (2 * padding + 1) + (p + + // padding)] * + // input_padded[((k + m) * padded_height + i + n) * padded_width + (j + p)]; + // } + // } + // } + // valid[((k - padding) * height + i - padding) * width + (j - padding)] = sum; + // } + // } + // } } else if (shape[1] > 1) { - input = { 0, 1, 2, 3, 0, 1, 0, 1, 2, 3, 0, 1 }; - valid = { -3, -4, -8, -9, -9, -6, -12, -9, -9, -2, -10, -3 }; + input = { 1, 0, 2, 1, 0, 1, 3, 1, 0, 2, 1, 1 }; + valid = { 7, -7, 10, 2, -4, -1, 15, 0, -3, 11, 0, 3 }; + + // Below is the CPU version + // The input is extended by filling values beyond the edges with the same constant value (0) + + // int height = shape[0]; + // int width = shape[1]; + + // std::vector kernel = { -1, -1, -1, -1, 8, -1, -1, -1, -1 }; + + // int padding = 1; + // int padded_height = height + 2 * padding; + // int padded_width = width + 2 * padding; + // std::vector input_padded(padded_height * padded_width); + + // for (int i = padding; i < height + padding; i++) + // { + // for (int j = padding; j < width + padding; j++) + // { + // input_padded[i * padded_width + j] = input[(i - padding) * width + (j - padding)]; + // } + // } + + // for (int i = padding; i < height + padding; i++) + // { + // for (int j = padding; j < width + padding; j++) + // { + // int sum = 0; + // for (int k = -padding; k <= padding; k++) + // { + // for (int l = -padding; l <= padding; l++) + // { + // sum += + // kernel[(k + padding) * (2 * padding + 1) + l + padding] * input_padded[(i + k) * padded_width + (j + + // l)]; + // } + // } + // valid[(i - padding) * width + (j - padding)] = sum; + // } + // } } else { - input = { 0, -1, -2, 3, -2 }; - valid = { 1, 2, -2, 4, -1 }; + input = { 1, 0, 0, 1, 1 }; + valid = { 2, -1, -1, 1, 1 }; + + // Below is the CPU version + // The input is extended by filling values beyond the edges with the same constant value (0) + + // std::vector kernel = { -1, 2, -1 }; + + // int padding = kernel.size() / 2; + + // std::vector input_padded(input.size() + 2 * padding); + // std::copy(input.begin(), input.end(), input_padded.begin() + padding); + + // for (int i = padding; i < input.size() + padding; i++) + // { + // int sum = 0; + // for (int j = 0; j < kernel.size(); j++) + // { + // sum += kernel[j] * input_padded[i - padding + j]; + // } + // valid[i - padding] = sum; + // } } cle::Clesperanto cle; @@ -43,6 +154,11 @@ main(int argc, char ** argv) -> int return EXIT_FAILURE; } + if (!run_test({ 5, 1, 1 }, cle::BUFFER)) + { + return EXIT_FAILURE; + } + if (!run_test({ 5, 1, 1 }, cle::BUFFER)) { return EXIT_FAILURE; @@ -58,42 +174,42 @@ main(int argc, char ** argv) -> int return EXIT_FAILURE; } - if (!run_test({ 4, 3, 1 }, cle::BUFFER)) + if (!run_test({ 3, 4, 1 }, cle::BUFFER)) { return EXIT_FAILURE; } - if (!run_test({ 4, 3, 1 }, cle::BUFFER)) + if (!run_test({ 3, 4, 1 }, cle::BUFFER)) { return EXIT_FAILURE; } - if (!run_test({ 4, 3, 1 }, cle::BUFFER)) + if (!run_test({ 3, 4, 1 }, cle::BUFFER)) { return EXIT_FAILURE; } - if (!run_test({ 4, 3, 1 }, cle::BUFFER)) + if (!run_test({ 3, 4, 1 }, cle::BUFFER)) { return EXIT_FAILURE; } - if (!run_test({ 3, 2, 3 }, cle::BUFFER)) + if (!run_test({ 3, 4, 2 }, cle::BUFFER)) { return EXIT_FAILURE; } - if (!run_test({ 3, 2, 3 }, cle::BUFFER)) + if (!run_test({ 3, 4, 2 }, cle::BUFFER)) { return EXIT_FAILURE; } - if (!run_test({ 3, 2, 3 }, cle::BUFFER)) + if (!run_test({ 3, 4, 2 }, cle::BUFFER)) { return EXIT_FAILURE; } - if (!run_test({ 3, 2, 3 }, cle::BUFFER)) + if (!run_test({ 3, 4, 2 }, cle::BUFFER)) { return EXIT_FAILURE; } From 5302d42dff0001afbea818d94d316dd1037919fb Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 12 Apr 2023 15:20:05 +0200 Subject: [PATCH 5/8] formatting the code --- tests/laplace_box_test.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/laplace_box_test.cpp b/tests/laplace_box_test.cpp index 3a4a5b13b..15b16b312 100644 --- a/tests/laplace_box_test.cpp +++ b/tests/laplace_box_test.cpp @@ -21,7 +21,8 @@ run_test(const std::array & shape, const cle::MemoryType & mem_type) // int width = shape[1]; // int depth = shape[2]; - // std::vector kernel = { 0, 0, 0, 0, -1, 0, 0, 0, 0, 0, -1, 0, -1, 6, -1, 0, -1, 0, 0, 0, 0, 0, -1, 0, 0, 0, 0 }; + // std::vector kernel = { 0, 0, 0, 0, -1, 0, 0, 0, 0, 0, -1, 0, -1, 6, -1, 0, -1, 0, 0, 0, 0, 0, -1, 0, 0, 0, 0 + // }; // int padding = 1; // int padded_height = height + 2 * padding; From 4a4a517f78f37b4bed371367a9ec29455baeeaad Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 13 Apr 2023 17:00:48 +0200 Subject: [PATCH 6/8] Updating LaplaceBoxKernel.cpp and test files --- clic/src/tier1/cleLaplaceBoxKernel.cpp | 7 +- tests/laplace_box_test.cpp | 117 ------------------------- 2 files changed, 3 insertions(+), 121 deletions(-) diff --git a/clic/src/tier1/cleLaplaceBoxKernel.cpp b/clic/src/tier1/cleLaplaceBoxKernel.cpp index f46a4ecba..7bb0931ab 100644 --- a/clic/src/tier1/cleLaplaceBoxKernel.cpp +++ b/clic/src/tier1/cleLaplaceBoxKernel.cpp @@ -1,5 +1,7 @@ + #include "cleLaplaceBoxKernel.hpp" +#include "cle_laplace_box.h" namespace cle { @@ -7,10 +9,7 @@ namespace cle LaplaceBoxKernel::LaplaceBoxKernel(const ProcessorPointer & device) : Operation(device, 2) { - std::string cl_header = { -#include "cle_laplace_box.h" - }; - this->SetSource("laplace_box", cl_header); + this->SetSource("laplace_box", oclKernel::laplace_box); } auto diff --git a/tests/laplace_box_test.cpp b/tests/laplace_box_test.cpp index 15b16b312..d0236b018 100644 --- a/tests/laplace_box_test.cpp +++ b/tests/laplace_box_test.cpp @@ -13,128 +13,16 @@ run_test(const std::array & shape, const cle::MemoryType & mem_type) { input = { 1, 0, 2, 1, 0, 1, 0, 3, 0, 2, 0, 1, 3, 0, 0, 1, 0, 1, 1, 0, 2, 0, 2, 1 }; valid = { 3, -4, 11, 0, -2, 3, -7, 16, -4, 11, -5, 2, 17, -4, -4, 5, -6, 4, 3, -6, 12, -7, 10, 3 }; - - // Below is the CPU version - // The input is extended by filling values beyond the edges with the same constant value (0) - - // int height = shape[0]; - // int width = shape[1]; - // int depth = shape[2]; - - // std::vector kernel = { 0, 0, 0, 0, -1, 0, 0, 0, 0, 0, -1, 0, -1, 6, -1, 0, -1, 0, 0, 0, 0, 0, -1, 0, 0, 0, 0 - // }; - - // int padding = 1; - // int padded_height = height + 2 * padding; - // int padded_width = width + 2 * padding; - // int padded_depth = depth + 2 * padding; - - // std::vector input_padded(padded_height * padded_width * padded_depth); - - // for (int k = padding; k < depth + padding; k++) - // { - // for (int i = padding; i < height + padding; i++) - // { - // for (int j = padding; j < width + padding; j++) - // { - // input_padded[(k * padded_height + i) * padded_width + j] = - // input[((k - padding) * height + i - padding) * width + (j - padding)]; - // } - // } - // } - - // for (int k = padding; k < depth + padding; k++) - // { - // for (int i = padding; i < height + padding; i++) - // { - // for (int j = padding; j < width + padding; j++) - // { - // int sum = 0; - // for (int m = -padding; m <= padding; m++) - // { - // for (int n = -padding; n <= padding; n++) - // { - // for (int p = -padding; p <= padding; p++) - // { - // sum += kernel[((m + padding) * (2 * padding + 1) + (n + padding)) * (2 * padding + 1) + (p + - // padding)] * - // input_padded[((k + m) * padded_height + i + n) * padded_width + (j + p)]; - // } - // } - // } - // valid[((k - padding) * height + i - padding) * width + (j - padding)] = sum; - // } - // } - // } } else if (shape[1] > 1) { input = { 1, 0, 2, 1, 0, 1, 3, 1, 0, 2, 1, 1 }; valid = { 7, -7, 10, 2, -4, -1, 15, 0, -3, 11, 0, 3 }; - - // Below is the CPU version - // The input is extended by filling values beyond the edges with the same constant value (0) - - // int height = shape[0]; - // int width = shape[1]; - - // std::vector kernel = { -1, -1, -1, -1, 8, -1, -1, -1, -1 }; - - // int padding = 1; - // int padded_height = height + 2 * padding; - // int padded_width = width + 2 * padding; - // std::vector input_padded(padded_height * padded_width); - - // for (int i = padding; i < height + padding; i++) - // { - // for (int j = padding; j < width + padding; j++) - // { - // input_padded[i * padded_width + j] = input[(i - padding) * width + (j - padding)]; - // } - // } - - // for (int i = padding; i < height + padding; i++) - // { - // for (int j = padding; j < width + padding; j++) - // { - // int sum = 0; - // for (int k = -padding; k <= padding; k++) - // { - // for (int l = -padding; l <= padding; l++) - // { - // sum += - // kernel[(k + padding) * (2 * padding + 1) + l + padding] * input_padded[(i + k) * padded_width + (j + - // l)]; - // } - // } - // valid[(i - padding) * width + (j - padding)] = sum; - // } - // } } else { input = { 1, 0, 0, 1, 1 }; valid = { 2, -1, -1, 1, 1 }; - - // Below is the CPU version - // The input is extended by filling values beyond the edges with the same constant value (0) - - // std::vector kernel = { -1, 2, -1 }; - - // int padding = kernel.size() / 2; - - // std::vector input_padded(input.size() + 2 * padding); - // std::copy(input.begin(), input.end(), input_padded.begin() + padding); - - // for (int i = padding; i < input.size() + padding; i++) - // { - // int sum = 0; - // for (int j = 0; j < kernel.size(); j++) - // { - // sum += kernel[j] * input_padded[i - padding + j]; - // } - // valid[i - padding] = sum; - // } } cle::Clesperanto cle; @@ -155,11 +43,6 @@ main(int argc, char ** argv) -> int return EXIT_FAILURE; } - if (!run_test({ 5, 1, 1 }, cle::BUFFER)) - { - return EXIT_FAILURE; - } - if (!run_test({ 5, 1, 1 }, cle::BUFFER)) { return EXIT_FAILURE; From 09b471aa486dcc609a521944447d473e047098db Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 17 Apr 2023 12:45:20 +0200 Subject: [PATCH 7/8] testing with local branch --- tests/laplace_box_test.cpp | 14 +++++++------- thirdparty/CMakeLists.txt | 4 ++-- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/tests/laplace_box_test.cpp b/tests/laplace_box_test.cpp index d0236b018..3f8a92669 100644 --- a/tests/laplace_box_test.cpp +++ b/tests/laplace_box_test.cpp @@ -12,17 +12,17 @@ run_test(const std::array & shape, const cle::MemoryType & mem_type) if (shape[2] > 1) { input = { 1, 0, 2, 1, 0, 1, 0, 3, 0, 2, 0, 1, 3, 0, 0, 1, 0, 1, 1, 0, 2, 0, 2, 1 }; - valid = { 3, -4, 11, 0, -2, 3, -7, 16, -4, 11, -5, 2, 17, -4, -4, 5, -6, 4, 3, -6, 12, -7, 10, 3 }; + valid = { 4, -22, 30, -6, -21, 6, -26, 50, -19, 34, -28, -2, 50, -23, -18, 3, -27, 3, 5, -26, 31, -25, 28, -1 }; } else if (shape[1] > 1) { input = { 1, 0, 2, 1, 0, 1, 3, 1, 0, 2, 1, 1 }; - valid = { 7, -7, 10, 2, -4, -1, 15, 0, -3, 11, 0, 3 }; + valid = { 3, -8, 8, -2, -9, 2, 13, -1, -6, 1, -3, 2 }; } else { input = { 1, 0, 0, 1, 1 }; - valid = { 2, -1, -1, 1, 1 }; + valid = { 1, -1, -1, 1, 0 }; } cle::Clesperanto cle; @@ -78,22 +78,22 @@ main(int argc, char ** argv) -> int return EXIT_FAILURE; } - if (!run_test({ 3, 4, 2 }, cle::BUFFER)) + if (!run_test({ 4, 3, 2 }, cle::BUFFER)) { return EXIT_FAILURE; } - if (!run_test({ 3, 4, 2 }, cle::BUFFER)) + if (!run_test({ 4, 3, 2 }, cle::BUFFER)) { return EXIT_FAILURE; } - if (!run_test({ 3, 4, 2 }, cle::BUFFER)) + if (!run_test({ 4, 3, 2 }, cle::BUFFER)) { return EXIT_FAILURE; } - if (!run_test({ 3, 4, 2 }, cle::BUFFER)) + if (!run_test({ 4, 3, 2 }, cle::BUFFER)) { return EXIT_FAILURE; } diff --git a/thirdparty/CMakeLists.txt b/thirdparty/CMakeLists.txt index 8b8425ef2..3f55b68d6 100644 --- a/thirdparty/CMakeLists.txt +++ b/thirdparty/CMakeLists.txt @@ -4,8 +4,8 @@ set(FETCHCONTENT_BASE_DIR ${CMAKE_CURRENT_BINARY_DIR}) ## Manage OpenCL Kernel Sources FetchContent_Declare(OpenCL_Kernels - GIT_REPOSITORY https://github.com/clEsperanto/clij-opencl-kernels.git - GIT_TAG clesperanto_kernels + GIT_REPOSITORY https://github.com/CherifMZ/clij-opencl-kernels.git + GIT_TAG fix_laplace_box BUILD_ALWAYS OFF CONFIGURE_COMMAND "" ) From f60769cede306cdc0765fb624349e38c71f80b41 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 17 Apr 2023 13:20:46 +0200 Subject: [PATCH 8/8] Updating the repository link and the tag --- thirdparty/CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/thirdparty/CMakeLists.txt b/thirdparty/CMakeLists.txt index 3f55b68d6..8b8425ef2 100644 --- a/thirdparty/CMakeLists.txt +++ b/thirdparty/CMakeLists.txt @@ -4,8 +4,8 @@ set(FETCHCONTENT_BASE_DIR ${CMAKE_CURRENT_BINARY_DIR}) ## Manage OpenCL Kernel Sources FetchContent_Declare(OpenCL_Kernels - GIT_REPOSITORY https://github.com/CherifMZ/clij-opencl-kernels.git - GIT_TAG fix_laplace_box + GIT_REPOSITORY https://github.com/clEsperanto/clij-opencl-kernels.git + GIT_TAG clesperanto_kernels BUILD_ALWAYS OFF CONFIGURE_COMMAND "" )