Commit ae89c1e
authored
[OpenCL] Don't initialize OpenCL runtime on host (#15745)
* [OpenCL] Don't initialize OpenCL runtime on host
After adding OpenCL wrapper, it is possible to build TVM with OpenCL
support also on the host which doesn't have OpenCL libraries. But if
you want to compile OpenCL module for a remote device on such host
machine then you will see an error that OpenCL lib cannot be open.
To avoid such problem, we need to call OpenCL functions only in
runtime. So function for initializing OpenCL workspace was removed from
OpenCLModuleNode. And a new function `IsProgramCreated` was added. The
last function is necessary to prepare vectors with OpenCL programs,
associated with OpenCL devices. Previously it was done during
OpenCLModule initialization. So, now we create such vectors only
in runtime after getting list of available OpenCL devices.
* Call workspace init function before all OpenCL API calls1 parent ab3511a commit ae89c1e
File tree
4 files changed
+24
-9
lines changed- src/runtime/opencl
4 files changed
+24
-9
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
220 | 220 | | |
221 | 221 | | |
222 | 222 | | |
223 | | - | |
| 223 | + | |
224 | 224 | | |
225 | 225 | | |
226 | 226 | | |
| |||
253 | 253 | | |
254 | 254 | | |
255 | 255 | | |
256 | | - | |
| 256 | + | |
257 | 257 | | |
258 | 258 | | |
259 | 259 | | |
| |||
465 | 465 | | |
466 | 466 | | |
467 | 467 | | |
| 468 | + | |
| 469 | + | |
468 | 470 | | |
469 | 471 | | |
470 | 472 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
111 | 111 | | |
112 | 112 | | |
113 | 113 | | |
| 114 | + | |
114 | 115 | | |
115 | 116 | | |
116 | 117 | | |
| |||
210 | 211 | | |
211 | 212 | | |
212 | 213 | | |
| 214 | + | |
213 | 215 | | |
214 | 216 | | |
215 | 217 | | |
| |||
300 | 302 | | |
301 | 303 | | |
302 | 304 | | |
| 305 | + | |
303 | 306 | | |
304 | 307 | | |
305 | 308 | | |
| |||
379 | 382 | | |
380 | 383 | | |
381 | 384 | | |
| 385 | + | |
382 | 386 | | |
383 | 387 | | |
384 | 388 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
185 | 185 | | |
186 | 186 | | |
187 | 187 | | |
188 | | - | |
189 | 188 | | |
190 | 189 | | |
191 | 190 | | |
| |||
208 | 207 | | |
209 | 208 | | |
210 | 209 | | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
211 | 218 | | |
212 | | - | |
213 | | - | |
214 | | - | |
| 219 | + | |
| 220 | + | |
215 | 221 | | |
216 | 222 | | |
217 | 223 | | |
| |||
220 | 226 | | |
221 | 227 | | |
222 | 228 | | |
223 | | - | |
| 229 | + | |
224 | 230 | | |
225 | 231 | | |
226 | 232 | | |
| |||
268 | 274 | | |
269 | 275 | | |
270 | 276 | | |
| 277 | + | |
271 | 278 | | |
272 | 279 | | |
273 | 280 | | |
| |||
280 | 287 | | |
281 | 288 | | |
282 | 289 | | |
283 | | - | |
| 290 | + | |
284 | 291 | | |
285 | 292 | | |
286 | 293 | | |
| |||
310 | 317 | | |
311 | 318 | | |
312 | 319 | | |
| 320 | + | |
313 | 321 | | |
314 | 322 | | |
315 | 323 | | |
| |||
319 | 327 | | |
320 | 328 | | |
321 | 329 | | |
322 | | - | |
| 330 | + | |
323 | 331 | | |
324 | 332 | | |
325 | 333 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
42 | 42 | | |
43 | 43 | | |
44 | 44 | | |
| 45 | + | |
45 | 46 | | |
46 | 47 | | |
47 | 48 | | |
| |||
0 commit comments