[CPU] Fix memory leak in binconv (#19999)

This commit is contained in:
Yuan Hu authored and GitHub committed 2023-09-25 12:45:25 +04:00
1 parent 9091afc26c
commit ec45107723
1 file changed
+5 -4
+5 -4
View File
@@ -8,6 +8,7 @@
#include "eltwise.h"
#include "fake_quantize.h"
#include "conv.h"
#include <memory>
#include <string>
#include <vector>
#include <dnnl_types.h>
@@ -63,10 +64,10 @@ struct jit_uni_bin_conv_kernel_f32 : public jit_uni_bin_conv_kernel, public jit_
for (int i = 0; i < end_idx; i++) {
auto &post_op = p.entry_[i];
if (post_op.is_eltwise()) {
eltwise_injectors.push_back(new jit_uni_eltwise_injector_f32<isa>(
eltwise_injectors.push_back(std::make_shared<jit_uni_eltwise_injector_f32<isa>>(
this, post_op.eltwise, true, eltwise_reserved, mask_post_op_reserved));
} else if (post_op.is_depthwise()) {
depthwise_injectors.push_back(new jit_uni_depthwise_injector_f32<isa>(
depthwise_injectors.push_back(std::make_shared<jit_uni_depthwise_injector_f32<isa>>(
this, post_op, mask_post_op_reserved));
}
}
@@ -210,8 +211,8 @@ private:
Xbyak::Label l_table;
nstl::vector<jit_uni_eltwise_injector_f32<isa>*> eltwise_injectors;
nstl::vector<jit_uni_depthwise_injector_f32<isa>*> depthwise_injectors;
nstl::vector<std::shared_ptr<jit_uni_eltwise_injector_f32<isa>>> eltwise_injectors;
nstl::vector<std::shared_ptr<jit_uni_depthwise_injector_f32<isa>>> depthwise_injectors;
void cvt2ps(dnnl::memory::data_type type_in, Vmm vmm_in, const Xbyak::Operand &op, bool scalar_load) {
Xmm xmm_in = Xmm(vmm_in.getIdx());