Reputation: 1
I'm writing a program which relies on tensorflow lite GPU v2 capabilities link. At initialization step, I'm trying to create the GPU v2 delegate. However, on several devices the required OpenCL library is not available and I'd like to use the CPU delegate instead of automatic GPU v1 (GLES) fallback.
I've tried following code but the delegate is created (not null) even when OpenCL is not available.
TfLiteDelegate* delegate = TfLiteGpuDelegateV2Create(&optionsV2);
if (delegate == nullptr) LOGV("launchDelegate", "==> Failed to create GPU v2 delegate");
TfLiteInterpreterOptionsAddDelegate(options, delegate);
How do I detect that the GPU v2 delegate is not available at initialization so I can control the fallback options?
Upvotes: 0
Views: 367
Reputation: 146
Can you share what options you've specified with optionsV2
? enabling TFLITE_GPU_EXPERIMENTAL_FLAGS_CL_ONLY
experimental flag might be worth trying.
Upvotes: 1