Remove code to set/change current device implicitly
@@ -4,7 +4,6 @@ from cupy import core
from cupy.core import fusion
from cupy.core import ndarray
from cupy.cuda import memory
-from cupy.cuda import runtime
def array(obj, dtype=None, copy=True, order='K', subok=False, ndmin=0):
@@ -56,10 +55,7 @@ def _convert_object_with_cuda_array_interface(a):
else:
strides = None
nbytes = numpy.prod(shape) * dtype.itemsize
- dataptr = desc['data'][0]
- attrs = runtime.pointerGetAttributes(dataptr)
- runtime.setDevice(attrs.device)
- mem = memory.UnownedMemory(dataptr, nbytes, a)
+ mem = memory.UnownedMemory(desc['data'][0], nbytes, a)
memptr = memory.MemoryPointer(mem, 0)
return ndarray(shape, dtype=dtype, memptr=memptr, strides=strides)
