tensorrt-cpp-api
tensorrt-cpp-api copied to clipboard
Modify the project structure and add cross-platform support.
Brief explanation:
- Modify Util namespace to EngineUtil: Reduce the potential for name duplication.
- Move serializeEngineOptions() to EngineUtil namespace
- Modify getDeviceNames() to getGpuDeviceNames() and move it to EngineUtil namespace: Users can easily view their GPUs indexes.
- Change build() to a static function: Users do not need to create an Engine object in order to build the ONNX file.
- Change "m_logger" to static member: To adapt to the 4th point.
- Remove m_calibrator and m_engineName: To adpat to the 4th point.
- Modify loadNetwork(): Users can switch between different TensorRT engine files at any time.
- Modify the constructor: To adapt to the 7th point.
- Modify m_engineOptions to non-const: To adapt to the 7th point.
- 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.
Great thank you for putting this together. I will review in the next few days.
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.
Can we close this PR?
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).