24.02.1
ElementwiseBinary.h
Go to the documentation of this file.
1
/*
2
* Copyright (c) 2023 Arm Limited.
3
*
4
* SPDX-License-Identifier: MIT
5
*
6
* Permission is hereby granted, free of charge, to any person obtaining a copy
7
* of this software and associated documentation files (the "Software"), to
8
* deal in the Software without restriction, including without limitation the
9
* rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
10
* sell copies of the Software, and to permit persons to whom the Software is
11
* furnished to do so, subject to the following conditions:
12
*
13
* The above copyright notice and this permission notice shall be included in all
14
* copies or substantial portions of the Software.
15
*
16
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22
* SOFTWARE.
23
*/
24
#ifndef ACL_SRC_DYNAMIC_FUSION_SKETCH_GPU_COMPONENTS_UTILS_TYPE_PRINTER_ELEMENTWISEBINARY
25
#define ACL_SRC_DYNAMIC_FUSION_SKETCH_GPU_COMPONENTS_UTILS_TYPE_PRINTER_ELEMENTWISEBINARY
26
27
#include "
src/dynamic_fusion/sketch/gpu/components/cl/ClComponentElementwiseBinary.h
"
28
29
#include <ostream>
30
#include <sstream>
31
#include <string>
32
33
namespace
arm_compute
34
{
35
/** Type printers for all types related to the component @ref ClComponentElementwiseBinary
36
*/
37
38
using namespace
experimental::dynamic_fusion;
39
40
/** Formatted output of the pute::experimental::dynamic_fusion::ClComponentElementwiseBinary::Attributes::ElementwiseOp type.
41
*
42
* @param[out] os Output stream.
43
* @param[in] op arm_compute::experimental::dynamic_fusion::ClComponentElementwiseBinary::Attributes::ElementwiseOp type to output.
44
*
45
* @return Modified output stream.
46
*/
47
inline ::std::ostream &
operator<<
(::std::ostream &os,
const
ClComponentElementwiseBinary::Attributes::ElementwiseOp
&op)
48
{
49
const
std::map<ClComponentElementwiseBinary::Attributes::ElementwiseOp, std::string> op_name = {
50
{
ClComponentElementwiseBinary::Attributes::ElementwiseOp::Add
,
"add"
},
51
{
ClComponentElementwiseBinary::Attributes::ElementwiseOp::Div
,
"div"
},
52
{
ClComponentElementwiseBinary::Attributes::ElementwiseOp::Max
,
"max"
},
53
{
ClComponentElementwiseBinary::Attributes::ElementwiseOp::Min
,
"min"
},
54
{
ClComponentElementwiseBinary::Attributes::ElementwiseOp::Mul
,
"mul"
},
55
{
ClComponentElementwiseBinary::Attributes::ElementwiseOp::Power
,
"power"
},
56
{
ClComponentElementwiseBinary::Attributes::ElementwiseOp::Prelu
,
"prelu"
},
57
{
ClComponentElementwiseBinary::Attributes::ElementwiseOp::SquaredDiff
,
"squareddiff"
},
58
{
ClComponentElementwiseBinary::Attributes::ElementwiseOp::Sub
,
"sub"
}};
59
os << op_name.at(op);
60
return
os;
61
}
62
/** Formatted output of the arm_compute::experimental::dynamic_fusion::ClComponentElementwiseBinary::Attributes::ElementwiseOp type.
63
*
64
* @param[in] op arm_compute::experimental::dynamic_fusion::ClComponentElementwiseBinary::Attributes::ElementwiseOp type to output.
65
*
66
* @return Formatted string.
67
*/
68
inline
std::string
to_string
(
const
ClComponentElementwiseBinary::Attributes::ElementwiseOp
&op)
69
{
70
std::stringstream
str
;
71
str
<< op;
72
return
str
.str();
73
}
74
}
// namespace arm_compute
75
#endif
/* ACL_SRC_DYNAMIC_FUSION_SKETCH_GPU_COMPONENTS_UTILS_TYPE_PRINTER_ELEMENTWISEBINARY */
arm_compute::experimental::dynamic_fusion::ElementwiseBinaryCommonAttributes::ElementwiseOp::Power
@ Power
x ^ y
arm_compute::experimental::dynamic_fusion::ElementwiseBinaryCommonAttributes::ElementwiseOp::Add
@ Add
(x + y)
arm_compute::experimental::dynamic_fusion::ElementwiseBinaryCommonAttributes::ElementwiseOp::SquaredDiff
@ SquaredDiff
(x - y)^2
caffe_mnist_image_extractor.str
str
Definition:
caffe_mnist_image_extractor.py:21
arm_compute::experimental::dynamic_fusion::ElementwiseBinaryCommonAttributes::ElementwiseOp::Prelu
@ Prelu
y*x if x < 0, x otherwise
arm_compute::experimental::dynamic_fusion::ElementwiseBinaryCommonAttributes::ElementwiseOp::Sub
@ Sub
(x - y)
arm_compute::experimental::dynamic_fusion::ElementwiseBinaryCommonAttributes::ElementwiseOp::Max
@ Max
Max(x, y)
arm_compute::experimental::dynamic_fusion::ElementwiseBinaryCommonAttributes::ElementwiseOp::Div
@ Div
(x / y)
ClComponentElementwiseBinary.h
arm_compute::experimental::dynamic_fusion::ElementwiseBinaryCommonAttributes::ElementwiseOp
ElementwiseOp
Definition:
GpuElementwiseBinaryCommon.h:41
arm_compute::experimental::dynamic_fusion::ElementwiseBinaryCommonAttributes::ElementwiseOp::Min
@ Min
Min(x, y)
arm_compute
Copyright (c) 2017-2024 Arm Limited.
Definition:
introduction.dox:24
arm_compute::to_string
std::string to_string(const ClComponentElementwiseBinary::Attributes::ElementwiseOp &op)
Formatted output of the arm_compute::experimental::dynamic_fusion::ClComponentElementwiseBinary::Attr...
Definition:
ElementwiseBinary.h:68
arm_compute::experimental::dynamic_fusion::ElementwiseBinaryCommonAttributes::ElementwiseOp::Mul
@ Mul
(x * y)
arm_compute::operator<<
inline ::std::ostream & operator<<(::std::ostream &os, const ClComponentElementwiseBinary::Attributes::ElementwiseOp &op)
Formatted output of the pute::experimental::dynamic_fusion::ClComponentElementwiseBinary::Attributes:...
Definition:
ElementwiseBinary.h:47
src
dynamic_fusion
sketch
gpu
components
utils
type_printer
ElementwiseBinary.h
Generated on Mon Mar 18 2024 11:32:01 for Compute Library by
1.8.17