Hello guys,
I know this question may not be that original, but I’ve been working more than 20 hours on getting a CUDA program to compile with QtCreator under Windows 7, but no use. I eventually got the program called Cuda-Z, which was made with QtCreator, and I tried to compile it, hoping that I could take the qmake script from it, but doesn’t work as well.
Could someone please tell me why Cuda-Z doesn’t compile on Qt?
Please check it at
http://cuda-z.sourceforge.net/
I could compile a program on Visual Studio 2010. But I don’t want to use Visual Studio, since it’s not Cross-platform. The tutorials for VS2010 are pretty straight forward.
I can’t compile any program on command-line. I have a simple program taken from the book “CUDA application design and development”, from which I’m planning to learn CUDA:
//seqCuda.cu
#include <iostream>
using namespace std;
#include <thrust/reduce.h>
#include <thrust/sequence.h>
#include <thrust/host_vector.h>
#include <thrust/device_vector.h>
int main()
{
const int N=50000;
// task 1: create the array
thrust::device_vector<int> a(N);
// task 2: fill the array
thrust::sequence(a.begin(), a.end(), 0);
// task 3: calculate the sum of the array
int sumA= thrust::reduce(a.begin(),a.end(), 0);
// task 4: calculate the sum of 0 .. N-1
int sumCheck=0;
for(int i=0; i < N; i++) sumCheck += i;
// task 5: check the results agree
if(sumA == sumCheck) cout << "Test Succeeded!" << endl;
else { cerr << "Test FAILED!" << endl; return(1);}
return(0);
}
And when I compile it with the command:
nvcc seqCuda.cu -o seqCuda
I get errors that type size_t is redeclared.
I tried using FindCUDA.cmake, but that was a failure as well. I haven’t done that before, and it doesn’t work.
I need someone experienced to share their experience with me. I’m really tired of reading and trying uselessly. I went to every website and tested every code I found with every permutation of every line with every directory I have as absolute directories and even from PATH and it still doesn’t work. For every method there’s an error or a problem.
Thank you for any efforts.