Beispiel #1
0
    def _rdiv_scalar(self, other, out, stream=None):
        """Divides an array by a scalar::

           y = n / self
        """

        if not self.flags.forc:
            raise RuntimeError("only contiguous arrays may " "be used as arguments to this operation")

        func = elementwise.get_rdivide_elwise_kernel(self.dtype)
        func.prepared_async_call(self._grid, self._block, stream, self.gpudata, other, out.gpudata, self.mem_size)

        return out
Beispiel #2
0
    def _rdiv_scalar(self, other, out, stream=None):
        """Divides an array by a scalar::

           y = n / self
        """

        assert self.dtype == np.float32

        func = elementwise.get_rdivide_elwise_kernel(self.dtype)
        func.set_block_shape(*self._block)
        func.prepared_async_call(self._grid, stream, self.gpudata, other,
                                 out.gpudata, self.mem_size)

        return out
Beispiel #3
0
    def _rdiv_scalar(self, other, out, stream=None):
        """Divides an array by a scalar::

           y = n / self
        """

        if not self.flags.forc:
            raise RuntimeError("only contiguous arrays may "
                               "be used as arguments to this operation")

        func = elementwise.get_rdivide_elwise_kernel(self.dtype, out.dtype)
        func.prepared_async_call(self._grid, self._block, stream, self.gpudata,
                                 other, out.gpudata, self.mem_size)

        return out
Beispiel #4
0
    def _rdiv_scalar(self, other, out, stream=None):
        """Divides an array by a scalar::
          
           y = n / self 
        """

        assert self.dtype == numpy.float32

        func = elementwise.get_rdivide_elwise_kernel(self.dtype)
        func.set_block_shape(*self._block)
        func.prepared_async_call(self._grid, stream,
                self.gpudata, other,
                out.gpudata, self.mem_size)

        return out