forked from pytorch/pytorch
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gtest.cpp
34 lines (28 loc) · 787 Bytes
/
gtest.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#include <test/cpp/tensorexpr/tests.h>
#include <gtest/gtest.h>
namespace torch {
namespace jit {
#define TENSOREXPR_GTEST(name) \
TEST(TensorExprTest, name) { \
test##name(); \
}
TH_FORALL_TENSOREXPR_TESTS(TENSOREXPR_GTEST)
#undef TENSOREXPR_GTEST
#ifdef TORCH_ENABLE_LLVM
#define TENSOREXPR_GTEST_LLVM(name) \
TEST(TensorExprTest, name##_LLVM) { \
test##name(); \
}
TH_FORALL_TENSOREXPR_TESTS_LLVM(TENSOREXPR_GTEST_LLVM)
#undef TENSOREXPR_GTEST_LLVM
#endif
#ifdef USE_CUDA
#define TENSOREXPR_GTEST_CUDA(name) \
TEST(TensorExprTest, name##_CUDA) { \
test##name(); \
}
TH_FORALL_TENSOREXPR_TESTS_CUDA(TENSOREXPR_GTEST_CUDA)
#undef TENSOREXPR_GTEST_CUDA
#endif
} // namespace jit
} // namespace torch