Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <thrust/host_vector.h>
- #include <thrust/device_vector.h>
- #include <cuda.h>
- #include <iostream>
- int main(void)
- {
- size_t free, total;
- cudaMemGetInfo (&free , &total);
- std::cout << "Free Memory : " << free << std::endl ;
- std::cout << "Total amount of memory : " << total <<std::endl;
- //Use Thrust to initialize all ten integers of a device_vector to 1
- thrust::device_vector<int> D(10, 1);
- //Print out the device vector.
- for (int i = 0; i < D.size(); ++i)
- {
- std::cout << D[i] <<std::endl ;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement