diff --git a/tensorflow/lite/delegates/gpu/metal_delegate.h b/tensorflow/lite/delegates/gpu/metal_delegate.h index d77e9960098..6f8767ddb3c 100644 --- a/tensorflow/lite/delegates/gpu/metal_delegate.h +++ b/tensorflow/lite/delegates/gpu/metal_delegate.h @@ -16,10 +16,11 @@ limitations under the License. #ifndef TENSORFLOW_LITE_DELEGATES_GPU_METAL_DELEGATE_H_ #define TENSORFLOW_LITE_DELEGATES_GPU_METAL_DELEGATE_H_ -#import - #ifdef __cplusplus extern "C" { +#else +// For "C" 'bool' is not built-in type. +#include #endif // __cplusplus typedef struct TfLiteDelegate TfLiteDelegate; @@ -55,15 +56,6 @@ TfLiteDelegate* TFLGpuDelegateCreate(const TFLGpuDelegateOptions* options); // Destroys a delegate created with `TFLGpuDelegateCreate` call. void TFLGpuDelegateDelete(TfLiteDelegate* delegate); -// Binds Metal buffer to an input or an output tensor in the initialized -// delegate. Bound buffer should have sufficient storage to accommodate all -// elements of a tensor. Returns non-zero on success, or zero otherwise. -// -// *** Must be called *before* `Interpreter::ModifyGraphWithDelegate`. *** -bool TFLGpuDelegateBindMetalBufferToTensor(TfLiteDelegate* delegate, - int tensor_index, - id metal_buffer); - #ifdef __cplusplus } // extern "C" #endif // __cplusplus diff --git a/tensorflow/lite/delegates/gpu/metal_delegate_internal.h b/tensorflow/lite/delegates/gpu/metal_delegate_internal.h index 005925fb01a..a479b5c6e28 100644 --- a/tensorflow/lite/delegates/gpu/metal_delegate_internal.h +++ b/tensorflow/lite/delegates/gpu/metal_delegate_internal.h @@ -22,6 +22,15 @@ limitations under the License. struct TfLiteDelegate; +// Binds Metal buffer to an input or an output tensor in the initialized +// delegate. Bound buffer should have sufficient storage to accommodate all +// elements of a tensor. Returns non-zero on success, or zero otherwise. +// +// *** Must be called *before* `Interpreter::ModifyGraphWithDelegate`. *** +bool TFLGpuDelegateBindMetalBufferToTensor(TfLiteDelegate* delegate, + int tensor_index, + id metal_buffer); + // Binds user-defined MTLComputeCommandEncoder. The delegate puts all GPU tasks // into this encoder instead of the internal encoder. // The callback is a user-defined function to take control over encoder and