Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $ cat t83.cu
- #include <iostream>
- #include <thrust/host_vector.h>
- #include <thrust/system/cuda/experimental/pinned_allocator.h>
- #include <thrust/version.h>
- int main(){
- thrust::host_vector< float , thrust::cuda::experimental::pinned_allocator< float > > h_vector(32);
- int i = 4;
- h_vector[i] = 5.0f;
- float el = h_vector[i];
- std::cout << h_vector[i] << "," << el << std::endl;
- std::cout << "Thrust Version: " << THRUST_VERSION << std::endl;
- return 0;
- }
- $ nvcc -arch=sm_20 -o t83 t83.cu
- $ ./t83
- 5,5
- Thrust Version: 100700
- $ nvcc --version
- nvcc: NVIDIA (R) Cuda compiler driver
- Copyright (c) 2005-2012 NVIDIA Corporation
- Built on Fri_Sep_21_17:28:58_PDT_2012
- Cuda compilation tools, release 5.0, V0.2.1221
- $ uname -a
- 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
- $
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement