Skip to content

Commit

Permalink
Patch VMLA performance by reserving vector size before pushing to it. (
Browse files Browse the repository at this point in the history
  • Loading branch information
ScottTodd authored Apr 5, 2021
1 parent f2f0041 commit 6936ee7
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions iree/modules/vmla/op_kernels_generic.h
Original file line number Diff line number Diff line change
Expand Up @@ -961,6 +961,7 @@ inline void ReduceDimension(absl::Span<const T> src_buffer,
// TODO(scotttodd): Clean this up somehow, share across recursion levels?
size_t dst_size = src_shape.size() - reduce_dims.size();
std::vector<int> dst_indices;
dst_indices.reserve(src_indices.size());
for (size_t i = 0; i < src_indices.size(); ++i) {
if (std::find(std::begin(reduce_dims), std::end(reduce_dims), i) ==
std::end(reduce_dims)) {
Expand Down

0 comments on commit 6936ee7

Please sign in to comment.