24.04
GpuTanh.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
25
#ifndef ARM_COMPUTE_DYNAMIC_FUSION_SKETCH_GPU_OPERATORS_GPUTANH
26
#define ARM_COMPUTE_DYNAMIC_FUSION_SKETCH_GPU_OPERATORS_GPUTANH
27
28
#include "
arm_compute/core/Types.h
"
29
30
namespace
arm_compute
31
{
32
namespace
experimental
33
{
34
namespace
dynamic_fusion
35
{
36
/** Forward declaration */
37
class
GpuWorkloadContext;
38
class
GpuWorkloadSketch;
39
40
/** Operator interface. */
41
class
GpuTanh
final
42
{
43
public
:
44
/** Create an operator and fuse it into the workload sketch.
45
* @note If @ref validate_op() fails, the creation also fails and may throw an error.
46
* @note If @ref validate_op() fails, @p sketch remains unchanged and valid.
47
*
48
* Valid data type configurations:
49
* |src |dst |
50
* |:--------------|:--------------|
51
* |F16 |F16 |
52
* |F32 |F32 |
53
*
54
* Valid data layouts:
55
* - All
56
*
57
* @param[in, out] sketch Workload sketch into which the operator will be fused
58
* @param[in] src Source tensor info. Data types supported: F16/F32.
59
*
60
* @return Pointer for the destination tensor info
61
*/
62
static
ITensorInfo
*
create_op
(
GpuWorkloadSketch
&
sketch
,
ITensorInfo
*
src
);
63
64
/** Check if the operator configuration is supported, irrespective of fusion
65
*
66
* @param[in] context Workload context within which the operator is running
67
* @param[in] src Source tensor info. Data types supported: F16/F32.
68
*
69
* @return Status
70
*/
71
static
Status
is_supported_op
(
const
GpuWorkloadContext
&
context
,
const
ITensorInfo
*
src
);
72
73
/** Validate the operator and check if it can be fused into the workload sketch.
74
*
75
* Parameters are similar to @ref GpuTanh::create_op()
76
*
77
* @return Status
78
*/
79
static
Status
validate_op
(
const
GpuWorkloadSketch
&
sketch
,
const
ITensorInfo
*
src
);
80
};
81
82
}
// namespace dynamic_fusion
83
}
// namespace experimental
84
}
// namespace arm_compute
85
86
#endif //ARM_COMPUTE_DYNAMIC_FUSION_SKETCH_GPU_OPERATORS_GPUTANH
arm_compute::test::validation::src
SimpleTensor< float > src
Definition:
DFT.cpp:155
arm_compute::experimental::dynamic_fusion::GpuTanh::create_op
static ITensorInfo * create_op(GpuWorkloadSketch &sketch, ITensorInfo *src)
Create an operator and fuse it into the workload sketch.
Definition:
GpuTanh.cpp:112
arm_compute::test::validation::sketch
GpuWorkloadSketch sketch
Definition:
DirectConv2d.cpp:168
Types.h
arm_compute::experimental::dynamic_fusion::GpuWorkloadSketch
A descriptor of a workload of operators.
Definition:
GpuWorkloadSketch.h:42
arm_compute::Status
Status class.
Definition:
Error.h:52
arm_compute::experimental::dynamic_fusion::GpuWorkloadContext
Provide context necessary for the creation and configuration of a workload e.g.
Definition:
GpuWorkloadContext.h:57
arm_compute::test::validation::context
auto context
Definition:
DirectConv2d.cpp:167
arm_compute::experimental::dynamic_fusion::GpuTanh::validate_op
static Status validate_op(const GpuWorkloadSketch &sketch, const ITensorInfo *src)
Validate the operator and check if it can be fused into the workload sketch.
Definition:
GpuTanh.cpp:87
arm_compute
Copyright (c) 2017-2024 Arm Limited.
Definition:
introduction.dox:24
arm_compute::ITensorInfo
Store the tensor's metadata.
Definition:
ITensorInfo.h:44
arm_compute::experimental::dynamic_fusion::GpuTanh::is_supported_op
static Status is_supported_op(const GpuWorkloadContext &context, const ITensorInfo *src)
Check if the operator configuration is supported, irrespective of fusion.
Definition:
GpuTanh.cpp:82
arm_compute::experimental::dynamic_fusion::GpuTanh
Operator interface.
Definition:
GpuTanh.h:41
arm_compute
dynamic_fusion
sketch
gpu
operators
GpuTanh.h
Generated on Mon Apr 29 2024 10:53:52 for Compute Library by
1.8.17