Created by: NHZlX
https://github.com/PaddlePaddle/Paddle/pull/21393
This PR supports: Paddle can be compiled on nv jetson hardware for inference, which can make full use of the acceleration performance of Paddle-TRT.
When doing cmake, we should turn off some switches like WITH_MKL, WITH_MKLDNN, WITH_ XBYAK, which can not be used for arm architecture.
Use as follows:
cmake .. \
-DWITH_CONTRIB=OFF \
-DWITH_MKL=OFF \
-DWITH_MKLDNN=OFF \
-DWITH_TESTING=OFF \
-DCMAKE_BUILD_TYPE=Release \
-DON_INFER=ON \
-DWITH_PYTHON=OFF \
-DWITH_XBYAK=OFF \
-DWITH_NV_JETSON=ON \
https://github.com/PaddlePaddle/Paddle/pull/21448
The previous allocator is the best fit version. We use EnableUseGpu (N, 0) interface to specify the size of the memory pool. N represents the size of the pre allocated memory. When the number of temporary tensor allocations exceeds N, cudaMalloc, cudaFree will be called to allocate and release the memory which will slow prediction performance.
So we adopt the auto growth version for inference which will auto adds external storage to memory pool when the number of temporary tensor allocations exceeds N.