import logging

import triton

from ..utils.pointwise_dynamic import pointwise_dynamic

logger = logging.getLogger("flag_gems").getChild(__name__.lstrip("."))


@pointwise_dynamic(promotion_methods=[(0, 1, "DEFAULT")])
@triton.jit
def bitwise_right_shift_kernel(a, b):
    return a >> b


def bitwise_right_shift(self, other, *, out=None):
    logger.debug("GEMS_CAMBRICON BITWISE_RIGHT_SHIFT")
    return bitwise_right_shift_kernel(self, other, out=out)
