Skip to content

Commit

Permalink
add skip_when_disabled_cl_khr_fp16
Browse files Browse the repository at this point in the history
  • Loading branch information
vorj committed Feb 3, 2020
1 parent 1af1dea commit 69c3a83
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
1 change: 1 addition & 0 deletions clpy/testing/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
from clpy.testing.array import assert_array_max_ulp # NOQA
from clpy.testing.attr import gpu # NOQA
from clpy.testing.attr import multi_gpu # NOQA
from clpy.testing.attr import skip_when_disabled_cl_khr_fp16 # NOQA
from clpy.testing.attr import slow # NOQA
from clpy.testing.bufio import readbuf # NOQA
from clpy.testing.bufio import writebuf # NOQA
Expand Down
8 changes: 8 additions & 0 deletions clpy/testing/attr.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import clpy
import os
import unittest

Expand Down Expand Up @@ -65,3 +66,10 @@ def gpu(f):

check_available()
return multi_gpu(1)(pytest.mark.gpu(f))


def skip_when_disabled_cl_khr_fp16(f):
check_available()
return unittest.skipUnless(
clpy.backend.opencl.env.supports_cl_khr_fp16() ==
clpy.backend.opencl.api.TRUE, "")(f)

0 comments on commit 69c3a83

Please sign in to comment.