Commit d523061
authored
Fix device-aware dtype handling in identity, gradient functions (#2835)
This PR ensures that default dtype selection respects device-specific
capabilities across multiple functions.
The PR includes changes:
- `dpnp.identity`: Remove redundant default dtype handling. The function
now delegates dtype resolution to dpnp.eye(), which already handles
device-aware default types correctly.
- `dpnp.gradient`: Pass sycl_queue parameter to default_float_type()
calls to ensure the selected float type is compatible with the device
where the array resides. This prevents issues when converting integer
arrays on devices with different dtype support.
The PR also updates SYCL queue tests to fix the parametrization to
generate device-dtype pairs using a new get_all_dev_dtypes() helper.
Each device is now tested only with dtypes it actually supports (e.g.,
devices without fp64 support won't test fp64), preventing false failures
and unnecessary test combinations.1 parent e36835d commit d523061
File tree
4 files changed
+31
-14
lines changed- dpnp
- tests
4 files changed
+31
-14
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
83 | 83 | | |
84 | 84 | | |
85 | 85 | | |
| 86 | + | |
86 | 87 | | |
87 | 88 | | |
88 | 89 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2664 | 2664 | | |
2665 | 2665 | | |
2666 | 2666 | | |
2667 | | - | |
2668 | 2667 | | |
2669 | 2668 | | |
2670 | | - | |
| 2669 | + | |
2671 | 2670 | | |
2672 | 2671 | | |
2673 | 2672 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
141 | 141 | | |
142 | 142 | | |
143 | 143 | | |
144 | | - | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
145 | 147 | | |
146 | 148 | | |
147 | 149 | | |
| |||
2707 | 2709 | | |
2708 | 2710 | | |
2709 | 2711 | | |
2710 | | - | |
2711 | | - | |
2712 | | - | |
| 2712 | + | |
| 2713 | + | |
| 2714 | + | |
2713 | 2715 | | |
2714 | 2716 | | |
2715 | 2717 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
54 | 54 | | |
55 | 55 | | |
56 | 56 | | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
57 | 74 | | |
58 | 75 | | |
59 | 76 | | |
| |||
1082 | 1099 | | |
1083 | 1100 | | |
1084 | 1101 | | |
1085 | | - | |
1086 | | - | |
| 1102 | + | |
1087 | 1103 | | |
1088 | | - | |
1089 | | - | |
| 1104 | + | |
| 1105 | + | |
1090 | 1106 | | |
1091 | 1107 | | |
1092 | 1108 | | |
| |||
1098 | 1114 | | |
1099 | 1115 | | |
1100 | 1116 | | |
1101 | | - | |
1102 | | - | |
1103 | | - | |
1104 | | - | |
| 1117 | + | |
| 1118 | + | |
| 1119 | + | |
1105 | 1120 | | |
1106 | 1121 | | |
1107 | 1122 | | |
| |||
0 commit comments