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.

test_lar_options.cpp 1.1 kB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. #include <gtest/gtest.h>
  2. #include <string.h>
  3. #include <memory>
  4. #include "test_common.h"
  5. #include "test_options.h"
  6. using namespace lar;
  7. DECLARE_bool(lite);
  8. DECLARE_bool(cpu);
  9. DECLARE_bool(optimize_for_inference);
  10. #if LITE_WITH_CUDA
  11. DECLARE_bool(cuda);
  12. #endif
  13. namespace {
  14. BOOL_OPTION_WRAP(optimize_for_inference);
  15. BOOL_OPTION_WRAP(lite);
  16. BOOL_OPTION_WRAP(cpu);
  17. #if LITE_WITH_CUDA
  18. BOOL_OPTION_WRAP(cuda);
  19. #endif
  20. } // anonymous namespace
  21. TEST(TestLarOption, OPTIMIZE_FOR_INFERENCE) {
  22. DEFINE_BOOL_WRAP(cpu);
  23. std::string model_path = "./shufflenet.mge";
  24. TEST_BOOL_OPTION(optimize_for_inference);
  25. }
  26. #if LITE_WITH_OPENCL
  27. TEST(TestLarOption, OPTIMIZE_FOR_INFERENCE_OPENCL) {
  28. REQUIRE_OPENCL();
  29. DEFINE_BOOL_WRAP(opencl);
  30. std::string model_path = "./shufflenet.mge";
  31. TEST_BOOL_OPTION(optimize_for_inference);
  32. }
  33. #endif
  34. #if LITE_WITH_CUDA
  35. TEST(TestLarOption, OPTIMIZE_FOR_INFERENCE_CUDA) {
  36. REQUIRE_CUDA();
  37. DEFINE_BOOL_WRAP(cuda);
  38. std::string model_path = "./shufflenet.mge";
  39. TEST_BOOL_OPTION(optimize_for_inference);
  40. }
  41. #endif