Skip to content

Commit

Permalink
refactoring #2
Browse files Browse the repository at this point in the history
  • Loading branch information
eshoguli committed Aug 25, 2023
1 parent 5f85f35 commit 6124012
Showing 1 changed file with 22 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -69,23 +69,32 @@ template <dnnl::impl::cpu::aarch64::cpu_isa_t isa>
void jit_uni_eltwise_generic<isa>::generate() {
preamble();

// TODO: debug
// const auto eltwise_data = eltwise_data_.front();
// if (eltwise_data.algo == ov::intel_cpu::Algorithm::EltwiseMultiply) {
// std::cout << "generate" << std::endl;
// }

const auto get_precision = []() {
const InferenceEngine::Precision exec_prc = InferenceEngine::Precision::FP32;
return exec_prc;
};
const auto exec_prc = get_precision();

// TODO: debug
// const auto eltwise_data = eltwise_data_.front();
// if (eltwise_data.algo == ov::intel_cpu::Algorithm::EltwiseMultiply) {
// std::cout << "generate" << std::endl;
// }

eltwise_emitter = create_eltwise_emitter(eltwise_data_.front(), exec_prc);
for (size_t i = 1; i < eltwise_data_.size(); ++i) {
post_op_emitters.push_back(create_eltwise_emitter(eltwise_data_[i], exec_prc));
}

// const auto& p = post_ops_.get();
// for (int i = 0; i < post_ops_.len(); ++i) {
// if (!p->entry_[i].is_quantization()) {
// IE_THROW() << "Eltwise jitter error. Unsupported post op detected";
// }
// quantization_injectors.push_back(std::make_shared<jit_uni_quantization_injector_f32<isa>>(
// this, p->entry_[i], vmm_d_weights, vmm_d_bias, reg_d_weights, reg_d_bias));
// }

const auto &jep = jep_;

XReg param2 = abi_param2;
Expand Down Expand Up @@ -302,10 +311,10 @@ void jit_uni_eltwise_generic<isa>::generate() {

postamble();

eltwise_emitter->emit_data();
for (size_t i = 0; i < post_op_emitters.size(); i++) {
post_op_emitters[i]->emit_data();
}
// eltwise_emitter->emit_data();
// for (size_t i = 0; i < post_op_emitters.size(); i++) {
// post_op_emitters[i]->emit_data();
// }
}

template <dnnl::impl::cpu::aarch64::cpu_isa_t isa>
Expand Down Expand Up @@ -493,8 +502,10 @@ void jit_uni_eltwise_generic<isa>::apply_post_ops() {
post_op_emitters[eltwise_post_op_idx]->emit_code(in_idxs, out_idxs, aux_idxs);

eltwise_post_op_idx++;
} else {
} else if (ops_list_[i] == ov::intel_cpu::Type::FakeQuantize) {
// TODO: FakeQuantize is not supported
IE_THROW(Unexpected) << "Eltwise jit kernel: FakeQuantize is not supported";
} else {
IE_THROW(Unexpected) << "Eltwise jit kernel: unexpected operation type";
}
}
Expand Down

0 comments on commit 6124012

Please sign in to comment.