Commit ad6cca0
[TIR] Return error code from kernels in SplitHostDevice (apache#15241)
* [TVMScript] Handle parsing of PrimFunc calls with non-void return
Prior to this commit, the return type of all internal function calls
was hard-coded as `"void"`. After this commit, the `GlobalVar`
representing the internal function has type annotation based on the
callee's signature, which is then used as the return type of the
internal call.
* Update CallNode return type in MakeUnpackedAPI
* [TIR] Return error code from kernels in SplitHostDevice
Some codegen types delegate to `CodeGenCPU` for their compute kernels,
as they may delegate work to packed functions. Because `CodeGenCPU`
assumes that it can return an error code at any point (e.g. when
launching a parallel for loop), the compute kernel should return an
error code.
* [TIR] Remove builtin::ret(0) from device-side kernel
* Restrict the int32 return type to targets that need to propagate errors
* Updated unit tests for CPU-specific checks1 parent 9fd6f3f commit ad6cca0
File tree
3 files changed
+108
-4
lines changed- src/tir/transforms
- tests/python/unittest
3 files changed
+108
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
145 | 145 | | |
146 | 146 | | |
147 | 147 | | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
148 | 178 | | |
149 | 179 | | |
150 | 180 | | |
| |||
185 | 215 | | |
186 | 216 | | |
187 | 217 | | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
188 | 226 | | |
189 | 227 | | |
190 | 228 | | |
191 | 229 | | |
| 230 | + | |
192 | 231 | | |
193 | 232 | | |
194 | 233 | | |
| |||
197 | 236 | | |
198 | 237 | | |
199 | 238 | | |
200 | | - | |
| 239 | + | |
201 | 240 | | |
202 | 241 | | |
203 | 242 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
60 | 60 | | |
61 | 61 | | |
62 | 62 | | |
63 | | - | |
| 63 | + | |
64 | 64 | | |
65 | 65 | | |
66 | 66 | | |
| |||
74 | 74 | | |
75 | 75 | | |
76 | 76 | | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
77 | 94 | | |
78 | | - | |
| 95 | + | |
79 | 96 | | |
80 | 97 | | |
81 | 98 | | |
82 | 99 | | |
83 | 100 | | |
84 | 101 | | |
85 | 102 | | |
86 | | - | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
87 | 114 | | |
88 | 115 | | |
89 | 116 | | |
| |||
Lines changed: 38 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
129 | 129 | | |
130 | 130 | | |
131 | 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 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
132 | 170 | | |
133 | 171 | | |
134 | 172 | | |
| |||
0 commit comments