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.

add_update.cpp 1.8 kB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. #include "test/common/checker.h"
  2. #include "test/common/resize.h"
  3. #include "test/common/rng.h"
  4. #include "test/common/task_record_check.h"
  5. #include "test/x86/fixture.h"
  6. namespace megdnn {
  7. namespace test {
  8. TEST_F(X86, ADD_UPDATE) {
  9. Checker<AddUpdate> checker(handle());
  10. checker.set_dtype(0, dtype::Float32())
  11. .set_dtype(1, dtype::Float32())
  12. .execs({{1, 3, 5, 5}, {1, 3, 5, 5}});
  13. checker.set_dtype(0, dtype::Float32())
  14. .set_dtype(1, dtype::Float32())
  15. .execs({{2, 3, 4}, {2, 3, 4}});
  16. checker.set_param({2, -1, 3})
  17. .set_dtype(0, dtype::Float32())
  18. .set_dtype(1, dtype::Float32())
  19. .execs({{2, 3, 2}, {2, 3, 2}});
  20. checker.set_dtype(0, dtype::Float32())
  21. .set_dtype(1, dtype::Float32())
  22. .execs({{1, 3, 5, 5}, {1, 3, 1, 1}});
  23. checker.set_dtype(0, dtype::Float32())
  24. .set_dtype(1, dtype::Float32())
  25. .execs({{2, 3, 4}, {1}});
  26. }
  27. TEST_F(X86, ADD_UPDATE_RECORD) {
  28. TaskRecordChecker<AddUpdate> checker(0);
  29. checker.set_dtype(0, dtype::Float32())
  30. .set_dtype(1, dtype::Float32())
  31. .execs({{1, 3, 5, 5}, {1, 3, 5, 5}});
  32. checker.set_dtype(0, dtype::Float32())
  33. .set_dtype(1, dtype::Float32())
  34. .execs({{2, 3, 4}, {2, 3, 4}});
  35. checker.set_param({2, -1, 3})
  36. .set_dtype(0, dtype::Float32())
  37. .set_dtype(1, dtype::Float32())
  38. .execs({{2, 3, 2}, {2, 3, 2}});
  39. checker.set_dtype(0, dtype::Float32())
  40. .set_dtype(1, dtype::Float32())
  41. .execs({{1, 3, 5, 5}, {1, 3, 1, 1}});
  42. checker.set_dtype(0, dtype::Float32())
  43. .set_dtype(1, dtype::Float32())
  44. .execs({{2, 3, 4}, {1}});
  45. }
  46. } // namespace test
  47. } // namespace megdnn
  48. // vim: syntax=cpp.doxygen