1 // This file is part of OpenCV project. 2 // It is subject to the license terms in the LICENSE file found in the top-level directory 3 // of this distribution and at http://opencv.org/license.html. 4 // 5 // Copyright (C) 2018, Intel Corporation, all rights reserved. 6 // Third party copyrights are property of their respective owners. 7 8 #ifndef OPENCV_DNN_VKCOM_OP_RELU_HPP 9 #define OPENCV_DNN_VKCOM_OP_RELU_HPP 10 11 #include "vkcom.hpp" 12 #include "op_base.hpp" 13 14 namespace cv { namespace dnn { namespace vkcom { 15 16 #ifdef HAVE_VULKAN 17 18 class OpReLU: public OpBase 19 { 20 public: 21 OpReLU(const float slope = 1.f); 22 bool forward(Tensor& in, Tensor& out); 23 void reshapeOutTensor(Tensor& in, Tensor& out); 24 virtual bool forward(std::vector<Tensor>& ins, 25 std::vector<Tensor>& blobs, 26 std::vector<Tensor>& outs) CV_OVERRIDE; 27 private: 28 bool computeGroupCount(); 29 int total_; 30 float slope_; 31 }; 32 33 #endif // HAVE_VULKAN 34 35 }}} // namespace cv::dnn::vkcom 36 37 #endif // OPENCV_DNN_VKCOM_OP_RELU_HPP 38