1 /* Copyright 2019 The TensorFlow Authors. All Rights Reserved. 2 3 Licensed under the Apache License, Version 2.0 (the "License"); 4 you may not use this file except in compliance with the License. 5 You may obtain a copy of the License at 6 7 http://www.apache.org/licenses/LICENSE-2.0 8 9 Unless required by applicable law or agreed to in writing, software 10 distributed under the License is distributed on an "AS IS" BASIS, 11 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 See the License for the specific language governing permissions and 13 limitations under the License. 14 ==============================================================================*/ 15 16 #ifndef TENSORFLOW_LITE_DELEGATES_GPU_GL_WORKGROUPS_IDEAL_WORKGROUP_PICKER_H_ 17 #define TENSORFLOW_LITE_DELEGATES_GPU_GL_WORKGROUPS_IDEAL_WORKGROUP_PICKER_H_ 18 19 #include "tensorflow/lite/delegates/gpu/common/gpu_info.h" 20 #include "tensorflow/lite/delegates/gpu/common/operations.h" 21 #include "tensorflow/lite/delegates/gpu/common/shape.h" 22 #include "tensorflow/lite/delegates/gpu/common/types.h" 23 24 namespace tflite { 25 namespace gpu { 26 namespace gl { 27 28 // Picks up the ideal workgroup size for the given convolution case. 29 // Ideal workgroup gives top 10% of the possible performance for the given case. 30 // They are received after the workgroup performance research (b/117291356). 31 uint3 GetIdealWorkgroupIfPossible(const GpuInfo& gpu_info, 32 OperationType op_type, HW kernel, HW strides, 33 OHWI workload); 34 35 // Does the same as the function above. Use this one if your operation can 36 // suggest some reasonable workgroup size. It's expected to give better 37 // performance than the default workgroup calculator. 38 uint3 GetIdealWorkgroupIfPossible(const GpuInfo& gpu_info, 39 OperationType op_type, HW kernel, HW strides, 40 uint3 default_wg, OHWI workload); 41 42 } // namespace gl 43 } // namespace gpu 44 } // namespace tflite 45 46 #endif // TENSORFLOW_LITE_DELEGATES_GPU_GL_WORKGROUPS_IDEAL_WORKGROUP_PICKER_H_ 47