#ifndef CPU_MATMUL_CPU_MATMUL_PD_HPP
#define CPU_MATMUL_CPU_MATMUL_PD_HPP
#include "common/matmul_pd.hpp"
#include "cpu/cpu_engine.hpp"
namespace dnnl {
namespace impl {
namespace cpu {
namespace matmul {
struct cpu_matmul_pd_t : public matmul_pd_t {
using matmul_pd_t::matmul_pd_t;
bool attr_scales_ok(const std::vector<int> &supported_args
= {DNNL_ARG_SRC, DNNL_ARG_WEIGHTS, DNNL_ARG_DST},
const std::vector<int> &supported_qmodes
= {quantization_mode::static_sazp}) const override {
bool ok = matmul_pd_t::attr_scales_ok(supported_args, supported_qmodes);
const auto &scales = attr()->scales_;
for (int arg : supported_args) {
if (scales.has_default_values(arg)) { continue; }
const auto &g0 = scales.get_group(arg, -2);
const auto &g1 = scales.get_group(arg, -1);
ok = ok
&& IMPLICATION(!scales.get(arg).has_default_groups(),
utils::one_of(1, g0, g1));
}
return ok;
}
};
} } } }
#endif