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.

fixture.h 947 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. #pragma once
  2. #include <gtest/gtest.h>
  3. #include "test/common/fix_gtest_on_platforms_without_exception.inl"
  4. #include "megcore_cdefs.h"
  5. #include "megdnn/handle.h"
  6. #include <memory>
  7. namespace megdnn {
  8. namespace test {
  9. class CUDA : public ::testing::Test {
  10. public:
  11. void SetUp() override;
  12. void TearDown() override;
  13. Handle* handle_cuda() { return m_handle_cuda.get(); }
  14. Handle* handle_naive();
  15. private:
  16. std::unique_ptr<Handle> m_handle_naive;
  17. std::unique_ptr<Handle> m_handle_cuda;
  18. };
  19. //! cuda test fixture with AsyncErrorInfo
  20. class CUDA_ERROR_INFO : public ::testing::Test {
  21. public:
  22. void SetUp() override;
  23. void TearDown() override;
  24. Handle* handle_cuda() { return m_handle_cuda.get(); }
  25. megcore::AsyncErrorInfo get_error_info();
  26. private:
  27. megcore::AsyncErrorInfo* m_error_info_dev;
  28. std::unique_ptr<Handle> m_handle_cuda;
  29. };
  30. } // namespace test
  31. } // namespace megdnn
  32. // vim: syntax=cpp.doxygen