TFLGpuDelegateSetCommandEncoder replaced by TFLGpuDelegateSetCommandBuffer.
PiperOrigin-RevId: 346586647 Change-Id: Ie40d5a9659cd4d031e8073f16fb78e31e7885a84
This commit is contained in:
parent
d8284109f2
commit
8fe56f0807
@ -716,6 +716,14 @@ bool TFLGpuDelegateBindMetalBufferToTensor(TfLiteDelegate* delegate, int tensor_
|
|||||||
|
|
||||||
// Note: This function is not exposed in `metal_delegate.h`, but it's exposed in
|
// Note: This function is not exposed in `metal_delegate.h`, but it's exposed in
|
||||||
// `metal_delegate_internal.h`.
|
// `metal_delegate_internal.h`.
|
||||||
|
bool TFLGpuDelegateSetCommandEncoder(
|
||||||
|
TfLiteDelegate* delegate, id<MTLComputeCommandEncoder> encoder) {
|
||||||
|
auto* metal_delegate = ::tflite::gpu::metal::GetMetalDelegate(delegate);
|
||||||
|
if (!metal_delegate) return false;
|
||||||
|
metal_delegate->SetCommandEncoder(encoder);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
bool TFLGpuDelegateSetCommandBuffer(TfLiteDelegate* delegate,
|
bool TFLGpuDelegateSetCommandBuffer(TfLiteDelegate* delegate,
|
||||||
id<MTLCommandBuffer> command_buffer) {
|
id<MTLCommandBuffer> command_buffer) {
|
||||||
auto* metal_delegate = ::tflite::gpu::metal::GetMetalDelegate(delegate);
|
auto* metal_delegate = ::tflite::gpu::metal::GetMetalDelegate(delegate);
|
||||||
|
@ -33,6 +33,11 @@ bool TFLGpuDelegateBindMetalBufferToTensor(TfLiteDelegate* delegate,
|
|||||||
int tensor_index,
|
int tensor_index,
|
||||||
id<MTLBuffer> metal_buffer);
|
id<MTLBuffer> metal_buffer);
|
||||||
|
|
||||||
|
// Binds user-defined MTLComputeCommandEncoder. The delegate puts all GPU tasks
|
||||||
|
// into this encoder instead of the internal encoder.
|
||||||
|
bool TFLGpuDelegateSetCommandEncoder(TfLiteDelegate* delegate,
|
||||||
|
id<MTLComputeCommandEncoder> encoder);
|
||||||
|
|
||||||
// Binds user-defined MTLCommandBuffer. The delegate puts all GPU tasks
|
// Binds user-defined MTLCommandBuffer. The delegate puts all GPU tasks
|
||||||
// into this buffer instead of the internal command buffer.
|
// into this buffer instead of the internal command buffer.
|
||||||
bool TFLGpuDelegateSetCommandBuffer(TfLiteDelegate* delegate,
|
bool TFLGpuDelegateSetCommandBuffer(TfLiteDelegate* delegate,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user