Skip to content

Commit

Permalink
feat: support EDGETPU_NNAPI (#1309)
Browse files Browse the repository at this point in the history
  • Loading branch information
homuler authored Jan 13, 2025
1 parent fc1eec7 commit 808fbb1
Showing 1 changed file with 16 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,10 @@ public sealed class BaseOptions
{
public enum Delegate
{
CPU,
GPU,
CPU = 0,
GPU = 1,
// Edge TPU acceleration using NNAPI delegate.
EDGETPU_NNAPI = 2,
}

public Delegate delegateCase { get; } = Delegate.CPU;
Expand Down Expand Up @@ -39,7 +41,18 @@ private Proto.Acceleration acceleration
case Delegate.GPU:
return new Proto.Acceleration
{
Gpu = new InferenceCalculatorOptions.Types.Delegate.Types.Gpu { },
Gpu = new InferenceCalculatorOptions.Types.Delegate.Types.Gpu
{
UseAdvancedGpuApi = true,
},
};
case Delegate.EDGETPU_NNAPI:
return new Proto.Acceleration
{
Nnapi = new InferenceCalculatorOptions.Types.Delegate.Types.Nnapi
{
AcceleratorName = "google-edgetpu",
},
};
default:
return null;
Expand Down

0 comments on commit 808fbb1

Please sign in to comment.