We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 340f9dc commit 3ee28ccCopy full SHA for 3ee28cc
arraycontext/impl/cupy/__init__.py
@@ -75,6 +75,8 @@ def __init__(self, device: int | None = None) -> None:
75
super().__init__()
76
self._loopy_transform_cache = {}
77
78
+ self.device = device
79
+
80
if device is not None:
81
import cupy as cp
82
cp.cuda.runtime.setDevice(device)
@@ -88,7 +90,7 @@ def _get_fake_numpy_namespace(self):
88
90
# {{{ ArrayContext interface
89
91
92
def clone(self):
- return type(self)()
93
+ return type(self)(self.device)
94
95
@overload
96
def from_numpy(self, array: np.ndarray) -> Array:
0 commit comments