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

Function copyToDevice

plugin/common/bertCommon.h:404–413  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

402
403template <typename T>
404inline void copyToDevice(WeightsWithOwnership& hostWeights, size_t nbBytes, cuda_unique_ptr<T>& cudaWeights)
405{
406 if (hostWeights.values)
407 {
408 void* cudaMem{nullptr};
409 PLUGIN_CUASSERT(cudaMalloc(&cudaMem, nbBytes));
410 PLUGIN_CUASSERT(cudaMemcpy(cudaMem, hostWeights.values, nbBytes, cudaMemcpyHostToDevice));
411 cudaWeights.reset(static_cast<T*>(cudaMem));
412 }
413}
414
415inline void convertAndCopyToDevice(nvinfer1::Weights const& src, float* destDev)
416{

Callers 11

NormalizeMethod · 0.85
deserializeToDeviceMethod · 0.85
GridAnchorGeneratorMethod · 0.85
deserializeToDeviceMethod · 0.85
FCPluginDynamicMethod · 0.85
setupDeviceMemoryMethod · 0.85
configurePluginMethod · 0.85

Calls 1

resetMethod · 0.45

Tested by

no test coverage detected