#if !defined(TORCH_STABLE_ONLY) && !defined(TORCH_TARGET_VERSION)
/*
 * Copyright 2020-2026 Intel Corporation
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 */

#pragma once

#include <ATen/native/TensorIterator.h>

namespace at::native::xpu {

TORCH_XPU_API std::tuple<Tensor, Tensor, Tensor> _thnn_fused_lstm_cell_kernel(
    const Tensor& input_gates,
    const Tensor& hidden_gates,
    const Tensor& cx,
    const std::optional<Tensor>& input_bias_opt,
    const std::optional<Tensor>& hidden_bias_opt);

TORCH_XPU_API std::tuple<Tensor, Tensor, Tensor>
_thnn_fused_lstm_cell_backward_kernel(
    const std::optional<Tensor>& grad_hy_opt,
    const std::optional<Tensor>& grad_cy_opt,
    const Tensor& cx,
    const Tensor& cy,
    const Tensor& workspace,
    bool has_bias);

TORCH_XPU_API std::tuple<Tensor, Tensor> _thnn_fused_gru_cell_kernel(
    const Tensor& input_gates,
    const Tensor& hidden_gates,
    const Tensor& hx,
    const std::optional<Tensor>& input_bias_opt,
    const std::optional<Tensor>& hidden_bias_opt);

TORCH_XPU_API std::tuple<Tensor, Tensor, Tensor, Tensor, Tensor>
_thnn_fused_gru_cell_backward_kernel(
    const Tensor& grad_hy,
    const Tensor& workspace,
    bool has_bias);

} // namespace at::native::xpu

#else
#error "This file should not be included when either TORCH_STABLE_ONLY or TORCH_TARGET_VERSION is defined."
#endif  // !defined(TORCH_STABLE_ONLY) && !defined(TORCH_TARGET_VERSION)
