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.3 kB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. #include "hcc_detail/hcc_defs_prologue.h"
  2. #include "test/rocm/fixture.h"
  3. #include "megdnn/oprs.h"
  4. #include "test/common/checker.h"
  5. namespace megdnn {
  6. namespace test {
  7. TEST_F(ROCM, ADD_UPDATE) {
  8. Checker<AddUpdate> checker(handle_rocm());
  9. checker.set_dtype(0, dtype::Float32())
  10. .set_dtype(1, dtype::Float32())
  11. .execs({{2, 3, 4}, {2, 3, 4}});
  12. #if !MEGDNN_DISABLE_FLOAT16
  13. checker.set_dtype(0, dtype::Float16())
  14. .set_dtype(1, dtype::Float16())
  15. .execs({{2, 3, 4}, {2, 3, 4}});
  16. #endif
  17. checker.execl(
  18. {{{2, 3, 4}, dtype::Float32()}, {{2, 3, 4}, {16, 4, 1}, dtype::Float32()}});
  19. #if !MEGDNN_DISABLE_FLOAT16
  20. checker.execl(
  21. {{{2, 3, 4}, dtype::Float16()}, {{2, 3, 4}, {16, 4, 1}, dtype::Float16()}});
  22. #endif
  23. checker.execl(
  24. {{{2, 3, 4}, {16, 4, 1}, dtype::Float32()}, {{2, 3, 4}, dtype::Float32()}});
  25. checker.execl({{{2, 3, 4}, dtype::Float32()}, {{1}, dtype::Float32()}});
  26. checker.execl({{{2, 3, 4}, dtype::Float32()}, {{2, 1, 4}, dtype::Float32()}});
  27. checker.set_param({2, -1, 3})
  28. .set_dtype(0, dtype::Int32())
  29. .set_dtype(1, dtype::Int32())
  30. .execs({{2, 3, 2}, {2, 3, 2}});
  31. }
  32. } // namespace test
  33. } // namespace megdnn
  34. // vim: syntax=cpp.doxygen foldmethod=marker foldmarker=f{{{,f}}}