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.

gaussian_blur.cpp 1.4 kB

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