Skip to content

Commit

Permalink
Add a few tests for MatDescriptor directly
Browse files Browse the repository at this point in the history
  • Loading branch information
jakirkham committed Mar 8, 2020
1 parent 97c7bc1 commit 7c96b16
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions tests/cupy_tests/test_cusparse.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import pickle
import unittest

import numpy
Expand All @@ -8,9 +9,23 @@

import cupy
from cupy import testing
from cupy import cusparse
from cupyx.scipy import sparse


class TestMatDescriptor(unittest.TestCase):

def test_create(self):
md = cusparse.MatDescriptor.create()
assert isinstance(md.descriptor, int)

def test_pickle(self):
md = cusparse.MatDescriptor.create()
md2 = pickle.loads(pickle.dumps(md))
assert isinstance(md2.descriptor, int)
assert md.descriptor != md2.descriptor


@testing.parameterize(*testing.product({
'dtype': [numpy.float32, numpy.float64],
'transa': [True, False],
Expand Down

0 comments on commit 7c96b16

Please sign in to comment.