| 150 | #endif |
| 151 | template <typename TStream> |
| 152 | inline void Tensor2Pinned(phi::DenseTensor *tensor, const TStream &stream) { |
| 153 | #if defined(PADDLE_WITH_CUDA) |
| 154 | const size_t mem_len = tensor->memory_size(); |
| 155 | auto place = phi::GPUPinnedPlace(); |
| 156 | auto holder = memory::AllocShared(place, mem_len); |
| 157 | memory::Copy( |
| 158 | place, holder->ptr(), tensor->place(), tensor->data(), mem_len, stream); |
| 159 | tensor->ResetHolderWithType(holder, tensor->dtype()); |
| 160 | #endif |
| 161 | } |
| 162 | template <typename TCopyer> |
| 163 | void HogwildWorker::OffLoadVarInfo::CopyInputs(const Scope *root, |
| 164 | const phi::Place &place, |
no test coverage detected