#ifndef GPU_INTEL_GEMM_PRIMITIVE_HPP
#define GPU_INTEL_GEMM_PRIMITIVE_HPP
#include "common/c_types_map.hpp"
#include "common/primitive.hpp"
#include "gpu/intel/gemm/exec_types.hpp"
#include "gpu/intel/primitive.hpp"
namespace dnnl {
namespace impl {
namespace gpu {
namespace intel {
namespace gemm {
struct primitive_t : public intel::primitive_t {
using intel::primitive_t::primitive_t;
virtual status_t execute(const exec_ctx_t &ctx) const = 0;
status_t execute(const impl::exec_ctx_t &ctx) const override {
exec_args_t args;
args.a = &CTX_IN_STORAGE(DNNL_ARG_A);
args.b = &CTX_IN_STORAGE(DNNL_ARG_B);
args.c = &CTX_OUT_STORAGE(DNNL_ARG_C);
args.a_zero_point
= &CTX_IN_STORAGE(DNNL_ARG_ATTR_ZERO_POINTS | DNNL_ARG_A);
args.b_zero_point
= &CTX_IN_STORAGE(DNNL_ARG_ATTR_ZERO_POINTS | DNNL_ARG_B);
args.c_zero_point
= &CTX_IN_STORAGE(DNNL_ARG_ATTR_ZERO_POINTS | DNNL_ARG_C);
args.a_scales = &CTX_IN_STORAGE(DNNL_ARG_ATTR_SCALES | DNNL_ARG_A);
args.b_scales = &CTX_IN_STORAGE(DNNL_ARG_ATTR_SCALES | DNNL_ARG_B);
args.c_scales = &CTX_IN_STORAGE(DNNL_ARG_ATTR_SCALES | DNNL_ARG_C);
return execute({ctx, args});
}
};
inline const primitive_t *gemm(const std::shared_ptr<impl::primitive_t> &p) {
return utils::downcast<primitive_t *>(p.get());
}
} } } } }
#endif