Skip to content

Commit e5f9810

Browse files
Skip a check in test_nextafter_special_cases_zero for float16
Implementation of CUDA backend for DPC++ has a known issue where sycl::nextafter for sycl::half type does not comply with C++ stipulation that nextafter(from_, to_) must return to_ if from_ is equal to to_.
1 parent 87f8123 commit e5f9810

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

dpctl/tests/elementwise/test_nextafter.py

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
import numpy as np
2020
import pytest
2121

22+
import dpctl
2223
import dpctl.tensor as dpt
2324
from dpctl.tests.helper import get_queue_or_skip, skip_if_dtype_not_supported
2425

@@ -103,7 +104,18 @@ def test_nextafter_special_cases_zero(dt):
103104

104105
y = dpt.nextafter(x1, x2)
105106
assert dpt.all(y == 0)
106-
assert dpt.all(dpt.signbit(y) == dpt.signbit(x2))
107+
108+
skip_checking_signs = (
109+
x1.dtype == dpt.float16
110+
and x1.sycl_device.backend == dpctl.backend_type.cuda
111+
)
112+
if skip_checking_signs:
113+
pytest.skip(
114+
"Skipped checking signs for nextafter due to "
115+
"known issue in DPC++ support for CUDA devices"
116+
)
117+
else:
118+
assert dpt.all(dpt.signbit(y) == dpt.signbit(x2))
107119

108120

109121
@pytest.mark.parametrize("dt", ["f2", "f4", "f8"])

0 commit comments

Comments
 (0)