Path: blob/master/modules/dnn/src/ocl4dnn/include/math_functions.hpp
16348 views
/*M///////////////////////////////////////////////////////////////////////////////////////1//2// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.3//4// By downloading, copying, installing or using the software you agree to this license.5// If you do not agree to this license, do not download, install,6// copy or use the software.7//8//9// License Agreement10// For Open Source Computer Vision Library11//12// Copyright (C) 2017, Intel Corporation, all rights reserved.13// Copyright (c) 2016-2017 Fabian David Tschopp, all rights reserved.14// Third party copyrights are property of their respective owners.15//16// Redistribution and use in source and binary forms, with or without modification,17// are permitted provided that the following conditions are met:18//19// * Redistribution's of source code must retain the above copyright notice,20// this list of conditions and the following disclaimer.21//22// * Redistribution's in binary form must reproduce the above copyright notice,23// this list of conditions and the following disclaimer in the documentation24// and/or other materials provided with the distribution.25//26// * The name of the copyright holders may not be used to endorse or promote products27// derived from this software without specific prior written permission.28//29// This software is provided by the copyright holders and contributors "as is" and30// any express or implied warranties, including, but not limited to, the implied31// warranties of merchantability and fitness for a particular purpose are disclaimed.32// In no event shall the Intel Corporation or contributors be liable for any direct,33// indirect, incidental, special, exemplary, or consequential damages34// (including, but not limited to, procurement of substitute goods or services;35// loss of use, data, or profits; or business interruption) however caused36// and on any theory of liability, whether in contract, strict liability,37// or tort (including negligence or otherwise) arising in any way out of38// the use of this software, even if advised of the possibility of such damage.39//40//M*/4142#ifndef _OPENCV_GREENTEA_MATH_FUNCTIONS_HPP_43#define _OPENCV_GREENTEA_MATH_FUNCTIONS_HPP_44#include "common.hpp"4546namespace cv47{48namespace dnn49{50namespace ocl4dnn51{5253enum CBLAS_TRANSPOSE {CblasNoTrans=111, CblasTrans=112, CblasConjTrans=113};5455template<typename Dtype>56bool ocl4dnnGEMMCommon(const CBLAS_TRANSPOSE TransB,57const int32_t M, const int32_t N, const int32_t K,58const UMat A, const UMat B,59const UMat B_image, UMat C,60const size_t max_image_size);6162template<typename Dtype>63ocl::Image2D ocl4dnnGEMMCopyBufferToImage(UMat buffer, int offset,64bool is_matrix_a, bool transpose,65bool padding, int padded_height,66int padded_width, int height,67int width, int ld);6869template<typename Dtype>70bool ocl4dnnGEMV(const CBLAS_TRANSPOSE TransA,71const int32_t M, const int32_t N, const Dtype alpha,72const UMat A, const int32_t offA, const UMat x,73const int32_t offx, const Dtype beta, UMat y,74const int32_t offy);7576template<typename Dtype>77bool ocl4dnnAXPY(const int32_t N, const Dtype alpha,78const UMat x, const int32_t offx, UMat y,79const int32_t offy);8081} // namespace ocl4dnn82} // namespace dnn83} // namespce cv8485#endif868788