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.

resize.cpp 1.4 kB

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