Skip to content

Commit

Permalink
optimize pad with rvv.
Browse files Browse the repository at this point in the history
  • Loading branch information
zhangyang2057 committed Mar 3, 2025
1 parent b2f080c commit c0312cf
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/Native/src/kernels/stackvm/reference/pad.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
#include <nncase/runtime/host_buffer.h>
#include <nncase/runtime/runtime_op_utility.h>
#include <nncase/runtime/util.h>
#include "../optimized/opt_common.h"

using namespace nncase;
using namespace nncase::runtime;
Expand Down Expand Up @@ -101,9 +102,7 @@ pad_impl(const T *input, T *output, gsl::span<const size_t> in_shape,

template <class T>
void copy_data_v(T *src, T *dst, int blocks_in, int blocks_out, T value) {
for (int i = 0; i < blocks_in; ++i) {
dst[i] = src[i];
}
opt_memcpy(dst, src, blocks_in * sizeof(T));
dst += blocks_in;
for (int i = 0; i < blocks_out - blocks_in; ++i) {
dst[i] = value;
Expand Down

0 comments on commit c0312cf

Please sign in to comment.