123456789101112131415161718192021222324 |
- #import "MetalDelagate.h"
- #import "plat_delegate.h"
- #import <metal_delegate.h>
- @implementation MetalDelagate
- void* create_delegate() {
- TFLGpuDelegateOptions delegateOpts = {
- .allow_precision_loss = true,
- .wait_type = TFLGpuDelegateWaitType::TFLGpuDelegateWaitTypeActive,
- // .wait_type = TFLGpuDelegateWaitType::TFLGpuDelegateWaitTypePassive,
- // .wait_type = TFLGpuDelegateWaitType::TFLGpuDelegateWaitTypeDoNotWait,
- // .wait_type = TFLGpuDelegateWaitType::TFLGpuDelegateWaitTypeAggressive,
- .enable_quantization = true,
- };
- auto *TFLGpuDelegate = TFLGpuDelegateCreate(&delegateOpts);
- return TFLGpuDelegate;
- }
- void delete_delegate(void *delegate) {
- TFLGpuDelegateDelete((TfLiteDelegate *)delegate);
- }
- @end
|