diff --git a/pyopencl/array.py b/pyopencl/array.py index 713771f6534f208edf469c940fc4efdf7264b7e7..a9259fc52c2d0a3e6aadf5210d463236430b7d29 100644 --- a/pyopencl/array.py +++ b/pyopencl/array.py @@ -550,7 +550,7 @@ class Array(object): alloc_nbytes = 1 if allocator is None: - if queue is not None: + if context is None and queue is not None: context = queue.context self.base_data = cl.Buffer( @@ -561,15 +561,12 @@ class Array(object): self.base_data = data self.offset = offset + self.context = context @property def ndim(self): return len(self.shape) - @property - def context(self): - return self.base_data.context - @property def data(self): if self.offset: