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 6f3cd94 commit ab8266dCopy full SHA for ab8266d
arraycontext/impl/cupy/__init__.py
@@ -71,10 +71,14 @@ class CupyArrayContext(ArrayContext):
71
72
_loopy_transform_cache: dict[lp.TranslationUnit, lp.ExecutorBase]
73
74
- def __init__(self) -> None:
+ def __init__(self, device: int | None = None) -> None:
75
super().__init__()
76
self._loopy_transform_cache = {}
77
78
+ if device is not None:
79
+ import cupy as cp
80
+ cp.cuda.runtime.setDevice(device)
81
+
82
array_types = (CupyNonObjectArray,)
83
84
def _get_fake_numpy_namespace(self):
0 commit comments