|
| 1 | +<!DOCTYPE html> |
| 2 | +<html devsite> |
| 3 | +<head> |
| 4 | + <title>lite/acceleration/configuration/c/delegate_plugin.h</title> |
| 5 | + <meta name="page_type" value="reference" /> |
| 6 | +</head> |
| 7 | +<body> |
| 8 | + <div id="top"><!-- do not remove this div --></div> |
| 9 | + <h1>lite/acceleration/configuration/c/delegate_plugin.h</h1> |
| 10 | + <p>C API types for TF Lite delegate plugins. </p> |
| 11 | + <h2>Summary</h2> |
| 12 | + <p> |
| 13 | + <aside class="note"><strong>Note:</strong> Users of TensorFlow Lite should use <pre class="prettyprint">#include "tensorflow/lite/acceleration/configuration/c/delegate_plugin.h"</pre> to access the APIs documented on this page. </aside> |
| 14 | + </p> |
| 15 | + <table class="properties responsive"> |
| 16 | + <tr> |
| 17 | + <th colspan="2"> |
| 18 | + <h3>Typedefs</h3> |
| 19 | + </th> |
| 20 | + </tr> |
| 21 | + <tr> |
| 22 | + <td> |
| 23 | + <code><a href="#group__delegate__plugin_1ga148ca1be6a1af9540686b7b65a371a8d">TfLiteDelegatePlugin</a></code> |
| 24 | + </td> |
| 25 | + <td>typedef<div> |
| 26 | + <code>struct <a href="/lite/api_docs/c/struct/tf-lite-delegate-plugin.html#struct_tf_lite_delegate_plugin">TfLiteDelegatePlugin</a></code> |
| 27 | + </div><div>Struct to hold all the methods for a delegate plugin. </div></td> |
| 28 | + </tr> |
| 29 | + <tr> |
| 30 | + <td> |
| 31 | + <code><a href="#group__delegate__plugin_1ga3688949cd80282bac66e3e8e1c118ca1">TfLiteDelegatePluginCreateFunc</a>(const void *tflite_settings)</code> |
| 32 | + </td> |
| 33 | + <td>typedef<div> |
| 34 | + <code><a href="/lite/api_docs/c/struct/tf-lite-delegate.html#struct_tf_lite_delegate">TfLiteDelegate</a> *</code> |
| 35 | + </div><div>Type of delegate creation function used to allocate and construct a delegate. </div></td> |
| 36 | + </tr> |
| 37 | + <tr> |
| 38 | + <td> |
| 39 | + <code><a href="#group__delegate__plugin_1ga56c8ce15c6841dc756d4295f19c92c7f">TfLiteDelegatePluginDestroyFunc</a>(TfLiteDelegate *)</code> |
| 40 | + </td> |
| 41 | + <td>typedef<div> |
| 42 | + <code>void</code> |
| 43 | + </div><div>Type of function to destroy and deallocate a delegate. </div></td> |
| 44 | + </tr> |
| 45 | + <tr> |
| 46 | + <td> |
| 47 | + <code><a href="#group__delegate__plugin_1ga843989c081ce4f553578baea93858b1e">TfLiteDelegatePluginGetDelegateErrnoFunc</a>(TfLiteDelegate *)</code> |
| 48 | + </td> |
| 49 | + <td>typedef<div> |
| 50 | + <code>int</code> |
| 51 | + </div><div>Type of function to return an error code for the last delegate operation. </div></td> |
| 52 | + </tr> |
| 53 | + <tr> |
| 54 | + <td> |
| 55 | + <code><a href="#group__delegate__plugin_1ga8f0fafe3eb5588737436726ad7049bea">TfLiteOpaqueDelegatePlugin</a></code> |
| 56 | + </td> |
| 57 | + <td>typedef<div> |
| 58 | + <code><a href="/lite/api_docs/c/struct/tf-lite-delegate-plugin.html#struct_tf_lite_delegate_plugin">TfLiteDelegatePlugin</a></code> |
| 59 | + </div></td> |
| 60 | + </tr> |
| 61 | + <tr> |
| 62 | + <td> |
| 63 | + <code><a href="#group__delegate__plugin_1gacedb45c5eb5ccc01b06e75641c03b9c2">TfLiteOpaqueDelegatePluginCreateFunc</a></code> |
| 64 | + </td> |
| 65 | + <td>typedef<div> |
| 66 | + <code><a href="/lite/api_docs/c/group/delegate-plugin.html#group__delegate__plugin_1ga3688949cd80282bac66e3e8e1c118ca1">TfLiteDelegatePluginCreateFunc</a></code> |
| 67 | + </div></td> |
| 68 | + </tr> |
| 69 | + <tr> |
| 70 | + <td> |
| 71 | + <code><a href="#group__delegate__plugin_1gad3d837f94c2ecb53105d102961bc1f52">TfLiteOpaqueDelegatePluginDestroyFunc</a></code> |
| 72 | + </td> |
| 73 | + <td>typedef<div> |
| 74 | + <code><a href="/lite/api_docs/c/group/delegate-plugin.html#group__delegate__plugin_1ga56c8ce15c6841dc756d4295f19c92c7f">TfLiteDelegatePluginDestroyFunc</a></code> |
| 75 | + </div></td> |
| 76 | + </tr> |
| 77 | + <tr> |
| 78 | + <td> |
| 79 | + <code><a href="#group__delegate__plugin_1ga8005a0549e59f5dbc08cdd0d265a267b">TfLiteOpaqueDelegatePluginGetDelegateErrnoFunc</a></code> |
| 80 | + </td> |
| 81 | + <td>typedef<div> |
| 82 | + <code><a href="/lite/api_docs/c/group/delegate-plugin.html#group__delegate__plugin_1ga843989c081ce4f553578baea93858b1e">TfLiteDelegatePluginGetDelegateErrnoFunc</a></code> |
| 83 | + </div></td> |
| 84 | + </tr> |
| 85 | + </table> |
| 86 | + <table class="constants responsive"> |
| 87 | + <tr> |
| 88 | + <th colspan="2"> |
| 89 | + <h3>Structs</h3> |
| 90 | + </th> |
| 91 | + </tr> |
| 92 | + <tr> |
| 93 | + <td> |
| 94 | + <a href="/lite/api_docs/c/struct/tf-lite-delegate-plugin">TfLiteDelegatePlugin</a> |
| 95 | + </td> |
| 96 | + <td> |
| 97 | + <p>Struct to hold all the methods for a delegate plugin. </p> |
| 98 | + </td> |
| 99 | + </tr> |
| 100 | + </table> |
| 101 | + <h2>Typedefs</h2> |
| 102 | + <div id="group__delegate__plugin_1ga148ca1be6a1af9540686b7b65a371a8d"> |
| 103 | + <h3>TfLiteDelegatePlugin</h3> |
| 104 | + <pre class="prettyprint">struct <a href="/lite/api_docs/c/struct/tf-lite-delegate-plugin.html#struct_tf_lite_delegate_plugin">TfLiteDelegatePlugin</a> TfLiteDelegatePlugin</pre> |
| 105 | + <div> |
| 106 | + <p>Struct to hold all the methods for a delegate plugin. </p> |
| 107 | + </div> |
| 108 | + </div> |
| 109 | + <div id="group__delegate__plugin_1ga3688949cd80282bac66e3e8e1c118ca1"> |
| 110 | + <h3>TfLiteDelegatePluginCreateFunc</h3> |
| 111 | + <pre class="prettyprint"><a href="/lite/api_docs/c/struct/tf-lite-delegate.html#struct_tf_lite_delegate">TfLiteDelegate</a> * TfLiteDelegatePluginCreateFunc(const void *tflite_settings)</pre> |
| 112 | + <div> |
| 113 | + <p>Type of delegate creation function used to allocate and construct a delegate. </p> |
| 114 | + <p>The <code>tflite_settings</code> parameter passed to the delegate creation function should be a pointer to a FlatBuffer table object of type <code>tflite::TFLiteSettings</code>. We use <code>const void *</code> here rather than <code>const tflite::TFLiteSettings*</code> since this is a C API so we don't want to directly reference C++ types such as <code>tflite::TFLiteSettings</code>. But note that this address should point to the 'parsed' FlatBuffer object, not the raw byte buffer. (Note that 'parsing' FlatBuffers is very cheap, it's just an offset load.)</p> |
| 115 | + <p>If you are using the FlatBuffers C API, then you can alternatively pass in a value of type <code>tflite_TFLiteSettings_table_t</code>, which is a typedef for <code>const struct tflite_TFLiteSettings_table*</code> that is the corresponding type for the 'parsed' FlatBuffer object in the FlatBuffers C API.</p> |
| 116 | + <p>Ownership of the <code>tflite_settings</code> flatbuffer remains with the caller. The caller of a delegate creation function may end the lifetime of the <code>tflite_settings</code> FlatBuffer immediately after the call to the function. So the delegate creation function should ensure that any settings that the delegate may need to reference later, after the delegate has been constructed, are copied from the FlatBuffer into storage owned by the delegate. </p> |
| 117 | + </div> |
| 118 | + </div> |
| 119 | + <div id="group__delegate__plugin_1ga56c8ce15c6841dc756d4295f19c92c7f"> |
| 120 | + <h3>TfLiteDelegatePluginDestroyFunc</h3> |
| 121 | + <pre class="prettyprint">void TfLiteDelegatePluginDestroyFunc(TfLiteDelegate *)</pre> |
| 122 | + <div> |
| 123 | + <p>Type of function to destroy and deallocate a delegate. </p> |
| 124 | + <p>The delegate argument must have been created with the corresponding create function from the same delegate plugin. </p> |
| 125 | + </div> |
| 126 | + </div> |
| 127 | + <div id="group__delegate__plugin_1ga843989c081ce4f553578baea93858b1e"> |
| 128 | + <h3>TfLiteDelegatePluginGetDelegateErrnoFunc</h3> |
| 129 | + <pre class="prettyprint">int TfLiteDelegatePluginGetDelegateErrnoFunc(TfLiteDelegate *)</pre> |
| 130 | + <div> |
| 131 | + <p>Type of function to return an error code for the last delegate operation. </p> |
| 132 | + <p>The delegate argument must have been created with the corresponding create function from the same delegate plugin. </p> |
| 133 | + </div> |
| 134 | + </div> |
| 135 | + <div id="group__delegate__plugin_1ga8f0fafe3eb5588737436726ad7049bea"> |
| 136 | + <h3>TfLiteOpaqueDelegatePlugin</h3> |
| 137 | + <pre class="prettyprint"><a href="/lite/api_docs/c/struct/tf-lite-delegate-plugin.html#struct_tf_lite_delegate_plugin">TfLiteDelegatePlugin</a> TfLiteOpaqueDelegatePlugin</pre> |
| 138 | + <div /> |
| 139 | + </div> |
| 140 | + <div id="group__delegate__plugin_1gacedb45c5eb5ccc01b06e75641c03b9c2"> |
| 141 | + <h3>TfLiteOpaqueDelegatePluginCreateFunc</h3> |
| 142 | + <pre class="prettyprint"><a href="/lite/api_docs/c/group/delegate-plugin.html#group__delegate__plugin_1ga3688949cd80282bac66e3e8e1c118ca1">TfLiteDelegatePluginCreateFunc</a> TfLiteOpaqueDelegatePluginCreateFunc</pre> |
| 143 | + <div /> |
| 144 | + </div> |
| 145 | + <div id="group__delegate__plugin_1gad3d837f94c2ecb53105d102961bc1f52"> |
| 146 | + <h3>TfLiteOpaqueDelegatePluginDestroyFunc</h3> |
| 147 | + <pre class="prettyprint"><a href="/lite/api_docs/c/group/delegate-plugin.html#group__delegate__plugin_1ga56c8ce15c6841dc756d4295f19c92c7f">TfLiteDelegatePluginDestroyFunc</a> TfLiteOpaqueDelegatePluginDestroyFunc</pre> |
| 148 | + <div /> |
| 149 | + </div> |
| 150 | + <div id="group__delegate__plugin_1ga8005a0549e59f5dbc08cdd0d265a267b"> |
| 151 | + <h3>TfLiteOpaqueDelegatePluginGetDelegateErrnoFunc</h3> |
| 152 | + <pre class="prettyprint"><a href="/lite/api_docs/c/group/delegate-plugin.html#group__delegate__plugin_1ga843989c081ce4f553578baea93858b1e">TfLiteDelegatePluginGetDelegateErrnoFunc</a> TfLiteOpaqueDelegatePluginGetDelegateErrnoFunc</pre> |
| 153 | + <div /> |
| 154 | + </div> |
| 155 | +</body> |
| 156 | +</html> |
0 commit comments