sair-lab / AirSLAM

🚀 AirVO upgrades to AirSLAM 🚀
GNU General Public License v3.0
755 stars 108 forks source link

buffers.h文件中的问题 #100

Closed Cai-RS closed 6 months ago

Cai-RS commented 7 months ago

你好,感谢你的工作! 我想问一下,在buffers.h文件中,在host上分配的用于数据传输的内存,是否使用页锁定内存更好呢?即是否应该使用cudaMallocHost()/cudaFreeHost(),而不是分配分页内存的Malloc()/free()? 8ce8b3ccfd9ab59577e52f69c4f4b45

xukuanHIT commented 6 months ago

@yuefanhao

yuefanhao commented 6 months ago

@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.