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