Skip to content

Commit 49e82bb

Browse files
MyPandaShaoxiangroot
authored andcommitted
fix: remove winograd extend_workspace to run (PaddlePaddle#3168)
1 parent 4b3a6b8 commit 49e82bb

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

lite/kernels/arm/conv_winograd.cc

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,10 +69,8 @@ void WinogradConv<PRECISION(kFloat), PRECISION(kFloat)>::ReInitWhenNeeded() {
6969
(tile_block * ((ic + 3) / 4 + (oc + 3) / 4) * 4 * wino_iw * wino_iw +
7070
8 * wino_iw * wino_iw) *
7171
threads;
72-
ctx.ExtendWorkspace((temp_size + new_input_size) * sizeof(float));
73-
72+
workspace_size_ = (temp_size + new_input_size) * sizeof(float);
7473
weights_.Resize({1, 1, 1, wino_iw * wino_iw * oc_pad * ic_pad});
75-
ctx.ExtendWorkspace((temp_size + new_input_size) * sizeof(float));
7674
void* trans_tmp_ptr = malloc(sizeof(float) * wino_iw * wino_iw * oc * ic);
7775
auto weights_data_ = weights_.mutable_data<float>();
7876
if (!choose_small_) {
@@ -96,6 +94,7 @@ template <>
9694
void WinogradConv<PRECISION(kFloat), PRECISION(kFloat)>::Run() {
9795
auto& param = this->Param<param_t>();
9896
auto& ctx = this->ctx_->template As<ARMContext>();
97+
ctx.ExtendWorkspace(workspace_size_);
9998
const auto* i_data = param.x->data<float>();
10099
const auto* w_data = weights_.data<float>();
101100
const auto* b_data = param.bias ? param.bias->data<float>() : nullptr;

0 commit comments

Comments
 (0)