From 224eba0c284192f9bf723eca3da4679e72bb5ac6 Mon Sep 17 00:00:00 2001 From: Casper da Costa-Luis Date: Sun, 18 Feb 2024 01:51:17 +0000 Subject: [PATCH] fix imports --- tests/test_cpython.py | 5 +++-- tests/test_pybind11.py | 3 +-- tests/test_swig.py | 3 +-- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/tests/test_cpython.py b/tests/test_cpython.py index 85049be..e42d949 100644 --- a/tests/test_cpython.py +++ b/tests/test_cpython.py @@ -111,6 +111,7 @@ def test_asarray(): def test_cuda_array_interface(): + dev_sync = importorskip("cuvec.dev_sync") cupy = importorskip("cupy") v = cu.asarray(np.random.random(shape)) assert hasattr(v, '__cuda_array_interface__') @@ -118,10 +119,10 @@ def test_cuda_array_interface(): c = cupy.asarray(v) assert (c == v).all() c[0, 0, 0] = 1 - cu.dev_sync() + dev_sync() assert c[0, 0, 0] == v[0, 0, 0] c[0, 0, 0] = 0 - cu.dev_sync() + dev_sync() assert c[0, 0, 0] == v[0, 0, 0] ndarr = v + 1 diff --git a/tests/test_pybind11.py b/tests/test_pybind11.py index 5100516..a2f1b06 100644 --- a/tests/test_pybind11.py +++ b/tests/test_pybind11.py @@ -3,8 +3,6 @@ import numpy as np from pytest import importorskip, mark, raises -from cuvec import dev_sync - cu = importorskip("cuvec.pybind11") shape = 127, 344, 344 @@ -119,6 +117,7 @@ def test_asarray(): def test_cuda_array_interface(): + dev_sync = importorskip("cuvec.dev_sync") cupy = importorskip("cupy") v = cu.asarray(np.random.random(shape)) assert hasattr(v, '__cuda_array_interface__') diff --git a/tests/test_swig.py b/tests/test_swig.py index d236f4c..02f7ba2 100644 --- a/tests/test_swig.py +++ b/tests/test_swig.py @@ -3,8 +3,6 @@ import numpy as np from pytest import importorskip, mark, raises -from cuvec import dev_sync - cu = importorskip("cuvec.swig") shape = 127, 344, 344 @@ -119,6 +117,7 @@ def test_asarray(): def test_cuda_array_interface(): + dev_sync = importorskip("cuvec.dev_sync") cupy = importorskip("cupy") v = cu.asarray(np.random.random(shape)) assert hasattr(v, '__cuda_array_interface__')