From 16e537bfc5db1fc5193ef69ae6432fae53a6f5cd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E6=98=A5=E4=B9=94?= <83450930+Liyulingyue@users.noreply.github.com> Date: Tue, 30 Jan 2024 22:27:20 +0800 Subject: [PATCH 01/13] Update CMakeLists.txt --- test/cpp/fluid/detection/CMakeLists.txt | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/test/cpp/fluid/detection/CMakeLists.txt b/test/cpp/fluid/detection/CMakeLists.txt index 48e3ac0e8567f..2f20dc9b0e0f2 100644 --- a/test/cpp/fluid/detection/CMakeLists.txt +++ b/test/cpp/fluid/detection/CMakeLists.txt @@ -1,4 +1,3 @@ -cc_test( +paddle_test( mask_util_test - SRCS mask_util_test.cc - DEPS mask_util) + SRCS mask_util_test.cc) From a342aa45349b50eb205e6c0c10026f9a6c49482b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E6=98=A5=E4=B9=94?= <83450930+Liyulingyue@users.noreply.github.com> Date: Wed, 31 Jan 2024 19:20:21 +0800 Subject: [PATCH 02/13] Update mask_util.h --- paddle/fluid/operators/detection/mask_util.h | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/paddle/fluid/operators/detection/mask_util.h b/paddle/fluid/operators/detection/mask_util.h index 0d03db393c063..a37f2817ad317 100644 --- a/paddle/fluid/operators/detection/mask_util.h +++ b/paddle/fluid/operators/detection/mask_util.h @@ -20,14 +20,15 @@ limitations under the License. */ namespace paddle { namespace operators { -void Poly2Mask(const float* ploy, int k, int h, int w, uint8_t* mask); +TEST_API void Poly2Mask(const float* ploy, int k, int h, int w, uint8_t* mask); -void Poly2Boxes(const std::vector>>& polys, - float* boxes); +TEST_API void Poly2Boxes( + const std::vector>>& polys, + float* boxes); -void Polys2MaskWrtBox(const std::vector>& polygons, - const float* box, - int M, - uint8_t* mask); +TEST_API void Polys2MaskWrtBox(const std::vector>& polygons, + const float* box, + int M, + uint8_t* mask); } // namespace operators } // namespace paddle From 91a5ad13410355e50781fd7b6fdbed86106e4524 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E6=98=A5=E4=B9=94?= <83450930+Liyulingyue@users.noreply.github.com> Date: Wed, 31 Jan 2024 19:22:27 +0800 Subject: [PATCH 03/13] Update CMakeLists.txt --- test/cpp/fluid/detection/CMakeLists.txt | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/test/cpp/fluid/detection/CMakeLists.txt b/test/cpp/fluid/detection/CMakeLists.txt index 2f20dc9b0e0f2..555fb18fb7760 100644 --- a/test/cpp/fluid/detection/CMakeLists.txt +++ b/test/cpp/fluid/detection/CMakeLists.txt @@ -1,3 +1 @@ -paddle_test( - mask_util_test - SRCS mask_util_test.cc) +paddle_test(mask_util_test SRCS mask_util_test.cc) From fc76d5ddcf96f58aabfe80cbfd435a29c6b2808a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E6=98=A5=E4=B9=94?= <83450930+Liyulingyue@users.noreply.github.com> Date: Wed, 31 Jan 2024 19:51:35 +0800 Subject: [PATCH 04/13] Update malloc.h --- paddle/fluid/memory/malloc.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/paddle/fluid/memory/malloc.h b/paddle/fluid/memory/malloc.h index 3b098e5a13e51..a9286499ec24c 100644 --- a/paddle/fluid/memory/malloc.h +++ b/paddle/fluid/memory/malloc.h @@ -32,7 +32,7 @@ using phi::Allocation; extern std::shared_ptr AllocShared(const platform::Place& place, size_t size); -extern AllocationPtr Alloc(const platform::Place& place, size_t size); +TEST_API extern AllocationPtr Alloc(const platform::Place& place, size_t size); extern uint64_t Release(const platform::Place& place); From 2a8bd86832073f3778ec2f0379fbd9a80b3cfe72 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E6=98=A5=E4=B9=94?= <83450930+Liyulingyue@users.noreply.github.com> Date: Wed, 31 Jan 2024 23:20:16 +0800 Subject: [PATCH 05/13] Update mask_util.h --- paddle/fluid/operators/detection/mask_util.h | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/paddle/fluid/operators/detection/mask_util.h b/paddle/fluid/operators/detection/mask_util.h index a37f2817ad317..2dfd3b288cca6 100644 --- a/paddle/fluid/operators/detection/mask_util.h +++ b/paddle/fluid/operators/detection/mask_util.h @@ -22,9 +22,8 @@ namespace operators { TEST_API void Poly2Mask(const float* ploy, int k, int h, int w, uint8_t* mask); -TEST_API void Poly2Boxes( - const std::vector>>& polys, - float* boxes); +TEST_API void Poly2Boxes(const std::vector>>& polys, + float* boxes); TEST_API void Polys2MaskWrtBox(const std::vector>& polygons, const float* box, From 7030ff788de08683e5e3410ad4541ba5c953c676 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E6=98=A5=E4=B9=94?= <83450930+Liyulingyue@users.noreply.github.com> Date: Thu, 1 Feb 2024 12:36:21 +0800 Subject: [PATCH 06/13] Update malloc.h --- paddle/fluid/memory/malloc.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/paddle/fluid/memory/malloc.h b/paddle/fluid/memory/malloc.h index a9286499ec24c..3b098e5a13e51 100644 --- a/paddle/fluid/memory/malloc.h +++ b/paddle/fluid/memory/malloc.h @@ -32,7 +32,7 @@ using phi::Allocation; extern std::shared_ptr AllocShared(const platform::Place& place, size_t size); -TEST_API extern AllocationPtr Alloc(const platform::Place& place, size_t size); +extern AllocationPtr Alloc(const platform::Place& place, size_t size); extern uint64_t Release(const platform::Place& place); From f724535d13a3a7ec1e7d5f6a6654d1a2fa729d04 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E6=98=A5=E4=B9=94?= <83450930+Liyulingyue@users.noreply.github.com> Date: Fri, 2 Feb 2024 18:17:46 +0800 Subject: [PATCH 07/13] Update mask_util.h --- paddle/fluid/operators/detection/mask_util.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/paddle/fluid/operators/detection/mask_util.h b/paddle/fluid/operators/detection/mask_util.h index 2dfd3b288cca6..0517977f3df5e 100644 --- a/paddle/fluid/operators/detection/mask_util.h +++ b/paddle/fluid/operators/detection/mask_util.h @@ -20,12 +20,12 @@ limitations under the License. */ namespace paddle { namespace operators { -TEST_API void Poly2Mask(const float* ploy, int k, int h, int w, uint8_t* mask); +void Poly2Mask(const float* ploy, int k, int h, int w, uint8_t* mask); -TEST_API void Poly2Boxes(const std::vector>>& polys, +void Poly2Boxes(const std::vector>>& polys, float* boxes); -TEST_API void Polys2MaskWrtBox(const std::vector>& polygons, +void Polys2MaskWrtBox(const std::vector>& polygons, const float* box, int M, uint8_t* mask); From 720e247b884cfa04f2680b473721f61293ecb029 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E6=98=A5=E4=B9=94?= <83450930+Liyulingyue@users.noreply.github.com> Date: Fri, 2 Feb 2024 22:12:51 +0800 Subject: [PATCH 08/13] Update malloc.h --- paddle/fluid/memory/malloc.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/paddle/fluid/memory/malloc.h b/paddle/fluid/memory/malloc.h index 3b098e5a13e51..a9286499ec24c 100644 --- a/paddle/fluid/memory/malloc.h +++ b/paddle/fluid/memory/malloc.h @@ -32,7 +32,7 @@ using phi::Allocation; extern std::shared_ptr AllocShared(const platform::Place& place, size_t size); -extern AllocationPtr Alloc(const platform::Place& place, size_t size); +TEST_API extern AllocationPtr Alloc(const platform::Place& place, size_t size); extern uint64_t Release(const platform::Place& place); From b754d0e79a5d72d3fe1c759457016f52698e4c46 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E6=98=A5=E4=B9=94?= <83450930+Liyulingyue@users.noreply.github.com> Date: Fri, 2 Feb 2024 22:13:42 +0800 Subject: [PATCH 09/13] Update mask_util.h --- paddle/fluid/operators/detection/mask_util.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/paddle/fluid/operators/detection/mask_util.h b/paddle/fluid/operators/detection/mask_util.h index 0517977f3df5e..2dfd3b288cca6 100644 --- a/paddle/fluid/operators/detection/mask_util.h +++ b/paddle/fluid/operators/detection/mask_util.h @@ -20,12 +20,12 @@ limitations under the License. */ namespace paddle { namespace operators { -void Poly2Mask(const float* ploy, int k, int h, int w, uint8_t* mask); +TEST_API void Poly2Mask(const float* ploy, int k, int h, int w, uint8_t* mask); -void Poly2Boxes(const std::vector>>& polys, +TEST_API void Poly2Boxes(const std::vector>>& polys, float* boxes); -void Polys2MaskWrtBox(const std::vector>& polygons, +TEST_API void Polys2MaskWrtBox(const std::vector>& polygons, const float* box, int M, uint8_t* mask); From 97dad426ae6c3f4246af8568adcd8ba13169624e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E6=98=A5=E4=B9=94?= <83450930+Liyulingyue@users.noreply.github.com> Date: Wed, 7 Feb 2024 05:10:46 +0800 Subject: [PATCH 10/13] Update mask_util.h --- paddle/fluid/operators/detection/mask_util.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/paddle/fluid/operators/detection/mask_util.h b/paddle/fluid/operators/detection/mask_util.h index 2dfd3b288cca6..8e5b6327754bc 100644 --- a/paddle/fluid/operators/detection/mask_util.h +++ b/paddle/fluid/operators/detection/mask_util.h @@ -17,6 +17,8 @@ limitations under the License. */ #include +#include "paddle/utils/test_macros.h" + namespace paddle { namespace operators { From c6c005d5b9d4a9fb372d07ed186790454bbc9e12 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E6=98=A5=E4=B9=94?= <83450930+Liyulingyue@users.noreply.github.com> Date: Wed, 7 Feb 2024 05:38:56 +0800 Subject: [PATCH 11/13] Apply suggestions from code review --- paddle/fluid/operators/detection/mask_util.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/paddle/fluid/operators/detection/mask_util.h b/paddle/fluid/operators/detection/mask_util.h index 8e5b6327754bc..587a9c53794de 100644 --- a/paddle/fluid/operators/detection/mask_util.h +++ b/paddle/fluid/operators/detection/mask_util.h @@ -24,8 +24,8 @@ namespace operators { TEST_API void Poly2Mask(const float* ploy, int k, int h, int w, uint8_t* mask); -TEST_API void Poly2Boxes(const std::vector>>& polys, - float* boxes); +TEST_API void Poly2Boxes( + const std::vector>>& polys, float* boxes); TEST_API void Polys2MaskWrtBox(const std::vector>& polygons, const float* box, From b53d631761eea05a1fdf62200a96e3c31ae0af83 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E6=98=A5=E4=B9=94?= <83450930+Liyulingyue@users.noreply.github.com> Date: Wed, 7 Feb 2024 07:48:52 +0800 Subject: [PATCH 12/13] Update CMakeLists.txt --- test/cpp/fluid/detection/CMakeLists.txt | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/test/cpp/fluid/detection/CMakeLists.txt b/test/cpp/fluid/detection/CMakeLists.txt index 555fb18fb7760..1d107e4bcb2f1 100644 --- a/test/cpp/fluid/detection/CMakeLists.txt +++ b/test/cpp/fluid/detection/CMakeLists.txt @@ -1 +1,7 @@ paddle_test(mask_util_test SRCS mask_util_test.cc) + +if(WITH_ONNXRUNTIME AND WIN32) + # Copy onnxruntime for some c++ test in Windows, since the test will + # be build only in CI, so suppose the generator in Windows is Ninja. + copy_onnx(mask_util_test) +endif() From 0d292935f6ba6d678e20b8e5daf06054175feddb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E6=98=A5=E4=B9=94?= <83450930+Liyulingyue@users.noreply.github.com> Date: Wed, 7 Feb 2024 08:31:19 +0800 Subject: [PATCH 13/13] Update CMakeLists.txt --- test/cpp/fluid/detection/CMakeLists.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/cpp/fluid/detection/CMakeLists.txt b/test/cpp/fluid/detection/CMakeLists.txt index 1d107e4bcb2f1..6a69241e7846e 100644 --- a/test/cpp/fluid/detection/CMakeLists.txt +++ b/test/cpp/fluid/detection/CMakeLists.txt @@ -1,7 +1,7 @@ paddle_test(mask_util_test SRCS mask_util_test.cc) if(WITH_ONNXRUNTIME AND WIN32) - # Copy onnxruntime for some c++ test in Windows, since the test will - # be build only in CI, so suppose the generator in Windows is Ninja. - copy_onnx(mask_util_test) + # Copy onnxruntime for some c++ test in Windows, since the test will + # be build only in CI, so suppose the generator in Windows is Ninja. + copy_onnx(mask_util_test) endif()