tensorrt-cpp-api icon indicating copy to clipboard operation
tensorrt-cpp-api copied to clipboard

Modify the project structure and add cross-platform support.

Open xunzixunzi opened this issue 1 year ago • 2 comments

Brief explanation:

  1. Modify Util namespace to EngineUtil: Reduce the potential for name duplication.
  2. Move serializeEngineOptions() to EngineUtil namespace
  3. Modify getDeviceNames() to getGpuDeviceNames() and move it to EngineUtil namespace: Users can easily view their GPUs indexes.
  4. Change build() to a static function: Users do not need to create an Engine object in order to build the ONNX file.
  5. Change "m_logger" to static member: To adapt to the 4th point.
  6. Remove m_calibrator and m_engineName: To adpat to the 4th point.
  7. Modify loadNetwork(): Users can switch between different TensorRT engine files at any time.
  8. Modify the constructor: To adapt to the 7th point.
  9. Modify m_engineOptions to non-const: To adapt to the 7th point.
  10. Add the function 'doesDirectoryExist()': Using 'doesFileExist()' to check if a folder exists is not feasible, so I need to modify it to a method that works universally on both Windows and Linux platforms (Linux platform not tested).

Tested only on the Windows platform; I may need your help to test it on Linux.

xunzixunzi avatar Sep 09 '23 14:09 xunzixunzi

Great thank you for putting this together. I will review in the next few days.

cyrusbehr avatar Sep 11 '23 13:09 cyrusbehr

Thank you for these great updates. I think it would have been helpful if you also updated the readme to provide the guide to set up the project in the Windows platform.

willyfh avatar Dec 02 '23 10:12 willyfh

Can we close this PR?

thomaskleiven avatar May 30 '24 10:05 thomaskleiven

Can we close this PR?

Yes let's close this for now. I however would like to add Windows support at some point. With this particular PR, I never had a chance to test it on Windows, and I didn't like that many of the CMake dependency paths were hard coded, and the build also failed on Linux b/c the author failed to test on that platform (which is the main platform we support).

cyrusbehr avatar May 31 '24 01:05 cyrusbehr