#ifndef GRAPH_BACKEND_DNNL_KERNELS_SDP_PRIMITIVE_CONFIG_HPP
#define GRAPH_BACKEND_DNNL_KERNELS_SDP_PRIMITIVE_CONFIG_HPP
#include <algorithm>
#include <functional>
#include <memory>
#include <string>
#include <utility>
#include <vector>
#include "common/primitive.hpp"
#include "common/sdpa_utils.hpp"
#include "graph/interface/c_types_map.hpp"
#include "graph/interface/value.hpp"
#include "graph/backend/dnnl/subgraph.hpp"
namespace dnnl {
namespace impl {
namespace graph {
namespace dnnl_impl {
using op_ptr = std::shared_ptr<op_t>;
using ltw = logical_tensor_wrapper_t;
struct sdp_primitive_config_t {
public:
sdp_primitive_config_t() = default;
std::shared_ptr<op_t> mm1_ = nullptr;
std::shared_ptr<op_t> mm2_ = nullptr;
std::shared_ptr<value_t> q_ = nullptr;
std::shared_ptr<value_t> k_ = nullptr;
std::shared_ptr<value_t> v_ = nullptr;
std::shared_ptr<value_t> dst_ = nullptr;
std::shared_ptr<value_t> scale_ = nullptr;
std::shared_ptr<value_t> attn_mask_ = nullptr;
std::shared_ptr<value_t> k_scale_ = nullptr;
std::shared_ptr<value_t> v_scale_ = nullptr;
std::shared_ptr<value_t> k_zero_points_ = nullptr;
std::shared_ptr<value_t> v_zero_points_ = nullptr;
bool invert_scale_ = false;
bool quantized_ = false;
bool is_compressed_ = false;
attn_mask_type_t mask_type_ = attn_mask_type::undef;
dim_t kv_head_number_;
std::string softmax_mode_ = "none";
std::shared_ptr<primitive_desc_t> sdpa_pd_;
std::shared_ptr<primitive_t> sdpa_prim_;
private:
op_ptr get_post_op(const op_ptr &op) const;
public:
status_t initial_check(const std::shared_ptr<subgraph_t> &sg,
const std::vector<logical_tensor_t> &inputs,
const std::vector<logical_tensor_t> &outputs);
};
} } } }
#endif