cyrusbehr / tensorrt-cpp-api

TensorRT C++ API Tutorial
MIT License
543 stars 66 forks source link

[feature] Use GpuMat buffer as input to TensorRT instead of copying GPU memory. #43

Closed eshafeeqe closed 6 months ago

eshafeeqe commented 6 months ago

First of all thanks for open sourcing this project. Learned lots of things from this code.

This is not an issue but more like a doubt came to my mind when I looked through your code. I can see you done all the preprocessing steps in the GpuMat and then you copy the memory from GpuMat to device memory input buffer. I am wondering whether we can use the pointer to the GpuMat directly there and remove the memcopy operation ? Is there any reason for you doing this way ?

cyrusbehr commented 6 months ago

Hi. Yes it can be done. It just requires the code to be reworked a bit.