Beispiel #1
0
def fmod(arg, mod, stream=None):
    """Return the floating point remainder of the division `arg/mod`,
    for each element in `arg` and `mod`."""
    result = gpuarray.GPUArray(arg.shape, arg.dtype)

    func = elementwise.get_fmod_kernel()
    func.set_block_shape(*arg._block)
    func.prepared_async_call(arg._grid, stream, arg.gpudata, mod.gpudata,
                             result.gpudata, arg.mem_size)

    return result
Beispiel #2
0
def fmod(arg, mod, stream=None):
    """Return the floating point remainder of the division `arg/mod`,
    for each element in `arg` and `mod`."""
    result = gpuarray.GPUArray(arg.shape, arg.dtype)

    func = elementwise.get_fmod_kernel()
    func.set_block_shape(*arg._block)
    func.prepared_async_call(arg._grid, stream,
            arg.gpudata, mod.gpudata, result.gpudata, arg.mem_size)

    return result
Beispiel #3
0
def fmod(arg, mod, stream=None):
    """Return the floating point remainder of the division `arg/mod`,
    for each element in `arg` and `mod`."""
    result = gpuarray.GPUArray(arg.shape, arg.dtype)

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

    func = elementwise.get_fmod_kernel()
    func.prepared_async_call(arg._grid, arg._block, stream, arg.gpudata,
                             mod.gpudata, result.gpudata, arg.mem_size)

    return result
Beispiel #4
0
def fmod(arg, mod, stream=None):
    """Return the floating point remainder of the division `arg/mod`,
    for each element in `arg` and `mod`."""
    result = gpuarray.GPUArray(arg.shape, arg.dtype)

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

    func = elementwise.get_fmod_kernel()
    func.prepared_async_call(arg._grid, arg._block, stream,
            arg.gpudata, mod.gpudata, result.gpudata, arg.mem_size)

    return result