You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

warp_affine.cpp 1.8 kB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. #include "test/common/warp_affine.h"
  2. #include "test/arm_common/fixture.h"
  3. #include "test/common/checker.h"
  4. #include "test/common/task_record_check.h"
  5. namespace megdnn {
  6. namespace test {
  7. TEST_F(ARM_COMMON_MULTI_THREADS, WARP_AFFINE_CV) {
  8. using namespace warp_affine;
  9. std::vector<TestArg> args = get_cv_args();
  10. Checker<WarpAffine> checker(handle());
  11. for (auto&& arg : args) {
  12. checker.set_param(arg.param)
  13. .set_epsilon(1 + 1e-3)
  14. .set_dtype(0, dtype::Uint8())
  15. .set_dtype(1, dtype::Float32())
  16. .set_dtype(2, dtype::Uint8())
  17. .execs({arg.src, arg.trans, arg.dst});
  18. }
  19. for (auto&& arg : args) {
  20. checker.set_param(arg.param)
  21. .set_dtype(0, dtype::Float32())
  22. .set_dtype(1, dtype::Float32())
  23. .set_dtype(2, dtype::Float32())
  24. .execs({arg.src, arg.trans, arg.dst});
  25. }
  26. }
  27. TEST_F(ARM_COMMON_MULTI_THREADS, WARP_AFFINE_CV_RECORD) {
  28. using namespace warp_affine;
  29. std::vector<TestArg> args = get_cv_args();
  30. TaskRecordChecker<WarpAffine> checker(0);
  31. for (auto&& arg : args) {
  32. checker.set_param(arg.param)
  33. .set_epsilon(1 + 1e-3)
  34. .set_dtype(0, dtype::Uint8())
  35. .set_dtype(1, dtype::Float32())
  36. .set_dtype(2, dtype::Uint8())
  37. .execs({arg.src, arg.trans, arg.dst});
  38. }
  39. for (auto&& arg : args) {
  40. checker.set_param(arg.param)
  41. .set_dtype(0, dtype::Float32())
  42. .set_dtype(1, dtype::Float32())
  43. .set_dtype(2, dtype::Float32())
  44. .execs({arg.src, arg.trans, arg.dst});
  45. }
  46. }
  47. } // namespace test
  48. } // namespace megdnn
  49. // vim: syntax=cpp.doxygen