| 337 | |
| 338 | template <class DType> |
| 339 | void copy_to_gpu_async(DType* hptr, DType* dptr, std::vector<int> shape, |
| 340 | cudaStream_t stream = 0) { |
| 341 | CUDA_CHECK(cudaMemcpyAsync( |
| 342 | dptr, hptr, |
| 343 | std::accumulate(shape.begin(), shape.end(), 1, std::multiplies<int>()) * |
| 344 | sizeof(DType), |
| 345 | cudaMemcpyHostToDevice, stream)); |
| 346 | } |
| 347 | |
| 348 | template <class DType> |
| 349 | void copy_to_cpu(DType* hptr, DType* dptr, std::vector<int> shape) { |
nothing calls this directly
no outgoing calls
no test coverage detected