Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $ cat t28.cu
- #include <thrust/device_vector.h>
- int main(){
- thrust::device_vector<int> x;
- x.resize(10);
- }
- $ #CMake commands:
- $ /usr/local/cuda/bin/nvcc t28.cu -dc -o t28.cu.o -ccbin /usr/bin/cc -m64 -Xcompiler ,\"-g\" -std=c++11 -arch=compute_52 -DNVCC -I/usr/local/cuda/include -I/usr/local/cuda/include
- $ /usr/local/cuda/bin/nvcc -m64 -ccbin "/usr/bin/cc" -dlink t28.cu.o -o t28_link.o
- nvlink warning : SM Arch ('sm_20') not found in 't28.cu.o'
- $ /usr/bin/c++ t28.cu.o t28_link.o -o t28 -rdynamic /usr/local/cuda/lib64/libcudart.so -Wl,-rpath,/usr/local/cuda/lib64
- $ ./t28
- terminate called after throwing an instance of 'thrust::system::detail::bad_alloc'
- what(): std::bad_alloc: unknown error
- Aborted (core dumped)
- $ #correct compilation commands:
- $ /usr/local/cuda/bin/nvcc t28.cu -dc -o t28.cu.o -ccbin /usr/bin/cc -m64 -Xcompiler ,\"-g\" -std=c++11 -arch=compute_52 -DNVCC -I/usr/local/cuda/include -I/usr/local/cuda/include
- $ /usr/local/cuda/bin/nvcc -arch=compute_52 -m64 -ccbin "/usr/bin/cc" -dlink t28.cu.o -o t28_link.o
- $ nvcc -arch=compute_52 t28.cu.o t28_link.o -o t28
- $ ./t28
- $
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement