message: Add SelectFullyConnectedGeneric for selecting a non-device specific implementation. Currently same as SelectFullyConnectedAdreno.
diff: @@ -27,6 +27,22 @@ namespace tflite {
  namespace gpu {
  namespace cl {
  +absl::Status SelectFullyConnectedGeneric(
  + const FullyConnectedAttributes& attr,
  + const CreationContext& creation_context, const OperationDef& op_def,
  + int batch_size, std::unique_ptr<GPUOperation>* ptr) {
  + if (op_def.IsBatchSupported()) {
  + ConvTexture conv;
  + RETURN_IF_ERROR(CreateConvTexture(creation_context, op_def, attr, &conv));
  + *ptr = absl::make_unique<ConvTexture>(std::move(conv));
  + } else {
  + FullyConnected fc;
  + RETURN_IF_ERROR(CreateFullyConnected(creation_context, op_def, attr, &fc));
  + *ptr = absl::make_unique<FullyConnected>(std::move(fc));
  + }
  + return absl::OkStatus();
  +}
  +
  absl::Status SelectFullyConnectedAdreno(const FullyConnectedAttributes& attr,
  const CreationContext& creation_context,
  const OperationDef& op_def,
  @@ -38,8 +54,7 @@ absl::Status SelectFullyConnectedAdreno(const FullyConnectedAttributes& attr,
  *ptr = absl::make_unique<ConvTexture>(std::move(conv));
  } else {
  FullyConnected fc;
  - RETURN_IF_ERROR(
  - CreateFullyConnected(creation_context, op_def, attr, &fc));
  + RETURN_IF_ERROR(CreateFullyConnected(creation_context, op_def, attr, &fc));
  *ptr = absl::make_unique<FullyConnected>(std::move(fc));
  }
  return absl::OkStatus();
  @@ -55,8 +70,7 @@ absl::Status SelectFullyConnectedPowerVR(
  *ptr = absl::make_unique<ConvPowerVR>(std::move(conv));
  } else {
  FullyConnected fc;
  - RETURN_IF_ERROR(
  - CreateFullyConnected(creation_context, op_def, attr, &fc));
  + RETURN_IF_ERROR(CreateFullyConnected(creation_context, op_def, attr, &fc));
  *ptr = absl::make_unique<FullyConnected>(std::move(fc));
  }
  return absl::OkStatus();
  @@ -80,8 +94,7 @@ absl::Status SelectFullyConnectedMali(const FullyConnectedAttributes& attr,
  }
  } else {
  FullyConnected fc;
  - RETURN_IF_ERROR(
  - CreateFullyConnected(creation_context, op_def, attr, &fc));
  + RETURN_IF_ERROR(CreateFullyConnected(creation_context, op_def, attr, &fc));
  *ptr = absl::make_unique<FullyConnected>(std::move(fc));
  }
  return absl::OkStatus();
  @@ -102,7 +115,7 @@ absl::Status SelectFullyConnected(const FullyConnectedAttributes& attr,
  return SelectFullyConnectedMali(attr, creation_context, op_def,
  batch_size, ptr);
  default:
  - return SelectFullyConnectedAdreno(attr, creation_context, op_def,
  + return SelectFullyConnectedGeneric(attr, creation_context, op_def,
  batch_size, ptr);
  }
  }
  