コード例 #1
0
ファイル: gpuarray.py プロジェクト: spatel81/pycuda
    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
コード例 #2
0
ファイル: gpuarray.py プロジェクト: minrk/PyCUDA
    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
コード例 #3
0
ファイル: gpuarray.py プロジェクト: abergeron/pycuda
    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
コード例 #4
0
ファイル: gpuarray.py プロジェクト: hvcl-old/Vivaldi
    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