@triton.jit
def triton_mlp_activation_forward_kernel(input_ptr, output_ptr, gated: tl.
    constexpr, activation_type: tl.constexpr, n_cols: tl.constexpr,
    block_size: tl.constexpr):
    row_idx = tl.program_id(0).to(tl.int64)
    columns = tl.program_id(1) * block_size + tl.arange(0, block_size)
    output_offsets = n_cols * row_idx + columns
    input_offsets = 2 * n_cols * row_idx + columns if gated else output_offsets
    input_ptr = input_ptr + input_offsets
    mask = columns < n_cols
    input_ = tl.load(input_ptr, mask=mask).to(tl.float32)
    if activation_type == _TritonActivationType.gelu.value:
        tanh_input = 0.79788456 * input_ * (1 + 0.044715 * input_ * input_)
        tanh = 1 - 2 / (1 + tl.exp(2 * tanh_input))
        out = input_ * 0.5 * (1.0 + tanh)
    elif activation_type == _TritonActivationType.silu.value:
        out = input_ / (1 + tl.exp(-input_))
    elif activation_type == _TritonActivationType.relu.value:
        out = tl.where(input_ > 0, input_, 0)
    elif activation_type == _TritonActivationType.squared_relu:
        relu_out = tl.where(input_ > 0, input_, 0)
        out = relu_out * relu_out
    else:
        raise NotImplementedError()
    if gated:
        other = tl.load(input_ptr + n_cols, mask=mask)
        out = out * other
    tl.store(output_ptr + output_offsets, out, mask=mask)
