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

Method copyTensor

tests/unittests/gtest_utils.h:240–247  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

238 };
239
240 void copyTensor(ft::Tensor& dst, ft::Tensor& src)
241 {
242 FT_CHECK_WITH_INFO(
243 src.sizeBytes() == dst.sizeBytes(),
244 ft::fmtstr("src and dst has different size (%ld != %ld)", src.sizeBytes(), dst.sizeBytes()));
245 ft::cudaAutoCpy(dst.getPtr<char>(), src.getPtr<char>(), src.sizeBytes(), stream);
246 cudaStreamSynchronize(stream);
247 }
248
249};
250

Callers

nothing calls this directly

Calls 2

fmtstrFunction · 0.85
sizeBytesMethod · 0.80

Tested by

no test coverage detected