Hi, I an new to CUDA, I have problem copy 2-D array from host to device. Here is my code
#define NUMBER 4000
class relatePoint
{
private:
public:
float x[NUMBER/2],y[NUMBER/2];
int index[NUMBER/2];
int count;
relatePoint()
{
for (int i=0;i<NUMBER/2;i++)
{
x[i]=-10;
y[i]=-10;
index[i]=-10;
}
count=0;
}
void append(float x1, float y1, int id)
{
if (count<NUMBER/2)
{
x[count]=x1;
y[count]=y1;
index[count]=id;
this->count++;
}
}
bool isEmpty()
{
for (int i=0;i<NUMBER/2;i++)
if (x[i]!=-10||y[i]!=-10||index[i]!=-10)
return false;
return true;
}
void deleteAt(int id)
{
if (id<NUMBER/2&&id>=0)
{
x[id]=-10;
y[id]=-10;
index[id]=-10;
}
}
void init()
{
for (int i=0;i<NUMBER/2;i++)
{
x[i]=-10;
y[i]=-10;
index[i]=-10;
}
count=0;
}
};
relatePoint relate[30][30];
int main()
{
__device__ relatePoint gpuRelate[30][30];
return 0;
}
How can I copy the data from relate to gpuRelate? Can anybody help me?