def reverse(self, stream=None): """Return this array in reversed order. The array is treated as one-dimensional. """ result = self._new_like_me() func = elementwise.get_reverse_kernel(self.dtype) func.set_block_shape(*self._block) func.prepared_async_call(self._grid, stream, self.gpudata, result.gpudata, self.mem_size) return result
def reverse(self, stream=None): """Return this array in reversed order. The array is treated as one-dimensional. """ if not self.flags.forc: raise RuntimeError("only contiguous arrays may " "be used as arguments to this operation") result = self._new_like_me() func = elementwise.get_reverse_kernel(self.dtype) func.prepared_async_call(self._grid, self._block, stream, self.gpudata, result.gpudata, self.mem_size) return result