Closed Cai-RS closed 6 months ago
@yuefanhao
@Cai-RS I refer to the implementation in the official sample code of TensorRT https://github.com/NVIDIA/TensorRT/blob/28733f0fdccde2967fed395b06ca491af3a561a9/samples/common/buffers.h#L202, in addition, here is an explanation of the difference between cudaMallocHost and malloc https://stackoverflow.com/questions/23133203/cudamallochost-vs-malloc-for-better-performance-shows-no-difference.
你好,感谢你的工作! 我想问一下,在buffers.h文件中,在host上分配的用于数据传输的内存,是否使用页锁定内存更好呢?即是否应该使用cudaMallocHost()/cudaFreeHost(),而不是分配分页内存的Malloc()/free()?