OpenCL init should fail on non-android platforms

This commit is contained in:
Will Stott 2021-10-18 15:03:17 +01:00 committed by GitHub
parent 33d683c671
commit 8e9c864edc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -213,8 +213,9 @@ absl::Status TFLiteGPURunner::InitializeOpenCL(
cl::NewInferenceEnvironment(env_options, &cl_environment_, &properties)); cl::NewInferenceEnvironment(env_options, &cl_environment_, &properties));
MP_RETURN_IF_ERROR(cl_environment_->NewInferenceBuilder( MP_RETURN_IF_ERROR(cl_environment_->NewInferenceBuilder(
cl_options, std::move(*graph_cl_), builder)); cl_options, std::move(*graph_cl_), builder));
#endif
return absl::OkStatus(); return absl::OkStatus();
#endif
return mediapipe::UnimplementedError("OpenCL is only supported on Android currently.");
} }
} // namespace gpu } // namespace gpu