Skip to content

Commit

Permalink
复用runtime_op中的一部分内存
Browse files Browse the repository at this point in the history
  • Loading branch information
zjhellofss committed Mar 17, 2024
1 parent ba2d096 commit ab9d5a6
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 6 deletions.
2 changes: 0 additions & 2 deletions include/runtime/runtime_op.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,6 @@ struct RuntimeOperatorBase {

int32_t end_forward_index = -1;

int32_t swap_forward_index = -1;

/// Whether this operator has run in current execution
bool has_forward = false;

Expand Down
4 changes: 0 additions & 4 deletions source/runtime/runtime_op.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -142,9 +142,6 @@ void RuntimeOperatorUtils<float>::InitOperatorOutput(
}

const auto& prev_runtime_op = operators.at(j);
if (runtime_op->forward_index > prev_runtime_op->swap_forward_index) {
prev_runtime_op->end_forward_index = prev_runtime_op->swap_forward_index;
}
if (!prev_runtime_op->output_operands || prev_runtime_op->end_forward_index == -1) {
continue;
}
Expand All @@ -163,7 +160,6 @@ void RuntimeOperatorUtils<float>::InitOperatorOutput(
std::make_shared<ftensor>(output_tensor->raw_ptr(), output_tensor->shapes());
CheckAndReshapeTensor(output_tensors->datas[b], operand_shapes);
}
prev_runtime_op->swap_forward_index = runtime_op->end_forward_index;
prev_runtime_op->end_forward_index = -1;
}
}
Expand Down

0 comments on commit ab9d5a6

Please sign in to comment.