Advertisement
Guest User

Untitled

a guest
Sep 24th, 2013
245
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.84 KB | None | 0 0
  1. $ cat t83.cu
  2. #include <iostream>
  3. #include <thrust/host_vector.h>
  4. #include <thrust/system/cuda/experimental/pinned_allocator.h>
  5. #include <thrust/version.h>
  6.  
  7. int main(){
  8.  
  9. thrust::host_vector< float , thrust::cuda::experimental::pinned_allocator< float > > h_vector(32);
  10. int i = 4;
  11. h_vector[i] = 5.0f;
  12. float el = h_vector[i];
  13. std::cout << h_vector[i] << "," << el << std::endl;
  14. std::cout << "Thrust Version: " << THRUST_VERSION << std::endl;
  15. return 0;
  16. }
  17. $ nvcc -arch=sm_20 -o t83 t83.cu
  18. $ ./t83
  19. 5,5
  20. Thrust Version: 100700
  21. $ nvcc --version
  22. nvcc: NVIDIA (R) Cuda compiler driver
  23. Copyright (c) 2005-2012 NVIDIA Corporation
  24. Built on Fri_Sep_21_17:28:58_PDT_2012
  25. Cuda compilation tools, release 5.0, V0.2.1221
  26. $ uname -a
  27. Linux dc12.dc 2.6.32-220.el6.x86_64 #1 SMP Tue Dec 6 19:48:22 GMT 2011 x86_64 x86_64 x86_64 GNU/Linux
  28. $
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement