def _scale_inplace(a, x_gpu):
    """
    Scale an array by a specified value in-place.
    """

    # Cache the kernel to avoid invoking the compiler if the
    # specified scale factor and array type have already been encountered:
    try:
        func = _scale_inplace.cache[(a, x_gpu.dtype)]
    except __HOLE__:
        ctype = tools.dtype_to_ctype(x_gpu.dtype)
        func = el.ElementwiseKernel(
            "{ctype} a, {ctype} *x".format(ctype=ctype),
            "x[i] /= a")
        _scale_inplace.cache[(a, x_gpu.dtype)] = func
    func(x_gpu.dtype.type(a), x_gpu)
dataset/ETHPy150Open lebedov/scikit-cuda/skcuda/fft.py/_scale_inplace