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

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  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(fuse_mul_add3) \
  16. cb(fuse_mul_add3_non_contig) \
  17. cb(fuse_mul_add4) \
  18. cb(rmulh) \
  19. cb(unary1) \
  20. cb(binary1) \
  21. cb(ternary1) \
  22. cb(unary2) \
  23. cb(binary2) \
  24. cb(ternary2) \
  25. cb(unary3) \
  26. cb(binary3) \
  27. cb(all_modes) \
  28. cb(unary_negative_stride) \
  29. cb(binary_negative_stride) \
  30. cb(ternary_negative_stride) \
  31. #define FOREACH_ELEMWISE_CASE(cb) \
  32. cb(FIRST_ELEMWISE_CASE) \
  33. FOREACH_ELEMWISE_NONFIRST_CASE(cb)
  34. #define def_tags(name) struct name{};
  35. FOREACH_ELEMWISE_CASE(def_tags);
  36. #undef def_tags
  37. template<typename tag>
  38. void run_test(Handle *handle);
  39. #define t(n) ,n
  40. typedef ::testing::Types<FIRST_ELEMWISE_CASE
  41. FOREACH_ELEMWISE_NONFIRST_CASE(t)> test_types;
  42. #undef t
  43. // clang-format on
  44. } // namespace elemwise
  45. } // namespace test
  46. } // namespace megdnn
  47. // vim: syntax=cpp.doxygen