allocate static method

Pointer<TfLiteGpuDelegateOptionsV2> allocate(
  1. bool isPrecisionLossAllowed,
  2. TfLiteGpuInferenceUsage inferencePreference,
  3. TfLiteGpuInferencePriority inferencePriority1,
  4. TfLiteGpuInferencePriority inferencePriority2,
  5. TfLiteGpuInferencePriority inferencePriority3,
)

Implementation

static Pointer<TfLiteGpuDelegateOptionsV2> allocate(
    bool isPrecisionLossAllowed,
    TfLiteGpuInferenceUsage inferencePreference,
    TfLiteGpuInferencePriority inferencePriority1,
    TfLiteGpuInferencePriority inferencePriority2,
    TfLiteGpuInferencePriority inferencePriority3) {
  final result = calloc<TfLiteGpuDelegateOptionsV2>();
  result.ref
    ..isPrecisionLossAllowed = isPrecisionLossAllowed ? 1 : 0
    ..inferencePreference = inferencePreference.index
    ..inferencePriority1 = inferencePriority1.index
    ..inferencePriority2 = inferencePriority2.index
    ..inferencePriority3 = inferencePriority3.index;
  return result;
}