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.

elemwise.h 1.3 kB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. #pragma once
  2. #include "megdnn/handle.h"
  3. #include <gtest/gtest.h>
  4. #include "test/common/fix_gtest_on_platforms_without_exception.inl"
  5. namespace megdnn {
  6. namespace test {
  7. namespace elemwise {
  8. // clang-format off
  9. #define FIRST_ELEMWISE_CASE unary
  10. #define FOREACH_ELEMWISE_NONFIRST_CASE(cb) \
  11. cb(binary_brdcst) \
  12. cb(binary_non_contig) \
  13. cb(ternary) \
  14. cb(ternary_non_contig) \
  15. cb(ternary_lt) \
  16. cb(ternary_lt_non_contig) \
  17. cb(fuse_mul_add3) \
  18. cb(fuse_mul_add3_non_contig) \
  19. cb(fuse_mul_add4) \
  20. cb(rmulh) \
  21. cb(unary1) \
  22. cb(binary1) \
  23. cb(ternary1) \
  24. cb(unary2) \
  25. cb(binary2) \
  26. cb(ternary2) \
  27. cb(unary3) \
  28. cb(binary3) \
  29. cb(all_modes) \
  30. cb(unary_negative_stride) \
  31. cb(binary_negative_stride) \
  32. cb(ternary_negative_stride) \
  33. #define FOREACH_ELEMWISE_CASE(cb) \
  34. cb(FIRST_ELEMWISE_CASE) \
  35. FOREACH_ELEMWISE_NONFIRST_CASE(cb)
  36. #define def_tags(name) struct name{};
  37. FOREACH_ELEMWISE_CASE(def_tags);
  38. #undef def_tags
  39. template<typename tag>
  40. void run_test(Handle *handle);
  41. #define t(n) ,n
  42. typedef ::testing::Types<FIRST_ELEMWISE_CASE
  43. FOREACH_ELEMWISE_NONFIRST_CASE(t)> test_types;
  44. #undef t
  45. // clang-format on
  46. } // namespace elemwise
  47. } // namespace test
  48. } // namespace megdnn
  49. // vim: syntax=cpp.doxygen