forked from pytorch/pytorch
-
Notifications
You must be signed in to change notification settings - Fork 0
/
tests.h
157 lines (151 loc) · 5.51 KB
/
tests.h
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
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
#pragma once
/**
* See README.md for instructions on how to add a new test.
*/
#include <c10/macros/Export.h>
#include <torch/csrc/WindowsTorchApiMacro.h>
namespace torch {
namespace jit {
#define TH_FORALL_TESTS(_) \
_(ADFormulas) \
_(Attributes) \
_(Blocks) \
_(CallStack) \
_(CallStackCaching) \
_(CodeTemplate) \
_(ControlFlow) \
_(CreateAutodiffSubgraphs) \
_(CustomOperators) \
_(CustomOperatorAliasing) \
_(IValueKWargs) \
_(CustomFusion) \
_(SchemaMatching) \
_(Differentiate) \
_(DifferentiateWithRequiresGrad) \
_(FromQualString) \
_(InternedStrings) \
_(PassManagement) \
_(Proto) \
_(RegisterFusionCachesKernel) \
_(SchemaParser) \
_(TopologicalIndex) \
_(TopologicalMove) \
_(SubgraphUtils) \
_(AliasAnalysis) \
_(ContainerAliasing) \
_(AliasRegistration) \
_(WriteTracking) \
_(Wildcards) \
_(MemoryDAG) \
_(IRParser) \
_(ConstantPooling) \
_(THNNConv) \
_(ATenNativeBatchNorm) \
_(NoneSchemaMatch) \
_(ClassParser) \
_(UnifyTypes) \
_(Profiler) \
_(InsertAndEliminateRedundantGuards) \
_(InsertBailOuts) \
_(PeepholeOptimize) \
_(RecordFunction) \
_(ThreadLocalDebugInfo) \
_(SubgraphMatching) \
_(SubgraphRewriter) \
_(ModuleClone) \
_(ModuleConstant) \
_(ModuleParameter) \
_(ModuleCopy) \
_(ModuleDeepcopy) \
_(ModuleDeepcopyString) \
_(ModuleDeepcopyAliasing) \
_(ModuleDefine) \
_(QualifiedName) \
_(ClassImport) \
_(ScriptObject) \
_(SaveExtraFilesHook) \
_(TypeTags) \
_(DCE) \
_(CustomFusionNestedBlocks) \
_(ClassDerive) \
_(SaveLoadTorchbind) \
_(ModuleInterfaceSerialization) \
_(ClassTypeAddRemoveAttr) \
_(Inliner) \
_(LiteInterpreterAdd) \
_(LiteInterpreterConv) \
_(LiteInterpreterInline) \
_(LiteInterpreterTuple) \
_(LiteInterpreterUpsampleNearest2d) \
_(CommonAncestor) \
_(AutogradSymbols) \
_(MobileTypeParser) \
_(LiteInterpreterBuiltinFunction) \
_(LiteInterpreterPrim) \
_(LiteInterpreterLoadOrigJit) \
_(LiteInterpreterWrongMethodName) \
_(LiteInterpreterParams) \
_(LiteInterpreterSetState) \
_(TorchbindIValueAPI) \
_(LiteInterpreterDict) \
_(FusionAliasing)
#if defined(USE_CUDA)
#define TH_FORALL_TESTS_CUDA(_) \
_(ArgumentSpec) \
_(CompleteArgumentSpec) \
_(Fusion) \
_(GraphExecutor) \
_(ModuleConversion) \
_(Interp) \
_(GPU_FusionDispatch) \
_(GPU_FusionSimpleArith) \
_(GPU_FusionSimpleTypePromote) \
_(GPU_FusionMutator) \
_(GPU_FusionRegister) \
_(GPU_FusionTopoSort) \
_(GPU_FusionTensor) \
_(GPU_FusionTensorContiguity) \
_(GPU_FusionTVSplit) \
_(GPU_FusionTVMerge) \
_(GPU_FusionTVReorder) \
_(GPU_FusionEquality) \
_(GPU_FusionReplaceAll) \
_(GPU_FusionParser) \
_(GPU_FusionDependency) \
_(GPU_FusionCodeGen) \
_(GPU_FusionCodeGen2) \
_(GPU_FusionSimplePWise) \
_(GPU_FusionExecKernel) \
_(GPU_FusionForLoop) \
_(GPU_FusionLoopUnroll) \
_(GPU_FusionUnaryOps) \
_(GPU_FusionBinaryOps) \
_(GPU_FusionTernaryOps) \
_(GPU_FusionCompoundOps) \
_(GPU_FusionAdvancedComputeAt) \
_(GPU_FusionScalarInputs) \
_(GPU_FusionRFactorReplay) \
_(GPU_FusionReduction) \
_(GPU_FusionReduction2)
#else
#define TH_FORALL_TESTS_CUDA(_) \
_(ArgumentSpec) \
_(CompleteArgumentSpec) \
_(Fusion) \
_(GraphExecutor) \
_(ModuleConversion) \
_(Interp)
#endif
#define DECLARE_JIT_TEST(name) void test##name();
TH_FORALL_TESTS(DECLARE_JIT_TEST)
TH_FORALL_TESTS_CUDA(DECLARE_JIT_TEST)
#undef DECLARE_JIT_TEST
// This test is special since it requires prior setup in python.
// 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
// torch_python_test.cpp
void testEvalModeForLoadedModule();
void testSerializationInterop();
void testTorchSaveError();
} // namespace jit
} // namespace torch