Can we pass C structures with cudaMalloc/cudaMemcpy ?
Here is my code, but I don’t know how to pass this structure to my device :s
typedef struct s
void alloc_struct(struct s **sa, unsigned long int nb)
for(i=0; i<1000; i++)
sa[i] = NULL;
for(i=0; i < nb; i++)
//s_i is a number between 0 and 1000 (the array size)
sa[s_i] = (struct s *) calloc( 1, sizeof(struct s) );
// here some stuff to fill the fresh allocated struct
t = sa[s_i];
strncpy( t->a, "abcd", 4);
struct s *my_struct;
// here "my_struct" is allocated and I can access elements :
// let 0 < i < 1000 :
printf("%s\n", (my_struct[i])->a );
// but now, how can I transfert the whole structure to the device ??
// is it possible ? !