Skip to content

Commit 9a1f205

Browse files
Merge pull request #1409 from IntelPython/install-tests-elementwise-files
Install missing elementwise test files into the dpctl prefix
2 parents 1277ba6 + 3efacad commit 9a1f205

File tree

5 files changed

+13
-4
lines changed

5 files changed

+13
-4
lines changed

conda-recipe/meta.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ requirements:
2727
- wheel
2828
run:
2929
- python
30-
- {{ pin_compatible('numpy', min_pin='x.x', max_pin='x') }}
30+
- {{ pin_compatible('numpy', min_pin='x.x', upper_bound='1.26') }}
3131
- dpcpp-cpp-rt >=2023.2
3232
- level-zero # [linux]
3333

dpctl/tensor/_elementwise_common.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -316,7 +316,7 @@ def _resolve_weak_types(o1_dtype, o2_dtype, dev):
316316
o2_kind_num = _strong_dtype_num_kind(o2_dtype)
317317
if o1_kind_num > o2_kind_num:
318318
if isinstance(o1_dtype, WeakIntegralType):
319-
return dpt.int64, o2_dtype
319+
return dpt.dtype(ti.default_device_int_type(dev)), o2_dtype
320320
if isinstance(o1_dtype, WeakComplexType):
321321
if o2_dtype is dpt.float16 or o2_dtype is dpt.float32:
322322
return dpt.complex64, o2_dtype
@@ -335,7 +335,7 @@ def _resolve_weak_types(o1_dtype, o2_dtype, dev):
335335
o2_kind_num = _weak_type_num_kind(o2_dtype)
336336
if o2_kind_num > o1_kind_num:
337337
if isinstance(o2_dtype, WeakIntegralType):
338-
return o1_dtype, dpt.int64
338+
return o1_dtype, dpt.dtype(ti.default_device_int_type(dev))
339339
if isinstance(o2_dtype, WeakComplexType):
340340
if o1_dtype is dpt.float16 or o1_dtype is dpt.float32:
341341
return o1_dtype, dpt.complex64

dpctl/tests/elementwise/test_hyperbolic.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
# limitations under the License.
1616

1717
import itertools
18+
import os
1819

1920
import numpy as np
2021
import pytest
@@ -270,6 +271,7 @@ def test_hyper_real_special_cases(np_call, dpt_call, dtype):
270271
assert_allclose(dpt.asnumpy(dpt_call(yf)), Y_np, atol=tol, rtol=tol)
271272

272273

274+
@pytest.mark.skipif(os.name == "nt", reason="Known problems on Windows")
273275
@pytest.mark.parametrize("np_call, dpt_call", _all_funcs)
274276
@pytest.mark.parametrize("dtype", ["c8", "c16"])
275277
def test_hyper_complex_special_cases(np_call, dpt_call, dtype):

dpctl/tests/elementwise/test_trigonometric.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
# limitations under the License.
1616

1717
import itertools
18+
import os
1819

1920
import numpy as np
2021
import pytest
@@ -267,6 +268,7 @@ def test_trig_real_special_cases(np_call, dpt_call, dtype):
267268
assert_allclose(dpt.asnumpy(dpt_call(yf)), Y_np, atol=tol, rtol=tol)
268269

269270

271+
@pytest.mark.skipif(os.name == "nt", reason="Known problem on Windows")
270272
@pytest.mark.parametrize("np_call, dpt_call", _all_funcs)
271273
@pytest.mark.parametrize("dtype", ["c8", "c16"])
272274
def test_trig_complex_special_cases(np_call, dpt_call, dtype):
@@ -297,6 +299,9 @@ def test_trig_out_overlap(np_call, dpt_call, dtype):
297299
q = get_queue_or_skip()
298300
skip_if_dtype_not_supported(dtype, q)
299301

302+
if os.name == "nt" and dpt.isdtype(dpt.dtype(dtype), "complex floating"):
303+
pytest.skip("Know problems on Windows")
304+
300305
if np_call == np.tan:
301306
X = dpt.linspace(-np.pi / 2, np.pi / 2, 64, dtype=dtype, sycl_queue=q)[
302307
2:-2

setup.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,9 @@ def _get_cmdclass():
175175
"dpctl.program",
176176
"dpctl.utils",
177177
],
178-
package_data={"dpctl": ["tests/*.*", "tests/helper/*.py"]},
178+
package_data={
179+
"dpctl": ["tests/*.*", "tests/helper/*.py", "tests/elementwise/*.py"]
180+
},
179181
include_package_data=True,
180182
zip_safe=False,
181183
setup_requires=["Cython"],

0 commit comments

Comments
 (0)