Skip to content

Commit

Permalink
add device synchronization tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Dahlia-Chehata committed Jul 7, 2020
1 parent 07ba0ac commit b7a23bc
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions tests/cupy_tests/lib_tests/test_polynomial.py
Original file line number Diff line number Diff line change
Expand Up @@ -259,3 +259,25 @@ def test_poly1d_ne1(self, xp, dtype):
def test_poly1d_ne2(self, xp, dtype):
a, b = self.make_poly1d2(xp, dtype)
return a != b


@testing.gpu
class TestPoly1dDeviceSynchronization(unittest.TestCase):

@cupyx.allow_synchronize(False)
@testing.for_all_dtypes()
def test_poly1d_init(self, dtype):
a = testing.shaped_arange((10,), cupy, dtype)
return cupy.poly1d(a)

@cupyx.allow_synchronize(False)
@testing.for_all_dtypes()
def test_poly1d_getitem(self, dtype):
a = testing.shaped_arange((10,), cupy, dtype)
return cupy.poly1d(a)[2]

@cupyx.allow_synchronize(False)
@testing.for_all_dtypes()
def test_poly1d_setitem(self, dtype):
a = testing.shaped_arange((10,), cupy, dtype)
cupy.poly1d(a)[2] = -1

0 comments on commit b7a23bc

Please sign in to comment.