MCPcopy Create free account
hub / github.com/NVIDIA/TensorRT / createPlugin

Method createPlugin

plugin/reorgPlugin/reorgPlugin.cpp:218–239  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

216}
217
218IPluginV2Ext* ReorgPluginCreator::createPlugin(char const* name, PluginFieldCollection const* fc) noexcept
219{
220 try
221 {
222 PluginField const* fields = fc->fields;
223 PLUGIN_VALIDATE(fc->nbFields == 1);
224 PLUGIN_VALIDATE(fields[0].type == PluginFieldType::kINT32);
225 PLUGIN_VALIDATE(!strcmp(fields[0].name, "stride"));
226 stride = static_cast<int32_t>(*(static_cast<int32_t const*>(fields[0].data)));
227
228 PLUGIN_VALIDATE(stride > 0);
229
230 Reorg* obj = new Reorg(stride);
231 obj->setPluginNamespace(mNamespace.c_str());
232 return obj;
233 }
234 catch (std::exception const& e)
235 {
236 caughtError(e);
237 }
238 return nullptr;
239}
240
241IPluginV2Ext* ReorgPluginCreator::deserializePlugin(
242 char const* name, void const* serialData, size_t serialLength) noexcept

Callers

nothing calls this directly

Calls 3

caughtErrorFunction · 0.85
c_strMethod · 0.80
setPluginNamespaceMethod · 0.45

Tested by

no test coverage detected