Exemplo n.º 1
0
def frexp(arg, stream=None):
    """Return a tuple `(significands, exponents)` such that 
    `arg == significand * 2**exponent`.
    """
    sig = gpuarray.GPUArray(arg.shape, arg.dtype)
    expt = gpuarray.GPUArray(arg.shape, arg.dtype)

    func = elementwise.get_frexp_kernel()
    func.set_block_shape(*arg._block)
    func.prepared_async_call(arg._grid, stream, arg.gpudata, sig.gpudata,
                             expt.gpudata, arg.mem_size)

    return sig, expt
Exemplo n.º 2
0
def frexp(arg, stream=None):
    """Return a tuple `(significands, exponents)` such that
    `arg == significand * 2**exponent`.
    """
    sig = gpuarray.GPUArray(arg.shape, arg.dtype)
    expt = gpuarray.GPUArray(arg.shape, arg.dtype)

    func = elementwise.get_frexp_kernel()
    func.set_block_shape(*arg._block)
    func.prepared_async_call(arg._grid, stream,
            arg.gpudata, sig.gpudata, expt.gpudata, arg.mem_size)

    return sig, expt
Exemplo n.º 3
0
def frexp(arg, stream=None):
    """Return a tuple `(significands, exponents)` such that
    `arg == significand * 2**exponent`.
    """
    if not arg.flags.forc:
        raise RuntimeError("only contiguous arrays may "
                           "be used as arguments to this operation")

    sig = gpuarray.GPUArray(arg.shape, arg.dtype)
    expt = gpuarray.GPUArray(arg.shape, arg.dtype)

    func = elementwise.get_frexp_kernel()
    func.prepared_async_call(arg._grid, arg._block, stream, arg.gpudata,
                             sig.gpudata, expt.gpudata, arg.mem_size)

    return sig, expt
Exemplo n.º 4
0
def frexp(arg, stream=None):
    """Return a tuple `(significands, exponents)` such that
    `arg == significand * 2**exponent`.
    """
    if not arg.flags.forc:
        raise RuntimeError("only contiguous arrays may "
                "be used as arguments to this operation")

    sig = gpuarray.GPUArray(arg.shape, arg.dtype)
    expt = gpuarray.GPUArray(arg.shape, arg.dtype)

    func = elementwise.get_frexp_kernel()
    func.prepared_async_call(arg._grid, arg._block, stream,
            arg.gpudata, sig.gpudata, expt.gpudata, arg.mem_size)

    return sig, expt