| 216 | } |
| 217 | |
| 218 | IPluginV2Ext* 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 | |
| 241 | IPluginV2Ext* ReorgPluginCreator::deserializePlugin( |
| 242 | char const* name, void const* serialData, size_t serialLength) noexcept |
nothing calls this directly
no test coverage detected