9 #include <tensorflow/lite/minimal_logging.h> 30 "gpu-kernel-profiling-enabled"};
90 char** options_values,
92 void (*report_error)(
const char*))
95 TfLiteDelegate* delegate =
nullptr;
101 for (
size_t i = 0; i < num_options; ++i)
104 if (std::string(options_keys[i]) == std::string(
"backends"))
107 std::vector<armnn::BackendId> backends;
109 pch = strtok(options_values[i],
",");
112 backends.push_back(pch);
113 pch = strtok (NULL,
",");
118 else if (std::string(options_keys[i]) == std::string(
"logging-severity"))
123 else if (std::string(options_keys[i]) == std::string(
"gpu-tuning-level"))
128 else if (std::string(options_keys[i]) == std::string(
"gpu-mlgo-tuning-file"))
133 else if (std::string(options_keys[i]) == std::string(
"gpu-tuning-file"))
138 else if (std::string(options_keys[i]) == std::string(
"gpu-kernel-profiling-enabled"))
144 else if (std::string(options_keys[i]) == std::string(
"reduce-fp32-to-fp16"))
149 else if (std::string(options_keys[i]) == std::string(
"reduce-fp32-to-bf16"))
154 else if (std::string(options_keys[i]) == std::string(
"debug-data"))
156 optimizerOptions.
m_Debug = *options_values[i] !=
'0';
159 else if (std::string(options_keys[i]) == std::string(
"memory-import"))
165 throw armnn::Exception(
"Unknown option for the ArmNN Delegate given: " + std::string(options_keys[i]));
171 catch (
const std::exception& ex)
175 report_error(ex.what());
TfLiteDelegate * tflite_plugin_create_delegate(char **options_keys, char **options_values, size_t num_options, void(*report_error)(const char *))
Create an ArmNN delegate plugin.
std::vector< std::string > gpu_options
This file defines two symbols that need to be exported to use the TFLite external delegate provider...
void SetLoggingSeverity(const armnn::LogSeverity &level)
Sets the severity level for logging within ArmNN that will be used on creation of the delegate...
Struct for the users to pass backend specific options.
TfLiteDelegate * TfLiteArmnnDelegateCreate(armnnDelegate::DelegateOptions options)
Base class for all ArmNN exceptions so that users can filter to just those.
void SetBackends(const std::vector< armnn::BackendId > &backends)
void TfLiteArmnnDelegateDelete(TfLiteDelegate *tfLiteDelegate)
DelegateOptions TfLiteArmnnDelegateOptionsDefault()
void AddBackendOption(const armnn::BackendOptions &option)
Appends a backend option to the list of backend options.
void SetOptimizerOptions(const armnn::OptimizerOptions &optimizerOptions)
void tflite_plugin_destroy_delegate(TfLiteDelegate *delegate)
Destroy a given delegate plugin.