Debian Codegraph @

arm_compute/runtime/experimental/operators/CpuMul.h

raw
1 /*
2 * Copyright (c) 2016-2021, 2023-2024 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_ARM_COMPUTE_RUNTIME_EXPERIMENTAL_OPERATORS_CPUMUL_H
25 #define ACL_ARM_COMPUTE_RUNTIME_EXPERIMENTAL_OPERATORS_CPUMUL_H
26
27 #include "arm_compute/core/ITensorInfo.h"
28 #include "arm_compute/function_info/ActivationLayerInfo.h"
29 #include "arm_compute/runtime/NEON/INEOperator.h"
30
31 #include <memory>
32
33 namespace arm_compute
34 {
35 namespace experimental
36 {
37 namespace op
38 {
39 /** Wrapper class for CpuMul. For information on the functions,
40 * see "src/cpu/operators/CpuMul.h"
41 */
42 class CpuMul : public INEOperator
43 {
44 public:
45 /** Constructor */
46 CpuMul();
47 /** Prevent instances of this class from being copied (As this class contains pointers) */
48 CpuMul(const CpuMul &) = delete;
49 /** Default move constructor */
50 CpuMul(CpuMul &&) = default;
51 /** Prevent instances of this class from being copied (As this class contains pointers) */
52 CpuMul &operator=(const CpuMul &) = delete;
53 /** Default move assignment operator */
54 CpuMul &operator=(CpuMul &&) = default;
55 /** Default destructor */
56 ~CpuMul() override;
57 /** Initialise the kernel's inputs, dst and convertion policy.
58 *
59 * Similar to @ref NEPixelWiseMultiplication::configure()
60 */
61 void configure(ITensorInfo *src1,
62 ITensorInfo *src2,
63 ITensorInfo *dst,
64 float scale,
65 ConvertPolicy overflow_policy,
66 RoundingPolicy rounding_policy,
67 const ActivationLayerInfo &act_info = ActivationLayerInfo());
68 /** Static function to check if given info will lead to a valid configuration
69 *
70 * Similar to @ref NEPixelWiseMultiplication::validate()
71 *
72 * @return a status
73 */
74 static Status validate(const ITensorInfo *src1,
75 const ITensorInfo *src2,
76 const ITensorInfo *dst,
77 float scale,
78 ConvertPolicy overflow_policy,
79 RoundingPolicy rounding_policy,
80 const ActivationLayerInfo &act_info = ActivationLayerInfo());
81
82 // Inherited methods overridden:
83 void run(ITensorPack &tensors) override;
84
85 private:
86 struct Impl;
87 std::unique_ptr<Impl> _impl;
88 };
89 } // namespace op
90 } // namespace experimental
91 } // namespace arm_compute
92 #endif // ACL_ARM_COMPUTE_RUNTIME_EXPERIMENTAL_OPERATORS_CPUMUL_H