Commit 57cece2
authored
[SYCL][sycl-post-link] Emit helpful warning message for undefined user functions in a fully linked device image (#17346)
In the following simple example (simplicity for sake of discussion),
```c++
#include <sycl/sycl.hpp>
SYCL_EXTERNAL int external_f1(int A, int B);
void hostf(...) {
...
cgh.parallel_for<class Test>(range, [=](sycl::id<1> ID) {
accC[ID] = external_f1(accA[ID], accB[ID]);
});
});
}
```
"external_f1" is a user function which is not defined in this module.
Linking this module stand-alone will successfully create an executable.
During run-time. there will be a run-time error saying that there is an
unresolved symbol. This PR addresses a user request to alert the user of
this behavior during compile-time by emitting a warning message.
Thanks
---------
Signed-off-by: Arvind Sudarsanam <[email protected]>1 parent 2027c94 commit 57cece2
File tree
2 files changed
+45
-2
lines changed- llvm/lib/SYCLLowerIR
- sycl/test/warnings
2 files changed
+45
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
| 35 | + | |
35 | 36 | | |
36 | 37 | | |
37 | 38 | | |
| |||
298 | 299 | | |
299 | 300 | | |
300 | 301 | | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
301 | 319 | | |
302 | 320 | | |
303 | 321 | | |
| |||
382 | 400 | | |
383 | 401 | | |
384 | 402 | | |
| 403 | + | |
385 | 404 | | |
386 | 405 | | |
387 | 406 | | |
| |||
1452 | 1471 | | |
1453 | 1472 | | |
1454 | 1473 | | |
1455 | | - | |
1456 | | - | |
| 1474 | + | |
1457 | 1475 | | |
1458 | 1476 | | |
1459 | 1477 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 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 | + | |
0 commit comments