MCPcopy Create free account
hub / github.com/NVIDIA/FasterTransformer / toDevice

Method toDevice

tests/unittests/gtest_utils.h:230–238  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

228
229 template<typename T>
230 ft::Tensor toDevice(ft::Tensor& host_tensor)
231 {
232 if (host_tensor.data == nullptr) {
233 return ft::Tensor();
234 }
235 ft::Tensor device_tensor = createTensor(ft::MEMORY_GPU, host_tensor.type, host_tensor.shape);
236 ft::cudaAutoCpy(device_tensor.getPtr<T>(), host_tensor.getPtr<T>(), host_tensor.size(), stream);
237 return device_tensor;
238 };
239
240 void copyTensor(ft::Tensor& dst, ft::Tensor& src)
241 {

Callers

nothing calls this directly

Calls 2

TensorClass · 0.50
sizeMethod · 0.45

Tested by

no test coverage detected