diff --git a/tests/python/test_ndarray.py b/tests/python/test_ndarray.py index acf000aeb5449..8579c04b4acf0 100644 --- a/tests/python/test_ndarray.py +++ b/tests/python/test_ndarray.py @@ -84,8 +84,11 @@ def test_matrix_ndarray(n, m, dtype, shape): @pytest.mark.parametrize('dtype', [ti.f32, ti.f64]) +@test_utils.test(arch=supported_archs_taichi_ndarray) def test_default_fp_ndarray(dtype): - ti.init(arch=supported_archs_taichi_ndarray, default_fp=dtype) + arch = ti.lang.impl.current_cfg().arch + ti.reset() + ti.init(arch=arch, default_fp=dtype) x = ti.Vector.ndarray(2, float, ()) @@ -93,8 +96,11 @@ def test_default_fp_ndarray(dtype): @pytest.mark.parametrize('dtype', [ti.i32, ti.i64]) +@test_utils.test(arch=supported_archs_taichi_ndarray) def test_default_ip_ndarray(dtype): - ti.init(arch=supported_archs_taichi_ndarray, default_ip=dtype) + arch = ti.lang.impl.current_cfg().arch + ti.reset() + ti.init(arch=arch, default_ip=dtype) x = ti.Vector.ndarray(2, int, ()) @@ -254,8 +260,8 @@ def _test_ndarray_deepcopy(): assert y[4][1, 0] == 9 +@test_utils.test(arch=[ti.cuda], ndarray_use_cached_allocator=True) def test_ndarray_cuda_caching_allocator(): - ti.init(arch=ti.cuda, ndarray_use_cached_allocator=True) n = 8 a = ti.ndarray(ti.i32, shape=(n)) a.fill(2)