I have the following structure.
struct rngen
{
int seed[2];
int seed[2];
int init_seed;
int prime;
int prime_position;
int prime_next;
char *gentype;
int parameter;
int *multiplier;
};
I declare the structure in the host memory as
struct rngen ** new;
This array of structures i need to transfer to the device memory.
Questions are 1) how to allocate memory in the device memory
2) how to copy data from new to devnew(memory allocated in device)
can some body can help me with sample code of allocating and copying the structures into the device memory
you can not copy data from a pointer of pointer (in host memory) to device memory, but you can copy a 2D array (static allocated in host memory) to device memory with normal method.
and you try to copy data from host memory to device memory, the only first row of new[0] is correctly, another rows are not correctly, because when allocated with dynamic method, all the elements are not contiguous.