Merge pull request #14827 from YashasSamaga:cuda4dnn-csl-low
[platform/upstream/opencv.git] / modules / dnn / src / cuda4dnn / kernels / scale_shift.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_SCALE_HPP
6 #define OPENCV_DNN_SRC_CUDA4DNN_KERNELS_SCALE_HPP
7
8 #include "../csl/stream.hpp"
9 #include "../csl/tensor.hpp"
10
11 #include <cstddef>
12
13 namespace cv { namespace dnn { namespace cuda4dnn { namespace kernels {
14
15     template <class T>
16     void bias1(const csl::Stream& stream, csl::TensorSpan<T> output, csl::TensorView<T> input, T alpha);
17
18     template <class T>
19     void biasN(const csl::Stream& stream,
20         csl::TensorSpan<T> output,
21         csl::TensorView<T> input, std::size_t inner_size,
22         csl::TensorView<T> bias);
23
24     template <class T>
25     void scale1(const csl::Stream& stream, csl::TensorSpan<T> output, csl::TensorView<T> input, T alpha);
26
27     template <class T>
28     void scaleN(const csl::Stream& stream,
29         csl::TensorSpan<T> output,
30         csl::TensorView<T> input, std::size_t inner_size,
31         csl::TensorView<T> weights);
32
33     template <class T>
34     void scale1_with_bias1(const csl::Stream& stream, csl::Span<T> output, csl::View<T> input, T alpha, T beta);
35
36     template <class T>
37     void scaleN_with_biasN(
38         const csl::Stream& stream,
39         csl::TensorSpan<T> output,
40         csl::TensorView<T> input, std::size_t inner_size,
41         csl::TensorView<T> weights, csl::TensorView<T> bias);
42
43 }}}} /* namespace cv::dnn::cuda4dnn::kernels */
44
45 #endif /* OPENCV_DNN_SRC_CUDA4DNN_KERNELS_SCALE_HPP */