I have a certain function in c++ that uses stl vectors. When I switch to using thrust’s host_vectors, the program runs significantly slower. I’m running it on Ubuntu 14.04 on an NVIDIA Jetson TK1. I’m using NVCC and CMake for the compilition, passing the flags
SET(CUDA_NVCC_FLAGS "-arch=sm_21 --optimize 3" CACHE STRING "nvcc flags" FORCE)
I clocked the time used for the function to execute and the results are as follows:
type | execution time [ms]
--------------------------------------------
std::vector | 101
thrust::host_vector | 220
Is this a common error? Why does it happen and how is it to be fixed?