#ifndef GRAPH_BACKEND_DNNL_LAYOUT_ID_MGR_HPP
#define GRAPH_BACKEND_DNNL_LAYOUT_ID_MGR_HPP
#include <mutex>
#include "graph/utils/any.hpp"
#include "graph/utils/utils.hpp"
#include "oneapi/dnnl/dnnl.hpp"
namespace dnnl {
namespace impl {
namespace graph {
namespace dnnl_impl {
class dnnl_layout_id_manager_t {
friend class dnnl_backend_t;
public:
graph::utils::optional_t<memory::desc> get_mem_desc(size_t layout_id) const;
graph::utils::optional_t<size_t> set_mem_desc(const memory::desc &md);
private:
dnnl_layout_id_manager_t() = default;
mutable struct {
std::vector<memory::desc> data_;
mutable std::mutex m_;
} mem_descs_;
};
} } } }
#endif