# API

Qualcomm Linux 提供 [Qualcomm® Intelligent Multimedia SDK (IM SDK) Gstreamer 插件 API](https://docs.qualcomm.com/bundle/publicresource/topics/80-70015-50/qim-sdk-plugins.html)，用来
与 Qualcomm AI 栈 SDK API 进行对接，从而在 NPU、GPU、CPU 等硬件模块上以最佳方式运行深度学习模型。

<?xml version="1.0" encoding="utf-8" standalone="no"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<!-- Generated by Microsoft Visio, SVG Export interfaces.svg Page-1 -->
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:ev="http://www.w3.org/2001/xml-events" xmlns:v="http://schemas.microsoft.com/visio/2003/SVGExtensions/" width="8.69792in" height="5.24308in" viewbox="0 0 626.25 377.502" xml:space="preserve" color-interpolation-filters="sRGB" class="st17"><v:documentproperties v:langid="1033" v:viewmarkup="false"></v:documentproperties>
<style>.svg-1 .st1 { fill: #ffffff; stroke: #d8d8d8; stroke-linecap: round; stroke-linejoin: round; stroke-width: 0.75 }
.svg-1 .st2 { fill: #000000; font-family: Roboto; font-size: 1.00001em }
.svg-1 .st3 { font-size: 1em }
.svg-1 .st4 { fill: #4a5a75; stroke: #d8d8d8; stroke-linecap: round; stroke-linejoin: round; stroke-width: 0.75 }
.svg-1 .st5 { fill: #ffffff; font-family: Roboto; font-size: 1.00001em }
.svg-1 .st6 { fill: #3253dc; stroke: #d8d8d8; stroke-linecap: round; stroke-linejoin: round; stroke-width: 0.75 }
.svg-1 .st7 { baseline-shift: 32.4941%; font-size: 0.649882em }
.svg-1 .st8 { fill: #3253dc; stroke: none; stroke-linecap: round; stroke-linejoin: round; stroke-width: 0.75 }
.svg-1 .st9 { fill: #dee3ec; stroke: none; stroke-linecap: round; stroke-linejoin: round; stroke-width: 0.75 }
.svg-1 .st10 { font-size: 0.83333em }
.svg-1 .st11 { marker-end: url("#mrkr13-51"); stroke: #dee3ec; stroke-linecap: round; stroke-linejoin: round; stroke-width: 0.75 }
.svg-1 .st12 { fill: #dee3ec; fill-opacity: 1; stroke: #dee3ec; stroke-opacity: 1; stroke-width: 0.22935779816514 }
.svg-1 .st13 { marker-end: url("#mrkr13-57"); stroke: #7030a0; stroke-linecap: round; stroke-linejoin: round; stroke-width: 0.75 }
.svg-1 .st14 { fill: #7030a0; fill-opacity: 1; stroke: #7030a0; stroke-opacity: 1; stroke-width: 0.22935779816514 }
.svg-1 .st15 { fill: #f5f6f7; fill-opacity: 0.8; stroke: none; stroke-linecap: round; stroke-linejoin: round; stroke-width: 0.75 }
.svg-1 .st16 { fill: #7ba0ff; stroke: #7ba0ff; stroke-linecap: round; stroke-linejoin: round; stroke-width: 0.75 }
.svg-1 .st17 { fill: none; fill-rule: evenodd; font-size: 12px; overflow: visible; stroke-linecap: square; stroke-miterlimit: 3 }</style>
<defs id="Markers">	<g id="lend13">		<path d="M 3 1 L 0 0 L 3 -1 L 3 1 " style="stroke:none"></path>	</g>	<marker id="mrkr13-51" class="st12" v:arrowtype="13" v:arrowsize="2" v:setback="13.08" refx="-13.08" orient="auto" markerunits="strokeWidth" overflow="visible">		<use xlink:href="#lend13" transform="scale(-4.36,-4.36) "></use>	</marker>	<marker id="mrkr13-57" class="st14" v:arrowtype="13" v:arrowsize="2" v:setback="13.08" refx="-13.08" orient="auto" markerunits="strokeWidth" overflow="visible">		<use xlink:href="#lend13" transform="scale(-4.36,-4.36) "></use>	</marker></defs><g v:mid="0" v:index="1" v:groupcontext="foregroundPage">	<title>Page-1</title>	<v:pageproperties v:drawingscale="1" v:pagescale="1" v:drawingunits="19" v:shadowoffsetx="9" v:shadowoffsety="-9"></v:pageproperties>	<v:layer v:name="full" v:index="0"></v:layer>	<v:layer v:name="interfaces" v:index="1"></v:layer>	<g id="shape1218-1" v:mid="1218" v:groupcontext="shape" transform="translate(13.4356,-9.375)">		<title>Sheet.1218</title>		<desc>Hardware</desc>		<v:textblock v:margins="rect(4,4,4,4)" v:verticalalign="0"></v:textblock>		<v:textrect cx="302.4" cy="332.502" width="604.81" height="90"></v:textrect>		<rect x="0" y="287.502" width="604.8" height="90" rx="4.5" ry="4.5" class="st1"></rect>		<text x="4" y="302.3" class="st2" v:langid="1041"><v:paragraph></v:paragraph><v:tablist></v:tablist>硬件</text>		</g>	<g id="shape1219-4" v:mid="1219" v:groupcontext="shape" transform="translate(13.4356,-116.874)">		<title>Sheet.1219</title>		<desc>AI SDKs</desc>		<v:textblock v:margins="rect(4,4,4,4)" v:verticalalign="0"></v:textblock>		<v:textrect cx="302.4" cy="332.502" width="604.81" height="90"></v:textrect>		<rect x="0" y="287.502" width="604.8" height="90" rx="4.5" ry="4.5" class="st1"></rect>		<text x="4" y="302.3" class="st2" v:langid="1041"><v:paragraph></v:paragraph><v:tablist></v:tablist>AI SDK</text>		</g>	<g id="shape1220-7" v:mid="1220" v:groupcontext="shape" transform="translate(13.4356,-223.624)">		<title>Sheet.1220</title>		<desc>Qualcomm IMSDK Gstreamer plugins</desc>		<v:textblock v:margins="rect(4,4,4,4)" v:verticalalign="0"></v:textblock>		<v:textrect cx="302.4" cy="332.502" width="604.81" height="90"></v:textrect>		<rect x="0" y="287.502" width="604.8" height="90" rx="4.5" ry="4.5" class="st1"></rect>		<text x="4" y="302.3" class="st2" v:langid="1041"><v:paragraph></v:paragraph><v:tablist></v:tablist>Qualcomm <tspan class="st3" v:langid="1033">IMSDK </tspan>Gstreamer <tspan class="st3" v:langid="1033">插件</tspan></text>		</g>	<g id="shape1221-12" v:mid="1221" v:groupcontext="shape" transform="translate(13.4356,-334.989)">		<title>Sheet.1221</title>		<desc>AI applications</desc>		<v:textblock v:margins="rect(4,4,4,4)"></v:textblock>		<v:textrect cx="302.4" cy="358.674" width="604.81" height="37.656"></v:textrect>		<rect x="0" y="339.846" width="604.8" height="37.656" rx="4.5" ry="4.5" class="st4"></rect>		<text x="262.81" y="362.27" class="st5" v:langid="1041"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>AI 应用</text>		</g>	<g id="shape1222-15" v:mid="1222" v:groupcontext="shape" transform="translate(39.8732,-240.375)">		<title>Sheet.1222</title>		<desc>Qualcomm® Neural Processing Engine plugin (qtimlsnpe)</desc>		<v:textblock v:margins="rect(4,4,4,4)"></v:textblock>		<v:textrect cx="122.4" cy="352.734" width="244.8" height="49.536"></v:textrect>		<rect x="0" y="327.966" width="244.8" height="49.536" rx="4.5" ry="4.5" class="st6"></rect>		<text x="20.22" y="349.13" class="st5" v:langid="1041"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>Qualcomm<tspan dy="-0.235em" class="st7" v:basefontsize="12">®</tspan><tspan dy="0.153em" class="st3"> </tspan>Neural Processing Engine <tspan x="74.02" dy="1.2em" class="st3">插件 (qtimlsnpe)</tspan></text>		</g>	<g id="shape1223-21" v:mid="1223" v:groupcontext="shape" transform="translate(39.8732,-133.624)">		<title>Sheet.1223</title>		<desc>Qualcomm Neural Processing Engine</desc>		<v:textblock v:margins="rect(4,4,4,4)"></v:textblock>		<v:textrect cx="122.4" cy="352.752" width="244.8" height="49.5"></v:textrect>		<rect x="0" y="328.002" width="244.8" height="49.5" rx="4.5" ry="4.5" class="st8"></rect>		<text x="23.29" y="356.35" class="st5" v:langid="1041"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>Qualcomm Neural Processing Engine</text>		</g>	<g id="shape1224-24" v:mid="1224" v:groupcontext="shape" transform="translate(331.125,-240.375)">		<title>Sheet.1224</title>		<desc>Qualcomm® AI Engine Direct plugin (qtimlqnn)</desc>		<v:textblock v:margins="rect(4,4,4,4)"></v:textblock>		<v:textrect cx="61.2" cy="352.734" width="122.4" height="49.536"></v:textrect>		<rect x="0" y="327.966" width="122.4" height="49.536" rx="4.5" ry="4.5" class="st6"></rect>		<text x="21.87" y="341.93" class="st5" v:langid="1041"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>Qualcomm<tspan dy="-0.235em" class="st7" v:basefontsize="12">®</tspan><tspan dy="0.153em" class="st3"> </tspan>AI <tspan x="8.23" dy="1.2em" class="st3">Engine Direct 插件 </tspan><tspan x="33.49" dy="1.2em" class="st3">(qtimlqnn)</tspan></text>		</g>	<g id="shape1225-31" v:mid="1225" v:groupcontext="shape" transform="translate(462.525,-240.375)">		<title>Sheet.1225</title>		<desc>TensorFlow Lite plugin (qtimltflite)</desc>		<v:textblock v:margins="rect(4,4,4,4)"></v:textblock>		<v:textrect cx="61.2" cy="352.734" width="122.4" height="49.536"></v:textrect>		<rect x="0" y="327.966" width="122.4" height="49.536" rx="4.5" ry="4.5" class="st6"></rect>		<text x="18.57" y="341.93" class="st5" v:langid="1041"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>TensorFlow Lite <tspan x="44.94" dy="1.2em" class="st3">插件<v:lf></v:lf></tspan><tspan x="29.94" dy="1.2em" class="st3"> </tspan>(qtimltflite)</text>		</g>	<g id="shape1226-36" v:mid="1226" v:groupcontext="shape" transform="translate(39.8732,-25.4676)">		<title>Sheet.1226</title>		<desc>NPU (DSP/HMX/HTP)</desc>		<v:textblock v:margins="rect(4,4,4,4)"></v:textblock>		<v:textrect cx="72" cy="353.022" width="144" height="48.96"></v:textrect>		<rect x="0" y="328.542" width="144" height="48.96" rx="4.5" ry="4.5" class="st9"></rect>		<text x="60.05" y="349.42" class="st2" v:langid="1041"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>NPU <v:newlinechar></v:newlinechar><v:paragraph v:horizalign="1"></v:paragraph><tspan x="34.27" dy="1.44em" class="st10">(DSP/HMX/HTP)</tspan></text>		</g>	<g id="shape1227-40" v:mid="1227" v:groupcontext="shape" transform="translate(240.399,-25.4676)">		<title>Sheet.1227</title>		<desc>GPU</desc>		<v:textblock v:margins="rect(4,4,4,4)"></v:textblock>		<v:textrect cx="72" cy="353.022" width="144" height="48.96"></v:textrect>		<rect x="0" y="328.542" width="144" height="48.96" rx="4.5" ry="4.5" class="st9"></rect>		<text x="60.24" y="356.62" class="st2" v:langid="1041"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>GPU</text>		</g>	<g id="shape1228-43" v:mid="1228" v:groupcontext="shape" transform="translate(440.925,-25.4676)">		<title>Sheet.1228</title>		<desc>CPU</desc>		<v:textblock v:margins="rect(4,4,4,4)"></v:textblock>		<v:textrect cx="72" cy="353.022" width="144" height="48.96"></v:textrect>		<rect x="0" y="328.542" width="144" height="48.96" rx="4.5" ry="4.5" class="st9"></rect>		<text x="60.42" y="356.62" class="st2" v:langid="1041"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>CPU</text>		</g>	<g id="shape1229-46" v:mid="1229" v:groupcontext="shape" v:layermember="0" transform="translate(693.337,42.5124) rotate(90)">		<title>Sheet.1229</title>		<path d="M0 377.5 L11.56 377.5" class="st11"></path>	</g>	<g id="shape1230-52" v:mid="1230" v:groupcontext="shape" transform="translate(539.775,137.318) rotate(90)">		<title>Sheet.1230</title>		<path d="M0 377.5 L47.25 377.5" class="st13"></path>	</g>	<g id="shape1231-58" v:mid="1231" v:groupcontext="shape" v:layermember="0" transform="translate(693.337,260.627) rotate(90)">		<title>Sheet.1231</title>		<path d="M0 377.5 L8.04 377.5" class="st11"></path>	</g>	<g id="shape1233-63" v:mid="1233" v:groupcontext="shape" transform="translate(331.125,-135.375)">		<title>Sheet.1233</title>		<desc>Qualcomm AI Engine Direct</desc>		<v:textblock v:margins="rect(4,4,4,4)"></v:textblock>		<v:textrect cx="126.9" cy="352.752" width="253.81" height="49.5"></v:textrect>		<rect x="0" y="328.002" width="253.8" height="49.5" rx="4.5" ry="4.5" class="st8"></rect>		<text x="9.94" y="356.35" class="st5" v:langid="1041"><v:paragraph></v:paragraph><v:tablist></v:tablist>Qualcomm AI Engine Direct</text>		</g>	<g id="shape1234-66" v:mid="1234" v:groupcontext="shape" transform="translate(919.227,136.554) rotate(90)">		<title>Sheet.1234</title>		<path d="M0 377.5 L47.21 377.5" class="st13"></path>	</g>	<g id="shape1235-71" v:mid="1235" v:groupcontext="shape" transform="translate(769.827,136.624) rotate(90)">		<title>Sheet.1235</title>		<path d="M0 377.5 L47.21 377.5" class="st13"></path>	</g>	<g id="shape1237-76" v:mid="1237" v:groupcontext="shape" v:layermember="1" transform="translate(4.87502,-328.875)">		<title>Sheet.1237</title>		<rect x="0" y="329.25" width="621" height="48.2515" rx="4.5" ry="4.5" class="st15"></rect>	</g>	<g id="shape1238-78" v:mid="1238" v:groupcontext="shape" v:layermember="1" transform="translate(0.375,-0.375)">		<title>Sheet.1238</title>		<rect x="0" y="269.502" width="625.5" height="108" rx="4.5" ry="4.5" class="st15"></rect>	</g>	<g id="shape1240-80" v:mid="1240" v:groupcontext="shape" transform="translate(511.125,-144.375)">		<title>Sheet.1240</title>		<desc>TFLite Delegate</desc>		<v:textblock v:margins="rect(4,4,4,4)"></v:textblock>		<v:textrect cx="30.6" cy="361.752" width="61.2" height="31.5"></v:textrect>		<rect x="0" y="346.002" width="61.2" height="31.5" rx="4.5" ry="4.5" class="st16"></rect>		<text x="13.88" y="358.15" class="st5" v:langid="1033"><v:paragraph v:horizalign="1"></v:paragraph><v:tablist></v:tablist>TFLite <tspan x="7.08" dy="1.2em" class="st3">Delegate</tspan></text>		</g>	<g id="shape1244-84" v:mid="1244" v:groupcontext="shape" transform="translate(284.673,-153.375)">		<title>Sheet.1244</title>		<path d="M0 377.5 L33.64 377.5" class="st13"></path>	</g></g>
</svg>

提供了三个 Gstreamer ML 插件 API，以支持两个 AI 栈 SDK 以及外部的 TFLite，从而为开发者提供灵活性，使其能够选择适合其 AI 需求的最佳组合。

> 
> 
> | [适用于 Qualcomm Neural Processing Engine (qtimlsnpe) 的 Qualcomm IM SDK 插件](https://docs.qualcomm.com/bundle/publicresource/topics/80-70015-50/qtimlsnpe.html) | 使用 [Qualcomm Neural Processing Engine](https://docs.qualcomm.com/bundle/publicresource/topics/80-63442-2) API 来加载和执行模型。<br><br><br>选择此插件可实现快速原型设计和 high-level API 支持。 |
> | --- | --- |
> | [适用于 Qualcomm AI Engine Direct 插件 (qtimlqnn) 的 Qualcomm IM SDK 插件](https://docs.qualcomm.com/bundle/publicresource/topics/80-70015-50/qtimlqnn.html) | 使用 [Qualcomm AI Engine Direct](https://docs.qualcomm.com/bundle/publicresource/topics/80-63442-50) API，这些 API 提供 low-level 统一的接口，并提升性能，以在所需的硬件加速器上优化和执行网络模型。<br><br><br>选择此插件可获得高级的图执行选项和优化。 |
> | [适用于 TensorFlow Lite 的 Qualcomm IM SDK 插件 (qtimltflite)](https://docs.qualcomm.com/bundle/publicresource/topics/80-70015-50/qtimltflite.html) | 使用 [Qualcomm AI Engine Direct](https://docs.qualcomm.com/bundle/publicresource/topics/80-63442-50) 直接加速 TFLite 模型以加载和执行模型。<br><br><br>选择此插件可以直接运行 TFLite 模型，无需转换。 |

**SDK API** - 这些 SDK 为应用程序开发者提供 AI API。

> 
> 
> | [Qualcomm Neural Processing Engine SDK](https://docs.qualcomm.com/bundle/publicresource/topics/80-63442-2/api.html) | C、C++ 和 Java API，支持异构计算、系统级配置并将 AI 工作负载引导至所有加速器核心。<br><br><br>为开发者提供灵活性，包括核心间协作支持和其他高级功能。 |
> | --- | --- |
> | [Qualcomm AI Engine Direct](https://docs.qualcomm.com/bundle/publicresource/topics/80-63442-50/api.html) | Low-level 高度可定制的 API，通过各自的库加速所有 AI 加速核心上的 AI 模型。<br><br><br>该 SDK 可以用于指定的加速器核心或各流行 runtime 的 delegate 工作负载，其中包括<br><br><br>Qualcomm Neural Processing Engine SDK、TensorFlow Lite 和 ONNX runtime。 |

Last Published: Dec 10, 2024

[Previous Topic
架构](https://docs.qualcomm.com/bundle/publicresource/80-70015-15SC/topics/architecture.md) [Next Topic
示例程序](https://docs.qualcomm.com/bundle/publicresource/80-70015-15SC/topics/sample-apps.md)