From e43baae45cfc3ffa2b6dafaa6ca42b4c887ef32c 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, 8 Feb 2024 11:42:07 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90paddle=5Ftest=20No.24=E3=80=91replace?= =?UTF-8?q?=20cc=5Ftest=20with=20paddle=5Ftest=20=20(#61373)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Update CMakeLists.txt * Update mask_util.h * Update CMakeLists.txt * Update malloc.h * Update mask_util.h * Update malloc.h * Update mask_util.h * Update malloc.h * Update mask_util.h * Update mask_util.h * Apply suggestions from code review * Update CMakeLists.txt * Update CMakeLists.txt --- paddle/fluid/memory/malloc.h | 2 +- paddle/fluid/operators/detection/mask_util.h | 16 +++++++++------- test/cpp/fluid/detection/CMakeLists.txt | 11 +++++++---- 3 files changed, 17 insertions(+), 12 deletions(-) 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); diff --git a/paddle/fluid/operators/detection/mask_util.h b/paddle/fluid/operators/detection/mask_util.h index 0d03db393c063..587a9c53794de 100644 --- a/paddle/fluid/operators/detection/mask_util.h +++ b/paddle/fluid/operators/detection/mask_util.h @@ -17,17 +17,19 @@ limitations under the License. */ #include +#include "paddle/utils/test_macros.h" + 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 diff --git a/test/cpp/fluid/detection/CMakeLists.txt b/test/cpp/fluid/detection/CMakeLists.txt index 48e3ac0e8567f..6a69241e7846e 100644 --- a/test/cpp/fluid/detection/CMakeLists.txt +++ b/test/cpp/fluid/detection/CMakeLists.txt @@ -1,4 +1,7 @@ -cc_test( - mask_util_test - SRCS mask_util_test.cc - DEPS mask_util) +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()