Skip to content

Commit e21f04a

Browse files
author
Diptorup Deb
committed
XFail test_print test cases on OCL CPU.
1 parent 496b829 commit e21f04a

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

numba_dpex/tests/kernel_tests/test_print.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
#
33
# SPDX-License-Identifier: Apache-2.0
44

5+
import dpctl
56
import dpnp
67
import pytest
78
from numba.core.errors import LoweringError
@@ -26,6 +27,9 @@ def input_arrays(request):
2627
def test_print_scalar_with_string(input_arrays, capfd):
2728
"""Tests if we can print a scalar value with a string."""
2829

30+
if dpctl.SyclDevice().device_type == dpctl.device_type.cpu:
31+
pytest.xfail("Printing scalars on OpenCL CPU devices is unsupported.")
32+
2933
@dpex.kernel
3034
def print_scalar_val(s):
3135
print("printing ...", s[0])
@@ -40,6 +44,9 @@ def print_scalar_val(s):
4044
def test_print_scalar(input_arrays, capfd):
4145
"""Tests if we can print a scalar value."""
4246

47+
if dpctl.SyclDevice().device_type == dpctl.device_type.cpu:
48+
pytest.xfail("Printing scalars on OpenCL CPU devices is unsupported.")
49+
4350
@dpex.kernel
4451
def print_scalar_val(s):
4552
print(s[0])
@@ -48,6 +55,7 @@ def print_scalar_val(s):
4855

4956
print_scalar_val[dpex.Range(1)](a)
5057
captured = capfd.readouterr()
58+
5159
assert "10" in captured.out
5260

5361

@@ -73,7 +81,9 @@ def print_string(a):
7381

7482

7583
def test_print_array(input_arrays):
76-
"""Negative test to capture LoweringError as printing arrays is unsupported."""
84+
"""Negative test to capture LoweringError as printing arrays
85+
is unsupported.
86+
"""
7787

7888
@dpex.kernel
7989
def print_string(a):

0 commit comments

Comments
 (0)