Skip to content

Commit

Permalink
【paddle_test No.24】replace cc_test with paddle_test (#61373)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
Liyulingyue authored Feb 8, 2024
1 parent 8bb7910 commit e43baae
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 12 deletions.
2 changes: 1 addition & 1 deletion paddle/fluid/memory/malloc.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ using phi::Allocation;
extern std::shared_ptr<Allocation> 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);

Expand Down
16 changes: 9 additions & 7 deletions paddle/fluid/operators/detection/mask_util.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,19 @@ limitations under the License. */

#include <vector>

#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<std::vector<std::vector<float>>>& polys,
float* boxes);
TEST_API void Poly2Boxes(
const std::vector<std::vector<std::vector<float>>>& polys, float* boxes);

void Polys2MaskWrtBox(const std::vector<std::vector<float>>& polygons,
const float* box,
int M,
uint8_t* mask);
TEST_API void Polys2MaskWrtBox(const std::vector<std::vector<float>>& polygons,
const float* box,
int M,
uint8_t* mask);
} // namespace operators
} // namespace paddle
11 changes: 7 additions & 4 deletions test/cpp/fluid/detection/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -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()

0 comments on commit e43baae

Please sign in to comment.