Elffuss BraidHub

kikocis/ncnn public

master · 1.4 KiBRawPermalink
1// Xavier Hsinyuan is pleased to support the open source community by making ncnn available.
2//
3// Copyright (C) 2021 Xavier Hsinyuan <thelastlinex@hotmail.com>. All rights reserved.
4//
5// Licensed under the BSD 3-Clause License (the "License"); you may not use this
6// file except in compliance with the License. You may obtain a copy of the
7// License at
8//
9// https://opensource.org/licenses/BSD-3-Clause
10//
11// Unless required by applicable law or agreed to in writing, software
12// distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
13// WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
14// License for the specific language governing permissions and limitations under
15// the License.
16
17#ifndef LAYER_BINARYOP_RISCV_H
18#define LAYER_BINARYOP_RISCV_H
19
20#include "binaryop.h"
21
22namespace ncnn {
23
24class BinaryOp_riscv : public BinaryOp
25{
26public:
27 BinaryOp_riscv();
28
29 virtual int forward(const std::vector<Mat>& bottom_blobs, std::vector<Mat>& top_blobs, const Option& opt) const;
30
31 virtual int forward_inplace(Mat& bottom_top_blob, const Option& opt) const;
32
33protected:
34#if __riscv_vector && __riscv_zfh
35 int forward_fp16s(const std::vector<Mat>& bottom_blobs, std::vector<Mat>& top_blobs, const Option& opt) const;
36 int forward_inplace_fp16s(Mat& bottom_top_blob, const Option& opt) const;
37#endif
38};
39
40} // namespace ncnn
41
42#endif // LAYER_BINARYOP_RISCV_H