Commit 121c876
[SYCL][NVPTX][AMDGCN] Fix compilation for cmath long double (#19558)
Make sure to not define `long double` wrappers in the cmath wrapper. We
unintentionally defined these for two or three argument functions with
mixed types. These definitions fail to compile if we try to use them,
because there are no SPIR-V builtins for long double. By not defining
them, overload resolution will pick the "host" versions. We can't make
overload resolution fail, because function bodies that are not called on
the device still need to be semantically valid for the device.
This was discovered by the SYCL CTS, in its reference implementation for
the builtins. That code is never called on the device, but it needs to
compile without errors.
---------
Co-authored-by: Steffen Larsen <steffen.larsen@intel.com>1 parent 63c70a1 commit 121c876
2 files changed
Lines changed: 40 additions & 18 deletions
File tree
- sycl
- include/sycl/stl_wrappers
- test/check_device_code/math-builtins
Lines changed: 21 additions & 18 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
22 | | - | |
23 | | - | |
24 | 22 | | |
25 | 23 | | |
26 | 24 | | |
| |||
29 | 27 | | |
30 | 28 | | |
31 | 29 | | |
32 | | - | |
33 | | - | |
34 | | - | |
35 | | - | |
36 | | - | |
37 | | - | |
38 | | - | |
39 | | - | |
40 | | - | |
41 | | - | |
42 | | - | |
43 | | - | |
44 | | - | |
45 | | - | |
46 | | - | |
47 | | - | |
| 30 | + | |
| 31 | + | |
48 | 32 | | |
49 | 33 | | |
50 | 34 | | |
51 | 35 | | |
52 | 36 | | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
53 | 53 | | |
54 | 54 | | |
55 | 55 | | |
| |||
68 | 68 | | |
69 | 69 | | |
70 | 70 | | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
71 | 74 | | |
72 | 75 | | |
73 | 76 | | |
| |||
Lines changed: 19 additions & 0 deletions
| 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 | + | |
0 commit comments