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()