Skip to content

Commit

Permalink
Skip some tests on Gen12 (#120)
Browse files Browse the repository at this point in the history
Co-authored-by: reazul.hoque <reazul.hoque@intel.com>
Co-authored-by: Sergey Pokhodenko <sergey.pokhodenko@intel.com>
  • Loading branch information
3 people authored Dec 17, 2020
1 parent d8345cf commit c0a17bc
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 1 deletion.
11 changes: 11 additions & 0 deletions numba_dppy/tests/skip_tests.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import dpctl

def is_gen12(device_type):
with dpctl.device_context(device_type):
q = dpctl.get_current_queue()
device = q.get_sycl_device()
name = device.get_device_name()
if "Gen12" in name:
return True

return False
6 changes: 5 additions & 1 deletion numba_dppy/tests/test_numpy_math_functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from numba import njit
import dpctl
import unittest

from . import skip_tests

@unittest.skipUnless(dpctl.has_gpu_queues(), 'test only on GPU system')
class TestNumpy_math_functions(unittest.TestCase):
Expand Down Expand Up @@ -179,6 +179,7 @@ def f(a):

self.assertTrue(np.all(c == -input_arr))

@unittest.skipIf(skip_tests.is_gen12("opencl:gpu"), "Gen12 not supported")
def test_sign(self):
@njit
def f(a):
Expand Down Expand Up @@ -221,6 +222,7 @@ def f(a):
max_abs_err = c.sum() - d.sum()
self.assertTrue(max_abs_err < 1e-5)

@unittest.skipIf(skip_tests.is_gen12("opencl:gpu"), "Gen12 not supported")
def test_log(self):
@njit
def f(a):
Expand All @@ -236,6 +238,7 @@ def f(a):
max_abs_err = c.sum() - d.sum()
self.assertTrue(max_abs_err < 1e-5)

@unittest.skipIf(skip_tests.is_gen12("opencl:gpu"), "Gen12 not supported")
def test_log10(self):
@njit
def f(a):
Expand All @@ -251,6 +254,7 @@ def f(a):
max_abs_err = c.sum() - d.sum()
self.assertTrue(max_abs_err < 1e-5)

@unittest.skipIf(skip_tests.is_gen12("opencl:gpu"), "Gen12 not supported")
def test_expm1(self):
@njit
def f(a):
Expand Down
2 changes: 2 additions & 0 deletions numba_dppy/tests/test_numpy_trigonomteric_functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
from numba import njit
import dpctl
import unittest
from . import skip_tests


@unittest.skipUnless(dpctl.has_gpu_queues(), 'test only on GPU system')
Expand Down Expand Up @@ -155,6 +156,7 @@ def f(a):
max_abs_err = c.sum() - d.sum()
self.assertTrue(max_abs_err < 1e-5)

@unittest.skipIf(skip_tests.is_gen12("opencl:gpu"), "Gen12 not supported")
def test_arccosh(self):
@njit
def f(a):
Expand Down

0 comments on commit c0a17bc

Please sign in to comment.