Selectors moved from gpu/cl to gpu/common.

PiperOrigin-RevId: 346454897
Change-Id: I127789ca384a262ae6a264a091c57c0387c11c37
This commit is contained in:
Raman Sarokin 2020-12-08 18:31:25 -08:00 committed by TensorFlower Gardener
parent 2d753e6a21
commit 69451a83bb
27 changed files with 68 additions and 118 deletions

View File

@ -216,23 +216,6 @@ if(TFLITE_ENABLE_GPU)
"delegates/gpu/cl/kernels" TFLITE_DELEGATES_GPU_CL_KERNELS_SRCS
FILTER "(_test)\\.(cc|h)$"
)
populate_tflite_source_vars(
"delegates/gpu/cl/kernels/special"
TFLITE_DELEGATES_GPU_CL_KERNELS_SPECIAL_SRCS
FILTER "(_test)\\.(cc|h)$"
)
populate_tflite_source_vars(
"delegates/gpu/cl/selectors" TFLITE_DELEGATES_GPU_CL_SELECTORS_SRCS
FILTER "(_test)\\.(cc|h)$"
)
populate_tflite_source_vars(
"delegates/gpu/cl/selectors/default" TFLITE_DELEGATES_GPU_CL_SELECTORS_DEFAULT_SRCS
FILTER "(_test)\\.(cc|h)$"
)
populate_tflite_source_vars(
"delegates/gpu/common" TFLITE_DELEGATES_GPU_COMMON_SRCS
FILTER "(_test)\\.(cc|h)$"
)
populate_tflite_source_vars(
"delegates/gpu/common/default" TFLITE_DELEGATES_GPU_COMMON_DEFAULT_SRCS
FILTER "(_test)\\.(cc|h)$"
@ -242,6 +225,18 @@ if(TFLITE_ENABLE_GPU)
TFLITE_DELEGATES_GPU_COMMON_MEMORY_MANAGEMENT_SRCS
FILTER "(_test)\\.(cc|h)$"
)
populate_tflite_source_vars(
"delegates/gpu/common/selectors" TFLITE_DELEGATES_GPU_COMMON_SELECTORS_SRCS
FILTER "(_test)\\.(cc|h)$"
)
populate_tflite_source_vars(
"delegates/gpu/common/selectors/default" TFLITE_DELEGATES_GPU_COMMON_SELECTORS_DEFAULT_SRCS
FILTER "(_test)\\.(cc|h)$"
)
populate_tflite_source_vars(
"delegates/gpu/common" TFLITE_DELEGATES_GPU_COMMON_SRCS
FILTER "(_test)\\.(cc|h)$"
)
populate_tflite_source_vars(
"delegates/gpu/common/task"
TFLITE_DELEGATES_GPU_COMMON_TASK_SRCS
@ -267,12 +262,11 @@ if(TFLITE_ENABLE_GPU)
${TFLITE_SOURCE_DIR}/delegates/gpu/delegate.cc
${TFLITE_DELEGATES_GPU_CL_SRCS}
${TFLITE_DELEGATES_GPU_CL_KERNELS_SRCS}
${TFLITE_DELEGATES_GPU_CL_KERNELS_SPECIAL_SRCS}
${TFLITE_DELEGATES_GPU_CL_SELECTORS_SRCS}
${TFLITE_DELEGATES_GPU_CL_SELECTORS_DEFAULT_SRCS}
${TFLITE_DELEGATES_GPU_COMMON_SRCS}
${TFLITE_DELEGATES_GPU_COMMON_DEFAULT_SRCS}
${TFLITE_DELEGATES_GPU_COMMON_MEMORY_MANAGEMENT_SRCS}
${TFLITE_DELEGATES_GPU_COMMON_SELECTORS_SRCS}
${TFLITE_DELEGATES_GPU_COMMON_SELECTORS_DEFAULT_SRCS}
${TFLITE_DELEGATES_GPU_COMMON_SRCS}
${TFLITE_DELEGATES_GPU_COMMON_TASK_SRCS}
${TFLITE_DELEGATES_GPU_COMMON_TASKS_SRCS}
${TFLITE_DELEGATES_GPU_COMMON_TASKS_SPECIAL_SRCS}

View File

@ -395,8 +395,6 @@ cc_library(
":opencl_wrapper",
":serialization_cc_fbs",
":tensor",
"//tensorflow/lite/delegates/gpu/cl/selectors:operation_selector",
"//tensorflow/lite/delegates/gpu/cl/selectors:special_selector",
"//tensorflow/lite/delegates/gpu/common:data_type",
"//tensorflow/lite/delegates/gpu/common:memory_management",
"//tensorflow/lite/delegates/gpu/common:model",
@ -409,6 +407,8 @@ cc_library(
"//tensorflow/lite/delegates/gpu/common:tensor",
"//tensorflow/lite/delegates/gpu/common:types",
"//tensorflow/lite/delegates/gpu/common:util",
"//tensorflow/lite/delegates/gpu/common/selectors:operation_selector",
"//tensorflow/lite/delegates/gpu/common/selectors:special_selector",
"//tensorflow/lite/delegates/gpu/common/task:arguments",
"//tensorflow/lite/delegates/gpu/common/task:buffer_desc",
"//tensorflow/lite/delegates/gpu/common/task:gpu_object_desc",

View File

@ -27,14 +27,14 @@ limitations under the License.
#include "absl/container/flat_hash_set.h"
#include "tensorflow/lite/delegates/gpu/cl/buffer.h"
#include "tensorflow/lite/delegates/gpu/cl/cl_device.h"
#include "tensorflow/lite/delegates/gpu/cl/selectors/operation_selector.h"
#include "tensorflow/lite/delegates/gpu/cl/selectors/special_selector.h"
#include "tensorflow/lite/delegates/gpu/common/data_type.h"
#include "tensorflow/lite/delegates/gpu/common/memory_management.h"
#include "tensorflow/lite/delegates/gpu/common/model.h"
#include "tensorflow/lite/delegates/gpu/common/model_transformer.h"
#include "tensorflow/lite/delegates/gpu/common/operations.h"
#include "tensorflow/lite/delegates/gpu/common/precision.h"
#include "tensorflow/lite/delegates/gpu/common/selectors/operation_selector.h"
#include "tensorflow/lite/delegates/gpu/common/selectors/special_selector.h"
#include "tensorflow/lite/delegates/gpu/common/shape.h"
#include "tensorflow/lite/delegates/gpu/common/task/gpu_operation.h"
#include "tensorflow/lite/delegates/gpu/common/task/storage_type_util.h"

View File

@ -7,11 +7,11 @@ cc_library(
name = "convolution_selector",
hdrs = ["convolution_selector.h"],
deps = [
"//tensorflow/lite/delegates/gpu/cl/selectors/default:convolution_selector", # buildcleaner: keep
"//tensorflow/lite/delegates/gpu/common:model_hints",
"//tensorflow/lite/delegates/gpu/common:operations",
"//tensorflow/lite/delegates/gpu/common:shape",
"//tensorflow/lite/delegates/gpu/common:status",
"//tensorflow/lite/delegates/gpu/common/selectors/default:convolution_selector", # buildcleaner: keep
"//tensorflow/lite/delegates/gpu/common/task:gpu_operation",
"//tensorflow/lite/delegates/gpu/common/task:weights_layout",
],
@ -21,9 +21,9 @@ cc_library(
name = "convolution_transposed_selector",
hdrs = ["convolution_transposed_selector.h"],
deps = [
"//tensorflow/lite/delegates/gpu/cl/selectors/default:convolution_transposed_selector", # buildcleaner: keep
"//tensorflow/lite/delegates/gpu/common:operations",
"//tensorflow/lite/delegates/gpu/common:status",
"//tensorflow/lite/delegates/gpu/common/selectors/default:convolution_transposed_selector", # buildcleaner: keep
"//tensorflow/lite/delegates/gpu/common/task:gpu_operation",
"//tensorflow/lite/delegates/gpu/common/task:weights_layout",
"@com_google_absl//absl/memory",
@ -35,10 +35,10 @@ cc_library(
hdrs = ["default_selector.h"],
deps = [
":subgraph",
"//tensorflow/lite/delegates/gpu/cl/selectors/default:default_selector", # buildcleaner: keep
"//tensorflow/lite/delegates/gpu/common:model",
"//tensorflow/lite/delegates/gpu/common:model_hints",
"//tensorflow/lite/delegates/gpu/common:status",
"//tensorflow/lite/delegates/gpu/common/selectors/default:default_selector", # buildcleaner: keep
"//tensorflow/lite/delegates/gpu/common/task:gpu_operation",
"//tensorflow/lite/delegates/gpu/common/task:tensor_desc",
],
@ -48,9 +48,9 @@ cc_library(
name = "dw_convolution_selector",
hdrs = ["dw_convolution_selector.h"],
deps = [
"//tensorflow/lite/delegates/gpu/cl/selectors/default:dw_convolution_selector", # buildcleaner: keep
"//tensorflow/lite/delegates/gpu/common:operations",
"//tensorflow/lite/delegates/gpu/common:status",
"//tensorflow/lite/delegates/gpu/common/selectors/default:dw_convolution_selector", # buildcleaner: keep
"//tensorflow/lite/delegates/gpu/common/task:gpu_operation",
"@com_google_absl//absl/memory",
],
@ -60,9 +60,9 @@ cc_library(
name = "fully_connected_selector",
hdrs = ["fully_connected_selector.h"],
deps = [
"//tensorflow/lite/delegates/gpu/cl/selectors/default:fully_connected_selector", # buildcleaner: keep
"//tensorflow/lite/delegates/gpu/common:operations",
"//tensorflow/lite/delegates/gpu/common:status",
"//tensorflow/lite/delegates/gpu/common/selectors/default:fully_connected_selector", # buildcleaner: keep
"//tensorflow/lite/delegates/gpu/common/task:gpu_operation",
"@com_google_absl//absl/memory",
],

View File

@ -13,8 +13,8 @@ See the License for the specific language governing permissions and
limitations under the License.
==============================================================================*/
#ifndef TENSORFLOW_LITE_DELEGATES_GPU_CL_SELECTORS_CONVOLUTION_SELECTOR_H_
#define TENSORFLOW_LITE_DELEGATES_GPU_CL_SELECTORS_CONVOLUTION_SELECTOR_H_
#ifndef TENSORFLOW_LITE_DELEGATES_GPU_COMMON_SELECTORS_CONVOLUTION_SELECTOR_H_
#define TENSORFLOW_LITE_DELEGATES_GPU_COMMON_SELECTORS_CONVOLUTION_SELECTOR_H_
#include <memory>
@ -27,7 +27,6 @@ limitations under the License.
namespace tflite {
namespace gpu {
namespace cl {
std::unique_ptr<GPUOperation> SelectConvolution(
const Convolution2DAttributes& attr, const BHWC& dst_shape,
@ -46,8 +45,7 @@ std::unique_ptr<GPUOperation> SelectConverterToConvWeights(
const WeightsDescription& weights_desc, const OperationDef& op_def,
ModelHints hints);
} // namespace cl
} // namespace gpu
} // namespace tflite
#endif // TENSORFLOW_LITE_DELEGATES_GPU_CL_SELECTORS_CONVOLUTION_SELECTOR_H_
#endif // TENSORFLOW_LITE_DELEGATES_GPU_COMMON_SELECTORS_CONVOLUTION_SELECTOR_H_

View File

@ -13,8 +13,8 @@ See the License for the specific language governing permissions and
limitations under the License.
==============================================================================*/
#ifndef TENSORFLOW_LITE_DELEGATES_GPU_CL_SELECTORS_CONVOLUTION_TRANSPOSED_SELECTOR_H_
#define TENSORFLOW_LITE_DELEGATES_GPU_CL_SELECTORS_CONVOLUTION_TRANSPOSED_SELECTOR_H_
#ifndef TENSORFLOW_LITE_DELEGATES_GPU_COMMON_SELECTORS_CONVOLUTION_TRANSPOSED_SELECTOR_H_
#define TENSORFLOW_LITE_DELEGATES_GPU_COMMON_SELECTORS_CONVOLUTION_TRANSPOSED_SELECTOR_H_
#include <memory>
@ -25,7 +25,6 @@ limitations under the License.
namespace tflite {
namespace gpu {
namespace cl {
std::unique_ptr<GPUOperation> SelectConvolutionTransposed(
const ConvolutionTransposedAttributes& attr, const GpuInfo& gpu_info,
@ -35,8 +34,7 @@ std::unique_ptr<GPUOperation> SelectConvolutionTransposedWithDynamicWeights(
const ConvolutionTransposedAttributes& attr, const GpuInfo& gpu_info,
const OperationDef& op_def, WeightsDescription* weights_desc);
} // namespace cl
} // namespace gpu
} // namespace tflite
#endif // TENSORFLOW_LITE_DELEGATES_GPU_CL_SELECTORS_CONVOLUTION_TRANSPOSED_SELECTOR_H_
#endif // TENSORFLOW_LITE_DELEGATES_GPU_COMMON_SELECTORS_CONVOLUTION_TRANSPOSED_SELECTOR_H_

View File

@ -46,11 +46,11 @@ cc_library(
name = "default_selector",
srcs = ["default_selector.cc"],
deps = [
"//tensorflow/lite/delegates/gpu/cl/selectors:subgraph",
"//tensorflow/lite/delegates/gpu/common:model",
"//tensorflow/lite/delegates/gpu/common:model_hints",
"//tensorflow/lite/delegates/gpu/common:operations",
"//tensorflow/lite/delegates/gpu/common:status",
"//tensorflow/lite/delegates/gpu/common/selectors:subgraph",
"//tensorflow/lite/delegates/gpu/common/task:gpu_operation",
"@com_google_absl//absl/strings",
],
@ -60,7 +60,7 @@ cc_library(
name = "dw_convolution_selector",
srcs = ["dw_convolution_selector.cc"],
deps = [
"//tensorflow/lite/delegates/gpu/cl:cl_device",
"//tensorflow/lite/delegates/gpu/common:gpu_info",
"//tensorflow/lite/delegates/gpu/common:operations",
"//tensorflow/lite/delegates/gpu/common:status",
"//tensorflow/lite/delegates/gpu/common/task:gpu_operation",

View File

@ -30,7 +30,6 @@ limitations under the License.
namespace tflite {
namespace gpu {
namespace cl {
namespace {
std::unique_ptr<GPUOperation> SelectConvolutionAdreno(
@ -201,6 +200,5 @@ std::unique_ptr<GPUOperation> SelectConverterToConvWeights(
return absl::make_unique<ConverterToConvWeights>(std::move(converter));
}
} // namespace cl
} // namespace gpu
} // namespace tflite

View File

@ -23,7 +23,6 @@ limitations under the License.
namespace tflite {
namespace gpu {
namespace cl {
namespace {
std::unique_ptr<GPUOperation> SelectConvolutionTransposedAdreno(
@ -142,6 +141,5 @@ std::unique_ptr<GPUOperation> SelectConvolutionTransposedWithDynamicWeights(
}
}
} // namespace cl
} // namespace gpu
} // namespace tflite

View File

@ -16,16 +16,15 @@ limitations under the License.
#include <memory>
#include "absl/strings/str_cat.h"
#include "tensorflow/lite/delegates/gpu/cl/selectors/subgraph.h"
#include "tensorflow/lite/delegates/gpu/common/model.h"
#include "tensorflow/lite/delegates/gpu/common/model_hints.h"
#include "tensorflow/lite/delegates/gpu/common/operations.h"
#include "tensorflow/lite/delegates/gpu/common/selectors/subgraph.h"
#include "tensorflow/lite/delegates/gpu/common/status.h"
#include "tensorflow/lite/delegates/gpu/common/task/gpu_operation.h"
namespace tflite {
namespace gpu {
namespace cl {
absl::Status SelectDefault(const GpuInfo& gpu_info, const OperationDef& op_def,
ModelHints hints, const std::vector<Value*>& inputs,
@ -35,6 +34,5 @@ absl::Status SelectDefault(const GpuInfo& gpu_info, const OperationDef& op_def,
absl::StrCat("No selector for ", node.operation.type));
}
} // namespace cl
} // namespace gpu
} // namespace tflite

View File

@ -14,13 +14,12 @@ limitations under the License.
==============================================================================*/
#include "absl/memory/memory.h"
#include "tensorflow/lite/delegates/gpu/cl/cl_device.h"
#include "tensorflow/lite/delegates/gpu/common/gpu_info.h"
#include "tensorflow/lite/delegates/gpu/common/tasks/depthwise_conv.h"
#include "tensorflow/lite/delegates/gpu/common/tasks/depthwise_conv_3x3.h"
namespace tflite {
namespace gpu {
namespace cl {
namespace {
std::unique_ptr<GPUOperation> SelectDWConvolutionAdreno(
@ -79,6 +78,5 @@ std::unique_ptr<GPUOperation> SelectDWConvolution(
}
}
} // namespace cl
} // namespace gpu
} // namespace tflite

View File

@ -22,7 +22,6 @@ limitations under the License.
namespace tflite {
namespace gpu {
namespace cl {
std::unique_ptr<GPUOperation> SelectFullyConnectedGeneric(
const FullyConnectedAttributes& attr, const GpuInfo& gpu_info,
@ -96,6 +95,5 @@ std::unique_ptr<GPUOperation> SelectFullyConnected(
}
}
} // namespace cl
} // namespace gpu
} // namespace tflite

View File

@ -13,29 +13,27 @@ See the License for the specific language governing permissions and
limitations under the License.
==============================================================================*/
#ifndef TENSORFLOW_LITE_DELEGATES_GPU_CL_SELECTORS_DEFAULT_SELECTOR_H_
#define TENSORFLOW_LITE_DELEGATES_GPU_CL_SELECTORS_DEFAULT_SELECTOR_H_
#ifndef TENSORFLOW_LITE_DELEGATES_GPU_COMMON_SELECTORS_DEFAULT_SELECTOR_H_
#define TENSORFLOW_LITE_DELEGATES_GPU_COMMON_SELECTORS_DEFAULT_SELECTOR_H_
#include <memory>
#include "tensorflow/lite/delegates/gpu/cl/selectors/subgraph.h"
#include "tensorflow/lite/delegates/gpu/common/model.h"
#include "tensorflow/lite/delegates/gpu/common/model_hints.h"
#include "tensorflow/lite/delegates/gpu/common/selectors/subgraph.h"
#include "tensorflow/lite/delegates/gpu/common/status.h"
#include "tensorflow/lite/delegates/gpu/common/task/gpu_operation.h"
#include "tensorflow/lite/delegates/gpu/common/task/tensor_desc.h"
namespace tflite {
namespace gpu {
namespace cl {
absl::Status SelectDefault(const GpuInfo& gpu_info, const OperationDef& op_def,
ModelHints hints, const std::vector<Value*>& inputs,
const std::vector<Value*>& outputs, const Node& node,
GPUOperationsSubgraph* gpu_subgraph);
} // namespace cl
} // namespace gpu
} // namespace tflite
#endif // TENSORFLOW_LITE_DELEGATES_GPU_CL_SELECTORS_DEFAULT_SELECTOR_H_
#endif // TENSORFLOW_LITE_DELEGATES_GPU_COMMON_SELECTORS_DEFAULT_SELECTOR_H_

View File

@ -13,8 +13,8 @@ See the License for the specific language governing permissions and
limitations under the License.
==============================================================================*/
#ifndef TENSORFLOW_LITE_DELEGATES_GPU_CL_SELECTORS_DW_CONVOLUTION_SELECTOR_H_
#define TENSORFLOW_LITE_DELEGATES_GPU_CL_SELECTORS_DW_CONVOLUTION_SELECTOR_H_
#ifndef TENSORFLOW_LITE_DELEGATES_GPU_COMMON_SELECTORS_DW_CONVOLUTION_SELECTOR_H_
#define TENSORFLOW_LITE_DELEGATES_GPU_COMMON_SELECTORS_DW_CONVOLUTION_SELECTOR_H_
#include <memory>
@ -24,14 +24,12 @@ limitations under the License.
namespace tflite {
namespace gpu {
namespace cl {
std::unique_ptr<GPUOperation> SelectDWConvolution(
const DepthwiseConvolution2DAttributes& attr, const GpuInfo& gpu_info,
const OperationDef& op_def);
} // namespace cl
} // namespace gpu
} // namespace tflite
#endif // TENSORFLOW_LITE_DELEGATES_GPU_CL_SELECTORS_DW_CONVOLUTION_SELECTOR_H_
#endif // TENSORFLOW_LITE_DELEGATES_GPU_COMMON_SELECTORS_DW_CONVOLUTION_SELECTOR_H_

View File

@ -13,8 +13,8 @@ See the License for the specific language governing permissions and
limitations under the License.
==============================================================================*/
#ifndef TENSORFLOW_LITE_DELEGATES_GPU_CL_SELECTORS_FULLY_CONNECTED_SELECTOR_H_
#define TENSORFLOW_LITE_DELEGATES_GPU_CL_SELECTORS_FULLY_CONNECTED_SELECTOR_H_
#ifndef TENSORFLOW_LITE_DELEGATES_GPU_COMMON_SELECTORS_FULLY_CONNECTED_SELECTOR_H_
#define TENSORFLOW_LITE_DELEGATES_GPU_COMMON_SELECTORS_FULLY_CONNECTED_SELECTOR_H_
#include <memory>
@ -24,14 +24,12 @@ limitations under the License.
namespace tflite {
namespace gpu {
namespace cl {
std::unique_ptr<GPUOperation> SelectFullyConnected(
const FullyConnectedAttributes& attr, const GpuInfo& gpu_info,
const OperationDef& op_def, int batch_size);
} // namespace cl
} // namespace gpu
} // namespace tflite
#endif // TENSORFLOW_LITE_DELEGATES_GPU_CL_SELECTORS_FULLY_CONNECTED_SELECTOR_H_
#endif // TENSORFLOW_LITE_DELEGATES_GPU_COMMON_SELECTORS_FULLY_CONNECTED_SELECTOR_H_

View File

@ -13,19 +13,19 @@ See the License for the specific language governing permissions and
limitations under the License.
==============================================================================*/
#include "tensorflow/lite/delegates/gpu/cl/selectors/operation_selector.h"
#include "tensorflow/lite/delegates/gpu/common/selectors/operation_selector.h"
#include "absl/strings/str_cat.h"
#include "absl/types/any.h"
#include "tensorflow/lite/delegates/gpu/cl/selectors/convolution_selector.h"
#include "tensorflow/lite/delegates/gpu/cl/selectors/convolution_transposed_selector.h"
#include "tensorflow/lite/delegates/gpu/cl/selectors/default_selector.h"
#include "tensorflow/lite/delegates/gpu/cl/selectors/dw_convolution_selector.h"
#include "tensorflow/lite/delegates/gpu/cl/selectors/fully_connected_selector.h"
#include "tensorflow/lite/delegates/gpu/cl/selectors/simple_selectors.h"
#include "tensorflow/lite/delegates/gpu/common/data_type.h"
#include "tensorflow/lite/delegates/gpu/common/gpu_info.h"
#include "tensorflow/lite/delegates/gpu/common/operations.h"
#include "tensorflow/lite/delegates/gpu/common/selectors/convolution_selector.h"
#include "tensorflow/lite/delegates/gpu/common/selectors/convolution_transposed_selector.h"
#include "tensorflow/lite/delegates/gpu/common/selectors/default_selector.h"
#include "tensorflow/lite/delegates/gpu/common/selectors/dw_convolution_selector.h"
#include "tensorflow/lite/delegates/gpu/common/selectors/fully_connected_selector.h"
#include "tensorflow/lite/delegates/gpu/common/selectors/simple_selectors.h"
#include "tensorflow/lite/delegates/gpu/common/shape.h"
#include "tensorflow/lite/delegates/gpu/common/status.h"
#include "tensorflow/lite/delegates/gpu/common/task/storage_type_util.h"
@ -38,7 +38,6 @@ limitations under the License.
namespace tflite {
namespace gpu {
namespace cl {
namespace {
bool IsRecommendedForWinograd4x4To6x6(const Convolution2DAttributes& attr,
const GpuInfo& gpu_info,
@ -530,6 +529,5 @@ absl::Status GPUOperationFromNode(const GpuInfo& gpu_info,
}
}
} // namespace cl
} // namespace gpu
} // namespace tflite

View File

@ -13,21 +13,20 @@ See the License for the specific language governing permissions and
limitations under the License.
==============================================================================*/
#ifndef TENSORFLOW_LITE_DELEGATES_GPU_CL_SELECTORS_OPERATION_SELECTOR_H_
#define TENSORFLOW_LITE_DELEGATES_GPU_CL_SELECTORS_OPERATION_SELECTOR_H_
#ifndef TENSORFLOW_LITE_DELEGATES_GPU_COMMON_SELECTORS_OPERATION_SELECTOR_H_
#define TENSORFLOW_LITE_DELEGATES_GPU_COMMON_SELECTORS_OPERATION_SELECTOR_H_
#include <memory>
#include "tensorflow/lite/delegates/gpu/cl/selectors/subgraph.h"
#include "tensorflow/lite/delegates/gpu/common/model.h"
#include "tensorflow/lite/delegates/gpu/common/model_hints.h"
#include "tensorflow/lite/delegates/gpu/common/selectors/subgraph.h"
#include "tensorflow/lite/delegates/gpu/common/status.h"
#include "tensorflow/lite/delegates/gpu/common/task/gpu_operation.h"
#include "tensorflow/lite/delegates/gpu/common/task/tensor_desc.h"
namespace tflite {
namespace gpu {
namespace cl {
absl::Status GPUOperationFromNode(const GpuInfo& gpu_info,
const OperationDef& op_def, ModelHints hints,
@ -36,8 +35,7 @@ absl::Status GPUOperationFromNode(const GpuInfo& gpu_info,
const Node& node,
GPUOperationsSubgraph* gpu_subgraph);
} // namespace cl
} // namespace gpu
} // namespace tflite
#endif // TENSORFLOW_LITE_DELEGATES_GPU_CL_SELECTORS_OPERATION_SELECTOR_H_
#endif // TENSORFLOW_LITE_DELEGATES_GPU_COMMON_SELECTORS_OPERATION_SELECTOR_H_

View File

@ -13,7 +13,7 @@ See the License for the specific language governing permissions and
limitations under the License.
==============================================================================*/
#include "tensorflow/lite/delegates/gpu/cl/selectors/simple_selectors.h"
#include "tensorflow/lite/delegates/gpu/common/selectors/simple_selectors.h"
#include <memory>
#include <set>
@ -44,7 +44,6 @@ limitations under the License.
namespace tflite {
namespace gpu {
namespace cl {
std::unique_ptr<GPUOperation> SelectLSTM(const OperationDef& op_def,
const GpuInfo& gpu_info) {
@ -194,6 +193,5 @@ std::unique_ptr<GPUOperation> SelectQuantizeAndDequantize(
CreateQuantizeAndDequantize(op_def, attr));
}
} // namespace cl
} // namespace gpu
} // namespace tflite

View File

@ -13,8 +13,8 @@ See the License for the specific language governing permissions and
limitations under the License.
==============================================================================*/
#ifndef TENSORFLOW_LITE_DELEGATES_GPU_CL_SELECTORS_SIMPLE_SELECTORS_H_
#define TENSORFLOW_LITE_DELEGATES_GPU_CL_SELECTORS_SIMPLE_SELECTORS_H_
#ifndef TENSORFLOW_LITE_DELEGATES_GPU_COMMON_SELECTORS_SIMPLE_SELECTORS_H_
#define TENSORFLOW_LITE_DELEGATES_GPU_COMMON_SELECTORS_SIMPLE_SELECTORS_H_
#include <memory>
@ -26,7 +26,6 @@ limitations under the License.
namespace tflite {
namespace gpu {
namespace cl {
std::unique_ptr<GPUOperation> SelectLSTM(const OperationDef& op_def,
const GpuInfo& gpu_info);
@ -98,8 +97,7 @@ std::unique_ptr<GPUOperation> SelectWinograd36To4x4(
std::unique_ptr<GPUOperation> SelectQuantizeAndDequantize(
const QuantizeAndDequantizeAttributes& attr, const OperationDef& op_def);
} // namespace cl
} // namespace gpu
} // namespace tflite
#endif // TENSORFLOW_LITE_DELEGATES_GPU_CL_SELECTORS_SIMPLE_SELECTORS_H_
#endif // TENSORFLOW_LITE_DELEGATES_GPU_COMMON_SELECTORS_SIMPLE_SELECTORS_H_

View File

@ -13,7 +13,7 @@ See the License for the specific language governing permissions and
limitations under the License.
==============================================================================*/
#include "tensorflow/lite/delegates/gpu/cl/selectors/special_selector.h"
#include "tensorflow/lite/delegates/gpu/common/selectors/special_selector.h"
#include "absl/types/any.h"
#include "tensorflow/lite/delegates/gpu/common/data_type.h"
@ -27,7 +27,6 @@ limitations under the License.
namespace tflite {
namespace gpu {
namespace cl {
namespace {
absl::Status TryDepthwiseConvPlus1x1Conv(
CalculationsPrecision precision, const GraphFloat32& graph,
@ -207,6 +206,5 @@ absl::Status GPUSubgraphFromGraph(
return absl::NotFoundError("No special combination.");
}
} // namespace cl
} // namespace gpu
} // namespace tflite

View File

@ -13,23 +13,22 @@ See the License for the specific language governing permissions and
limitations under the License.
==============================================================================*/
#ifndef TENSORFLOW_LITE_DELEGATES_GPU_CL_SELECTORS_SPECIAL_SELECTOR_H_
#define TENSORFLOW_LITE_DELEGATES_GPU_CL_SELECTORS_SPECIAL_SELECTOR_H_
#ifndef TENSORFLOW_LITE_DELEGATES_GPU_COMMON_SELECTORS_SPECIAL_SELECTOR_H_
#define TENSORFLOW_LITE_DELEGATES_GPU_COMMON_SELECTORS_SPECIAL_SELECTOR_H_
#include <map>
#include <set>
#include <vector>
#include "tensorflow/lite/delegates/gpu/cl/selectors/subgraph.h"
#include "tensorflow/lite/delegates/gpu/common/gpu_info.h"
#include "tensorflow/lite/delegates/gpu/common/model.h"
#include "tensorflow/lite/delegates/gpu/common/selectors/subgraph.h"
#include "tensorflow/lite/delegates/gpu/common/status.h"
#include "tensorflow/lite/delegates/gpu/common/task/gpu_operation.h"
#include "tensorflow/lite/delegates/gpu/common/task/tensor_desc.h"
namespace tflite {
namespace gpu {
namespace cl {
absl::Status GPUSubgraphFromGraph(
const GpuInfo& gpu_info, CalculationsPrecision precision,
@ -38,8 +37,7 @@ absl::Status GPUSubgraphFromGraph(
std::set<NodeId>* consumed_nodes, GPUOperationsSubgraph* gpu_subgraph,
std::string* name);
} // namespace cl
} // namespace gpu
} // namespace tflite
#endif // TENSORFLOW_LITE_DELEGATES_GPU_CL_SELECTORS_SPECIAL_SELECTOR_H_
#endif // TENSORFLOW_LITE_DELEGATES_GPU_COMMON_SELECTORS_SPECIAL_SELECTOR_H_

View File

@ -13,7 +13,7 @@ See the License for the specific language governing permissions and
limitations under the License.
==============================================================================*/
#include "tensorflow/lite/delegates/gpu/cl/selectors/subgraph.h"
#include "tensorflow/lite/delegates/gpu/common/selectors/subgraph.h"
#include <memory>
@ -23,7 +23,6 @@ limitations under the License.
namespace tflite {
namespace gpu {
namespace cl {
std::unique_ptr<GPUOperation>* InitSingleOpSubgraph(
const std::vector<Value*>& inputs, const std::vector<Value*>& outputs,
@ -41,6 +40,5 @@ std::unique_ptr<GPUOperation>* InitSingleOpSubgraph(
return &gpu_subgraph->operations[0].operation;
}
} // namespace cl
} // namespace gpu
} // namespace tflite

View File

@ -13,8 +13,8 @@ See the License for the specific language governing permissions and
limitations under the License.
==============================================================================*/
#ifndef TENSORFLOW_LITE_DELEGATES_GPU_CL_SELECTORS_SUBGRAPH_H_
#define TENSORFLOW_LITE_DELEGATES_GPU_CL_SELECTORS_SUBGRAPH_H_
#ifndef TENSORFLOW_LITE_DELEGATES_GPU_COMMON_SELECTORS_SUBGRAPH_H_
#define TENSORFLOW_LITE_DELEGATES_GPU_COMMON_SELECTORS_SUBGRAPH_H_
#include <memory>
#include <vector>
@ -25,7 +25,6 @@ limitations under the License.
namespace tflite {
namespace gpu {
namespace cl {
struct GPUOperationWithRefs {
std::unique_ptr<GPUOperation> operation;
@ -46,8 +45,7 @@ std::unique_ptr<GPUOperation>* InitSingleOpSubgraph(
const std::vector<Value*>& inputs, const std::vector<Value*>& outputs,
GPUOperationsSubgraph* gpu_subgraph);
} // namespace cl
} // namespace gpu
} // namespace tflite
#endif // TENSORFLOW_LITE_DELEGATES_GPU_CL_SELECTORS_SUBGRAPH_H_
#endif // TENSORFLOW_LITE_DELEGATES_GPU_COMMON_SELECTORS_SUBGRAPH_H_

View File

@ -23,7 +23,6 @@ limitations under the License.
namespace tflite {
namespace gpu {
namespace cl {
namespace {
void UploadWeights(const DepthwiseConvolution2DAttributes& dw_attr,
const Convolution2DAttributes& conv_attr,
@ -264,6 +263,5 @@ GPUOperation CreateDepthwiseConvPlus1x1Conv(
return result;
}
} // namespace cl
} // namespace gpu
} // namespace tflite

View File

@ -30,7 +30,6 @@ limitations under the License.
namespace tflite {
namespace gpu {
namespace cl {
bool IsDepthwiseConvPlus1x1ConvSupported(
const OperationDef& definition,
@ -42,7 +41,6 @@ GPUOperation CreateDepthwiseConvPlus1x1Conv(
const DepthwiseConvolution2DAttributes& dw_attr,
const Convolution2DAttributes& conv_attr);
} // namespace cl
} // namespace gpu
} // namespace tflite

View File

@ -27,7 +27,6 @@ limitations under the License.
namespace tflite {
namespace gpu {
namespace cl {
namespace {
bool UseBufferForWeights(const GpuInfo& gpu_info) {
return gpu_info.IsAdreno() || gpu_info.IsAMD() || gpu_info.IsMali();
@ -195,6 +194,5 @@ FCFCAdd CreateFCFCAdd(const GpuInfo& gpu_info, const OperationDef& definition,
return result;
}
} // namespace cl
} // namespace gpu
} // namespace tflite

View File

@ -35,7 +35,6 @@ limitations under the License.
namespace tflite {
namespace gpu {
namespace cl {
template <DataType T, typename S>
void RearrangeFCWeightsToIOO4I4(const tflite::gpu::Tensor<OHWI, T>& weights,
@ -176,7 +175,6 @@ FCFCAdd CreateFCFCAdd(const GpuInfo& gpu_info, const OperationDef& definition,
const FullyConnectedAttributes& attr0,
const FullyConnectedAttributes& attr1);
} // namespace cl
} // namespace gpu
} // namespace tflite