Merge pull request #14827 from YashasSamaga:cuda4dnn-csl-low
[platform/upstream/opencv.git] / modules / dnn / src / cuda4dnn / kernels / activations.hpp
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 #ifndef OPENCV_DNN_SRC_CUDA4DNN_KERNELS_ACTIVATIONS_HPP
6 #define OPENCV_DNN_SRC_CUDA4DNN_KERNELS_ACTIVATIONS_HPP
7
8 #include "../csl/stream.hpp"
9 #include "../csl/span.hpp"
10
11 #include <cstddef>
12
13 namespace cv { namespace dnn { namespace cuda4dnn { namespace kernels {
14
15     template <class T>
16     void abs(const csl::Stream& stream, csl::Span<T> output, csl::View<T> input);
17
18     template <class T>
19     void tanh(const csl::Stream& stream, csl::Span<T> output, csl::View<T> input);
20
21     template <class T>
22     void sigmoid(const csl::Stream& stream, csl::Span<T> output, csl::View<T> input);
23
24     template <class T>
25     void bnll(const csl::Stream& stream, csl::Span<T> output, csl::View<T> input);
26
27     template <class T>
28     void elu(const csl::Stream& stream, csl::Span<T> output, csl::View<T> input);
29
30     template <class T>
31     void relu(const csl::Stream& stream, csl::Span<T> output, csl::View<T> input, T slope);
32
33     template <class T>
34     void clipped_relu(const csl::Stream& stream, csl::Span<T> output, csl::View<T> input, T floor, T ceiling);
35
36     template <class T>
37     void axiswise_relu(const csl::Stream& stream, csl::Span<T> output, csl::View<T> input, std::size_t inner_size, csl::View<T> slope);
38
39     template <class T>
40     void power(const csl::Stream& stream, csl::Span<T> output, csl::View<T> input, T exp, T scale, T shift);
41
42 }}}} /* namespace cv::dnn::cuda4dnn::kernels */
43
44 #endif /* OPENCV_DNN_SRC_CUDA4DNN_KERNELS_ACTIVATIONS_HPP */