| 180 | } |
| 181 | |
| 182 | int32_t GeluPluginDynamic::enqueue(nvinfer1::PluginTensorDesc const* inputDesc, |
| 183 | nvinfer1::PluginTensorDesc const* outputDesc, void const* const* inputs, void* const* outputs, void* workspace, |
| 184 | cudaStream_t stream) noexcept |
| 185 | { |
| 186 | try |
| 187 | { |
| 188 | PLUGIN_VALIDATE(inputDesc != nullptr); |
| 189 | PLUGIN_VALIDATE(inputs != nullptr); |
| 190 | PLUGIN_VALIDATE(outputs != nullptr); |
| 191 | } |
| 192 | catch (std::exception const& e) |
| 193 | { |
| 194 | caughtError(e); |
| 195 | return STATUS_FAILURE; |
| 196 | } |
| 197 | |
| 198 | int32_t const inputVolume = volume(inputDesc[0].dims); |
| 199 | |
| 200 | // Our plugin outputs only one tensor. |
| 201 | // Launch CUDA kernel wrapper and save its return value. |
| 202 | switch (mType) |
| 203 | { |
| 204 | case DataType::kFLOAT: return enqueueTyped<float>(inputs[0], outputs[0], inputVolume, stream); |
| 205 | case DataType::kHALF: return enqueueTyped<half>(inputs[0], outputs[0], inputVolume, stream); |
| 206 | default: return STATUS_FAILURE; |
| 207 | } |
| 208 | } |
| 209 | |
| 210 | // IPluginV2Ext Methods |
| 211 | nvinfer1::DataType GeluPluginDynamic::getOutputDataType( |
nothing calls this directly
no test coverage detected