6 cp = pytest.importorskip(
"cupy", reason=
"cupy not installed (requires CUDA)")
8 cp.cuda.Device(0).use()
12 arr = DNDS.ArrayDOF_1_1()
13 arr.father = DNDS.ArrayEigenMatrix_1x1_1x1_N(mpi)
14 arr.son = DNDS.ArrayEigenMatrix_1x1_1x1_N(mpi)
15 arr.father.Resize(1000000, 1, 1)
16 arr.son.Resize(0, 1, 1)
21 print(arr.norm2() ** 2)
25 except RuntimeError
as e:
26 if "Unknown" in str(e)
or "cannot to_device" in str(e):
27 pytest.skip(
"DNDS library built without CUDA backend support")
30 print(arr[0].tolist())
32 print(arr[0].tolist())
34 print(arr.norm2() ** 2)
35 print(arr.componentWiseNorm1())