| 402 | |
| 403 | template <typename T> |
| 404 | inline 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 | |
| 415 | inline void convertAndCopyToDevice(nvinfer1::Weights const& src, float* destDev) |
| 416 | { |
no test coverage detected