2019-08-18 23:46:56 +00:00
|
|
|
#include <c10/util/Exception.h>
|
2020-03-26 18:15:49 +00:00
|
|
|
#include <test/cpp/jit/tests.h>
|
2019-08-18 23:46:56 +00:00
|
|
|
|
|
|
|
|
namespace torch {
|
|
|
|
|
namespace jit {
|
|
|
|
|
|
2020-03-16 18:18:16 +00:00
|
|
|
#ifdef _MSC_VER
|
|
|
|
|
#define JIT_TEST_API
|
2019-08-18 23:46:56 +00:00
|
|
|
#else
|
2020-03-16 18:18:16 +00:00
|
|
|
#define JIT_TEST_API TORCH_API
|
|
|
|
|
#endif
|
|
|
|
|
|
2019-08-18 23:46:56 +00:00
|
|
|
#define JIT_TEST(name) test##name();
|
2020-03-16 18:18:16 +00:00
|
|
|
JIT_TEST_API void runJITCPPTests(bool runCuda) {
|
2019-08-18 23:46:56 +00:00
|
|
|
TH_FORALL_TESTS(JIT_TEST)
|
|
|
|
|
if (runCuda) {
|
|
|
|
|
TH_FORALL_TESTS_CUDA(JIT_TEST)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// This test is special since it requires prior setup in python.
|
2020-03-26 18:15:49 +00:00
|
|
|
// So it is not part of the general test list (which is shared between the
|
|
|
|
|
// gtest and python test runners), but is instead invoked manually by the
|
2019-08-18 23:46:56 +00:00
|
|
|
// torch_python_test.cpp
|
|
|
|
|
testEvalModeForLoadedModule();
|
2020-01-08 00:19:01 +00:00
|
|
|
testTorchSaveError();
|
2019-08-18 23:46:56 +00:00
|
|
|
}
|
|
|
|
|
#undef JIT_TEST
|
|
|
|
|
} // namespace jit
|
|
|
|
|
} // namespace torch
|