From bd44caacf15a3b6b059af77e3345f79606067fea Mon Sep 17 00:00:00 2001 From: Giorgio Arena Date: Tue, 15 Mar 2022 13:45:15 +0000 Subject: [Dynamic Fusion] Implement build options generation Resolves: COMPMID-5153 Signed-off-by: Giorgio Arena Change-Id: Ic34cc1f0d092fafa7c2faa4dd705cf8f68eaf87e Reviewed-on: https://review.mlplatform.org/c/ml/ComputeLibrary/+/7317 Comments-Addressed: Arm Jenkins Reviewed-by: SiCong Li Tested-by: Arm Jenkins --- .../components/ClElementwiseAddKernelComponent.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'src/core/experimental/dynamic_fusion/ClKernelBuildingImpl/components/ClElementwiseAddKernelComponent.cpp') diff --git a/src/core/experimental/dynamic_fusion/ClKernelBuildingImpl/components/ClElementwiseAddKernelComponent.cpp b/src/core/experimental/dynamic_fusion/ClKernelBuildingImpl/components/ClElementwiseAddKernelComponent.cpp index 06c29c4253..bbdf8df0a3 100644 --- a/src/core/experimental/dynamic_fusion/ClKernelBuildingImpl/components/ClElementwiseAddKernelComponent.cpp +++ b/src/core/experimental/dynamic_fusion/ClKernelBuildingImpl/components/ClElementwiseAddKernelComponent.cpp @@ -82,6 +82,22 @@ std::string ClElementwiseAddKernelComponent::get_component_code() const )_"; } + +CLBuildOptions ClElementwiseAddKernelComponent::generate_build_options() const +{ + auto t_dst_info = _blueprint->impl().get_kernel_argument_info(_blueprint->impl().get_dst_id()); + auto tile_info = _blueprint->impl().get_tile_info(); + + CLBuildOptions build_opts{}; + + build_opts.add_option("-DDATA_TYPE=" + get_cl_type_from_data_type(t_dst_info->data_type())); + build_opts.add_option("-DM0=" + support::cpp11::to_string(tile_info.tile_dims.y())); + build_opts.add_option("-DN0=" + support::cpp11::to_string(tile_info.tile_dims.x())); + build_opts.add_option("-DPARTIAL_STORE_M0=" + support::cpp11::to_string(tile_info.boundaries.y() % tile_info.tile_dims.y())); + + return build_opts; +} + ClElementwiseAddKernelComponent::TagLUT ClElementwiseAddKernelComponent::allocate_vars(SharedVarTable &vtable) const { // Determine which argument is the accumulator -- cgit v1.2.1