| 43 | REGISTER_TENSORRT_PLUGIN(GeluPluginDynamicCreator); |
| 44 | |
| 45 | GeluPluginDynamic::GeluPluginDynamic(const std::string name, const DataType type, Weights const& bias) |
| 46 | : mLayerName(name) |
| 47 | , mType(type) |
| 48 | , mLd(bias.count) |
| 49 | { |
| 50 | mHasBias = (bias.values != nullptr); |
| 51 | if (mHasBias) |
| 52 | { |
| 53 | void* cudaMem{nullptr}; |
| 54 | PLUGIN_CUASSERT(cudaMalloc(&cudaMem, getWeightsSize(bias, mType))); |
| 55 | PLUGIN_CUASSERT(cudaMemcpy(cudaMem, bias.values, getWeightsSize(bias, mType), cudaMemcpyHostToDevice)); |
| 56 | make_cuda_shared(mBiasDev, cudaMem); |
| 57 | } |
| 58 | } |
| 59 | |
| 60 | GeluPluginDynamic::GeluPluginDynamic(const std::string name, void const* data, size_t length) |
| 61 | : mLayerName(name) |
nothing calls this directly
no test coverage detected