Compute Library
 22.08
ClKernelBuildingAPI.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2022 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 #ifdef ENABLE_EXPERIMENTAL_DYNAMIC_FUSION
25 
26 #ifndef ARM_COMPUTE_EXPERIMENTAL_CLKERNELBUILDINGAPI_H
27 #define ARM_COMPUTE_EXPERIMENTAL_CLKERNELBUILDINGAPI_H
28 
34 
35 namespace arm_compute
36 {
37 namespace experimental
38 {
39 namespace dynamic_fusion
40 {
42 
43 static constexpr ArgumentID g_arg_placeholder = DependencyGraph::empty_id();
44 
45 /** Intermediate representation of the final, complete kernel source. */
47 {
48 public:
51 
52 private:
53  struct Implementation;
54  std::unique_ptr<Implementation> _impl;
55 
56 public:
58  const Implementation &impl() const;
59 };
60 
61 ///// Kernel Components /////
62 /** Component: Eltwise Operator */
64  ArgumentID src1_id, ArgumentID &dst_id);
65 
66 /** Component: Floor */
68  ArgumentID &dst_id);
69 
70 /** Component: Activation */
72 
73 /** Component: Direct Convolution **/
75  ArgumentID src_id, ArgumentID weight_id, ArgumentID bias_id, ArgumentID &dst_id);
76 
77 Status add_kcomp_store(ClKernelBlueprint &, const StoreType &store_type, ArgumentID src_id, ArgumentID dst_id);
78 
80 
81 ///// Kernel Components /////
82 
83 ///// Building /////
84 
85 /** Update existing merge tensor @p merge_point to point to @p t_id
86  *
87  * @param t_id
88  * @param merge_point
89  * @return Status
90  */
92 
93 /** Get dependency graph
94  *
95  * @return DependencyGraph
96  */
98 
99 /** All information required for building the @ref ClKernelCode */
101 {
102  GpuInfo gpu_info{};
103 };
104 
106 
107 /** Build final kernel source from KernelBlueprint */
109 
110 ///// Building /////
111 
112 ///// Tuning /////
113 
115 
116 ///// Tuning /////
117 
118 } // namespace dynamic_fusion
119 } // namespace experimental
120 } // namespace arm_compute
121 #endif //ARM_COMPUTE_EXPERIMENTAL_CLKERNELBUILDINGAPI_H
122 #endif /* ENABLE_EXPERIMENTAL_DYNAMIC_FUSION */
The dependency graph of a workload, where the nodes are of 2 types: Tensor or Operator Represented as...
Status tune_static(ClExecutionDescriptor &, const ClKernelCode &)
All information required for building the ClKernelCode.
Status add_kcomp_activation(ClKernelBlueprint &, const ClActivationKernelDescriptor &, ArgumentID, ArgumentID &)
Component: Activation.
Store the tensor&#39;s metadata.
Definition: ITensorInfo.h:40
Status class.
Definition: Error.h:52
DependencyGraph get_dependency_graph(const ClKernelBlueprint &blueprint)
Get dependency graph.
Copyright (c) 2017-2022 Arm Limited.
Status update_merge_point(ClKernelBlueprint &bp, ArgumentID t_id, ArgumentID merge_point)
Update existing merge tensor merge_point to point to t_id.
Intermediate representation of the final, complete kernel source.
Contains kernel code to be compiled and run in a ClUnitWorkload.
Definition: ClWorkload.h:100
Descriptor containing information required to run a single ClWorkload.
Definition: ClWorkload.h:91
Status add_kcomp_eltwise_op(ClKernelBlueprint &kernel_blueprint, const ClElementwiseKernelDescriptor &desc, ArgumentID src0_id, ArgumentID src1_id, ArgumentID &dst_id)
Component: Eltwise Operator.
Status add_kcomp_direct_conv2d(ClKernelBlueprint &kernel_blueprint, const ClDirectConv2dKernelDescriptor &direct_conv2d_desc, ArgumentID src_id, ArgumentID weight_id, ArgumentID bias_id, ArgumentID &dst_id)
Component: Direct Convolution.
Status add_kcomp_floor(ClKernelBlueprint &kernel_blueprint, const ClFloorKernelDescriptor &, ArgumentID src_id, ArgumentID &dst_id)
Component: Floor.
Status build(ClWorkload &workload, const OperatorGraph &op_graph, const ClWorkloadContext &ctx)
Build a ClWorkload from an OperatorGraph.
Definition: ClWorkload.cpp:36
GPU information for ClWorkloadContext.
Definition: ClWorkload.h:149
OpTensor add_tensor(OperatorGraph &graph, ITensorInfo &info)
Associate a TensorInfo with a newly created OpTensor in the graph.
Intermediate representation of the final, complete kernel source.
Definition: Common.h:418
Status set_tile_info(ClKernelBlueprint &bp, const TileDescriptor &tile_info)
Status add_kcomp_store(ClKernelBlueprint &kernel_blueprint, const StoreType &store_type, ArgumentID src_tile, ArgumentID dst_tile)