Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
nihui committed Apr 23, 2024
1 parent 29b4930 commit 21c4283
Show file tree
Hide file tree
Showing 7 changed files with 1,058 additions and 1,485 deletions.
14 changes: 2 additions & 12 deletions src/layer/arm/gru_arm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1330,12 +1330,7 @@ int GRU_arm::forward(const Mat& bottom_blob, Mat& top_blob, const Option& opt) c

#if NCNN_ARM82
if (support_fp16_storage && opt.use_fp16_storage && elembits == 16)
{
if (opt.use_fp16_arithmetic)
return forward_fp16sa(bottom_blob, top_blob, opt);
else
return forward_fp16s(bottom_blob, top_blob, opt);
}
return forward_fp16s(bottom_blob, top_blob, opt);
#endif

#if NCNN_BF16
Expand Down Expand Up @@ -1440,12 +1435,7 @@ int GRU_arm::forward(const std::vector<Mat>& bottom_blobs, std::vector<Mat>& top

#if NCNN_ARM82
if (support_fp16_storage && opt.use_fp16_storage && elembits == 16)
{
if (opt.use_fp16_arithmetic)
return forward_fp16sa(bottom_blobs, top_blobs, opt);
else
return forward_fp16s(bottom_blobs, top_blobs, opt);
}
return forward_fp16s(bottom_blobs, top_blobs, opt);
#endif

#if NCNN_BF16
Expand Down
2 changes: 0 additions & 2 deletions src/layer/arm/gru_arm.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,6 @@ class GRU_arm : public GRU
int create_pipeline_fp16s(const Option& opt);
int forward_fp16s(const Mat& bottom_blob, Mat& top_blob, const Option& opt) const;
int forward_fp16s(const std::vector<Mat>& bottom_blobs, std::vector<Mat>& top_blobs, const Option& opt) const;
int forward_fp16sa(const Mat& bottom_blob, Mat& top_blob, const Option& opt) const;
int forward_fp16sa(const std::vector<Mat>& bottom_blobs, std::vector<Mat>& top_blobs, const Option& opt) const;
#endif
#if NCNN_BF16
int create_pipeline_bf16s(const Option& opt);
Expand Down
1,714 changes: 760 additions & 954 deletions src/layer/arm/gru_arm_asimdhp.cpp

Large diffs are not rendered by default.

14 changes: 2 additions & 12 deletions src/layer/arm/lstm_arm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -821,12 +821,7 @@ int LSTM_arm::forward(const Mat& bottom_blob, Mat& top_blob, const Option& opt)

#if NCNN_ARM82
if (support_fp16_storage && opt.use_fp16_storage && elembits == 16)
{
if (opt.use_fp16_arithmetic)
return forward_fp16sa(bottom_blob, top_blob, opt);
else
return forward_fp16s(bottom_blob, top_blob, opt);
}
return forward_fp16s(bottom_blob, top_blob, opt);
#endif

#if NCNN_BF16
Expand Down Expand Up @@ -937,12 +932,7 @@ int LSTM_arm::forward(const std::vector<Mat>& bottom_blobs, std::vector<Mat>& to

#if NCNN_ARM82
if (support_fp16_storage && opt.use_fp16_storage && elembits == 16)
{
if (opt.use_fp16_arithmetic)
return forward_fp16sa(bottom_blobs, top_blobs, opt);
else
return forward_fp16s(bottom_blobs, top_blobs, opt);
}
return forward_fp16s(bottom_blobs, top_blobs, opt);
#endif

#if NCNN_BF16
Expand Down
2 changes: 0 additions & 2 deletions src/layer/arm/lstm_arm.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,6 @@ class LSTM_arm : public LSTM
int create_pipeline_fp16s(const Option& opt);
int forward_fp16s(const Mat& bottom_blob, Mat& top_blob, const Option& opt) const;
int forward_fp16s(const std::vector<Mat>& bottom_blobs, std::vector<Mat>& top_blobs, const Option& opt) const;
int forward_fp16sa(const Mat& bottom_blob, Mat& top_blob, const Option& opt) const;
int forward_fp16sa(const std::vector<Mat>& bottom_blobs, std::vector<Mat>& top_blobs, const Option& opt) const;
#endif
#if NCNN_BF16
int create_pipeline_bf16s(const Option& opt);
Expand Down
Loading

0 comments on commit 21c4283

Please sign in to comment.