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

Method GeluPluginDynamic

plugin/geluPlugin/geluPlugin.cpp:45–58  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

43REGISTER_TENSORRT_PLUGIN(GeluPluginDynamicCreator);
44
45GeluPluginDynamic::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
60GeluPluginDynamic::GeluPluginDynamic(const std::string name, void const* data, size_t length)
61 : mLayerName(name)

Callers

nothing calls this directly

Calls 4

getWeightsSizeFunction · 0.85
make_cuda_sharedFunction · 0.85
deserialize_valueFunction · 0.85
getElementSizeFunction · 0.50

Tested by

no test coverage detected