Skip to content

Commit

Permalink
XFail test_print test cases on OCL CPU.
Browse files Browse the repository at this point in the history
  • Loading branch information
Diptorup Deb committed Apr 26, 2023
1 parent 496b829 commit e21f04a
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion numba_dpex/tests/kernel_tests/test_print.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
#
# SPDX-License-Identifier: Apache-2.0

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

if dpctl.SyclDevice().device_type == dpctl.device_type.cpu:
pytest.xfail("Printing scalars on OpenCL CPU devices is unsupported.")

@dpex.kernel
def print_scalar_val(s):
print("printing ...", s[0])
Expand All @@ -40,6 +44,9 @@ def print_scalar_val(s):
def test_print_scalar(input_arrays, capfd):
"""Tests if we can print a scalar value."""

if dpctl.SyclDevice().device_type == dpctl.device_type.cpu:
pytest.xfail("Printing scalars on OpenCL CPU devices is unsupported.")

@dpex.kernel
def print_scalar_val(s):
print(s[0])
Expand All @@ -48,6 +55,7 @@ def print_scalar_val(s):

print_scalar_val[dpex.Range(1)](a)
captured = capfd.readouterr()

assert "10" in captured.out


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


def test_print_array(input_arrays):
"""Negative test to capture LoweringError as printing arrays is unsupported."""
"""Negative test to capture LoweringError as printing arrays
is unsupported.
"""

@dpex.kernel
def print_string(a):
Expand Down

0 comments on commit e21f04a

Please sign in to comment.