def METHOD_NAME(op, func_name):
    '''monkey patch __sub__, __add__, ...'''
    _kernel = create_kernel(op)
    _ckernel = create_ckernel(op)
    old_v = getattr(pycuda.gpuarray.GPUArray, func_name)
    def _patch_binop(self, other):
        if isinstance(other, pycuda.gpuarray.GPUArray) and other.shape in [(),(1,)]:
            if 'c' in (self.dtype.kind, other.dtype.kind):
                self = self.astype(complex)
                out = pycuda.gpuarray.empty_like(self)
                _ckernel(out, self, other.astype(complex))
            else:
                if self.dtype != np.float64 or other.dtype != np.float64:
                    raise NotImplementedError(
                        'pmath: Oops. So far only double or complex '
                        'operations with GPU scalars have been '
                        'implemented. Please convert both operands at '
                        'least to np.float64. Or implement a more '
                        'general monkey patching of GPUArray operators.'
                    )
                out = pycuda.gpuarray.empty_like(self)
                _kernel(out, self, other)
            return out
        else:
            return old_v(self, other)
    return _patch_binop