# thrust::host\_vector clocks in way slower than std::vector

**URL:** <https://forums.developer.nvidia.com/t/thrust-host-vector-clocks-in-way-slower-than-std-vector/39674>\
**Category:** GPU-Accelerated Libraries\
**Created:** [September 27, 2015, 11:35pm UTC](https://forums.developer.nvidia.com/t/thrust-host-vector-clocks-in-way-slower-than-std-vector/39674 "2015-09-27T23:35:35Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![hubabuh](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@hubabuh](https://forums.developer.nvidia.com/u/hubabuh)\
**Post date:** [September 27, 2015, 11:35pm UTC](https://forums.developer.nvidia.com/t/thrust-host-vector-clocks-in-way-slower-than-std-vector/39674/1 "2015-09-27T23:35:35Z")

</div>

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

```auto
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:

```auto
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?
