Moved to experimental api
This commit is contained in:
parent
5ae1f6d934
commit
b97023504c
@ -79,11 +79,6 @@ void TfLiteInterpreterOptionsSetNumThreads(TfLiteInterpreterOptions* options,
|
||||
options->num_threads = num_threads;
|
||||
}
|
||||
|
||||
void TfLiteInterpreterOptionsSetUseNNAPI(TfLiteInterpreterOptions* options,
|
||||
bool enable) {
|
||||
options->useNNAPI = enable;
|
||||
}
|
||||
|
||||
void TfLiteInterpreterOptionsAddDelegate(TfLiteInterpreterOptions* options,
|
||||
TfLiteDelegate* delegate) {
|
||||
options->delegates.push_back(delegate);
|
||||
|
@ -120,10 +120,6 @@ TFL_CAPI_EXPORT extern void TfLiteInterpreterOptionsDelete(
|
||||
TFL_CAPI_EXPORT extern void TfLiteInterpreterOptionsSetNumThreads(
|
||||
TfLiteInterpreterOptions* options, int32_t num_threads);
|
||||
|
||||
// Enable or disable the NN API for the interpreter (true to enable).
|
||||
TFL_CAPI_EXPORT extern void TfLiteInterpreterOptionsSetUseNNAPI(
|
||||
TfLiteInterpreterOptions* options, bool enable);
|
||||
|
||||
// Adds a delegate to be applied during `TfLiteInterpreter` creation.
|
||||
//
|
||||
// If delegate application fails, interpreter creation will also fail with an
|
||||
|
@ -50,6 +50,11 @@ void TfLiteInterpreterOptionsAddCustomOp(TfLiteInterpreterOptions* options,
|
||||
options->op_resolver.AddCustom(name, registration, min_version, max_version);
|
||||
}
|
||||
|
||||
void TfLiteInterpreterOptionsSetUseNNAPI(TfLiteInterpreterOptions* options,
|
||||
bool enable) {
|
||||
options->useNNAPI = enable;
|
||||
}
|
||||
|
||||
#ifdef __cplusplus
|
||||
} // extern "C"
|
||||
#endif // __cplusplus
|
||||
|
@ -49,6 +49,10 @@ TFL_CAPI_EXPORT void TfLiteInterpreterOptionsAddCustomOp(
|
||||
const TfLiteRegistration* registration, int32_t min_version,
|
||||
int32_t max_version);
|
||||
|
||||
// Enable or disable the NN API for the interpreter (true to enable).
|
||||
TFL_CAPI_EXPORT extern void TfLiteInterpreterOptionsSetUseNNAPI(
|
||||
TfLiteInterpreterOptions* options, bool enable);
|
||||
|
||||
#ifdef __cplusplus
|
||||
} // extern "C"
|
||||
#endif // __cplusplus
|
||||
|
@ -41,6 +41,7 @@ TEST(CApiExperimentalTest, Smoke) {
|
||||
TfLiteInterpreterOptions* options = TfLiteInterpreterOptionsCreate();
|
||||
TfLiteInterpreterOptionsAddBuiltinOp(options, kTfLiteBuiltinAdd,
|
||||
GetDummyRegistration(), 1, 1);
|
||||
TfLiteInterpreterOptionsSetUseNNAPI(options, true);
|
||||
|
||||
TfLiteInterpreter* interpreter = TfLiteInterpreterCreate(model, options);
|
||||
ASSERT_NE(interpreter, nullptr);
|
||||
|
@ -38,7 +38,6 @@ TEST(CApiSimple, Smoke) {
|
||||
TfLiteInterpreterOptions* options = TfLiteInterpreterOptionsCreate();
|
||||
ASSERT_NE(options, nullptr);
|
||||
TfLiteInterpreterOptionsSetNumThreads(options, 2);
|
||||
TfLiteInterpreterOptionsSetUseNNAPI(options, true);
|
||||
|
||||
TfLiteInterpreter* interpreter = TfLiteInterpreterCreate(model, options);
|
||||
ASSERT_NE(interpreter, nullptr);
|
||||
|
Loading…
Reference in New Issue
Block a user