diff options
author | Gunes Bayir <gunes.bayir@arm.com> | 2022-03-28 21:32:33 +0100 |
---|---|---|
committer | SiCong Li <sicong.li@arm.com> | 2022-04-13 10:36:30 +0000 |
commit | 16c5697085c256c19fb8ba4bef6188d61f30a88b (patch) | |
tree | 609bfe2082c939ff37bdf6ef37bc22fc071bd934 /src/core/experimental/dynamic_fusion/ClKernelBuildingImpl/components/ClStoreKernelComponents.cpp | |
parent | 5d606cccaabdfc435734c9fb51e11f14f3724a23 (diff) | |
download | ComputeLibrary-16c5697085c256c19fb8ba4bef6188d61f30a88b.tar.gz |
Add DirectConvolution2D kernel component for dynamic fusion
Resolves: COMPMID-5156
Change-Id: I438da924cb80d3bce72106b06ca7181e0606bd01
Signed-off-by: Gunes Bayir <gunes.bayir@arm.com>
Signed-off-by: Giorgio Arena <giorgio.arena@arm.com>
Reviewed-on: https://review.mlplatform.org/c/ml/ComputeLibrary/+/7399
Reviewed-by: SiCong Li <sicong.li@arm.com>
Comments-Addressed: Arm Jenkins <bsgcomp@arm.com>
Tested-by: Arm Jenkins <bsgcomp@arm.com>
Diffstat (limited to 'src/core/experimental/dynamic_fusion/ClKernelBuildingImpl/components/ClStoreKernelComponents.cpp')
-rw-r--r-- | src/core/experimental/dynamic_fusion/ClKernelBuildingImpl/components/ClStoreKernelComponents.cpp | 54 |
1 files changed, 54 insertions, 0 deletions
diff --git a/src/core/experimental/dynamic_fusion/ClKernelBuildingImpl/components/ClStoreKernelComponents.cpp b/src/core/experimental/dynamic_fusion/ClKernelBuildingImpl/components/ClStoreKernelComponents.cpp index 2d7b46616f..5f023ba528 100644 --- a/src/core/experimental/dynamic_fusion/ClKernelBuildingImpl/components/ClStoreKernelComponents.cpp +++ b/src/core/experimental/dynamic_fusion/ClKernelBuildingImpl/components/ClStoreKernelComponents.cpp @@ -86,6 +86,60 @@ ClStoreBlockBoundaryAwareKernelComponent::TagLUT ClStoreBlockBoundaryAwareKernel { "dst", vtable.add(_dst, ClKernelArgRuntimeDescriptor(_dst.arg_id, TensorArgType::Image_3D), "dst") }, }; } + +ComponentType ClStoreIndirectWidthSelectKernelComponent::get_component_type() const +{ + return ComponentType::Store; +} + +std::string ClStoreIndirectWidthSelectKernelComponent::get_component_code() const +{ + return R"_( + //------------------ START KERNEL {{meta_kernel_id}} STORE --------------------- + + TILE(uint, M0, 1, dst_indirect_y); + + // Calculate the destination indirect Y + LOOP_UNROLLING(int, i, 0, 1, M0, + { + dst_indirect_y[i].v = (uint)min(mout + i, (int)({{dst_w}} * {{dst_h}}) - 1); + dst_indirect_y[i].v += bout * (int)({{dst_w}} * {{dst_h}}); + }) + + T_STORE_INDIRECT_WIDTH_SELECT({{DST_DATA_TYPE}}, M0, N0, PARTIAL_N0, {{DST_TENSOR_TYPE}}, {{dst}}, cout, {{dst}}_stride_y, PARTIAL_N0 != 0 && g_cond_x, {{src}}, dst_indirect_y); + + //------------------ END KERNEL {{meta_kernel_id}} STORE --------------------- + +)_"; +} + +CLBuildOptions ClStoreIndirectWidthSelectKernelComponent::generate_build_options() const +{ + CLBuildOptions build_opts{}; + + return build_opts; +} + +ClStoreIndirectWidthSelectKernelComponent::TagLUT ClStoreIndirectWidthSelectKernelComponent::allocate_vars(SharedVarTable &vtable) const +{ + TagLUT lut{}; + + lut["meta_kernel_id"] = id(); + lut["src"] = vtable.add(_src, ClKernelArgRuntimeDescriptor(_src.arg_id, TensorArgType::Image_3D), "src"); + lut["dst"] = vtable.add(_dst, ClKernelArgRuntimeDescriptor(_dst.arg_id, TensorArgType::Tensor_4D_t_Buffer), "dst"); + + // Local build options + auto dst_info = _blueprint->impl().get_kernel_argument_info(_blueprint->impl().get_dst_id()); + + lut["dst_w"] = dst_info->dimension(1); + lut["dst_h"] = dst_info->dimension(2); + + lut["DST_TENSOR_TYPE"] = "BUFFER"; + lut["DST_DATA_TYPE"] = dst_info->data_type(); + + return lut; +} + } // namespace dynamic_fusion } // namespace experimental } // namespace arm_compute |