// Copyright (C) 2018-2026 Intel Corporation
// SPDX-License-Identifier: Apache-2.0
//

#pragma once
#include <cpu/x64/cpu_isa_traits.hpp>
#include <cpu/x64/jit_generator.hpp>
#include <cstddef>
#include <cstdint>
#include <memory>
#include <set>
#include <vector>

#include "cache/multi_cache.h"
#include "cpu_types.h"
#include "emitters/tpp/common/kernel_executors/brgemm.hpp"
#include "jit_tpp_emitter.hpp"
#include "openvino/core/node.hpp"
#include "openvino/core/type/element_type.hpp"
#include "snippets/kernel_executor_table.hpp"
#include "snippets/lowered/expression.hpp"

namespace ov::intel_cpu {

class BrgemmTppEmitter : public TppEmitter {
public:
    BrgemmTppEmitter(dnnl::impl::cpu::x64::jit_generator_t* h,
                     dnnl::impl::cpu::x64::cpu_isa_t isa,
                     const ov::snippets::lowered::ExpressionPtr& expr,
                     const snippets::KernelExecutorTablePtr& kernel_table,
                     const ov::intel_cpu::MultiCacheWeakPtr& compiled_kernel_cache);

    size_t get_inputs_num() const override {
        return 2;
    }
    static std::set<std::vector<element::Type>> get_supported_precisions(
        const std::shared_ptr<ov::Node>& node = nullptr);

    const uintptr_t get_execute_function_ptr() const override;
    const uintptr_t get_compiled_kernel_ptr() const override;

protected:
    void validate_arguments(const std::vector<size_t>& in, const std::vector<size_t>& out) const override;
    static void validate_subtensors(const VectorDims& in_0, const VectorDims& in_1, const VectorDims& out_0);

private:
    std::shared_ptr<tpp::BrgemmKernelExecutor> m_kernel_executor = nullptr;
};

}  // namespace ov::intel_cpu
