use structure

I have such structure:

typedef struct
size_t *items;
size_t count;
} Type_t;

Can I do this:

Type_t *d_set;

cudaMalloc((void**)&d_set, sizeof(sizeof(Type_t)));
cudaMalloc((void**)&d_set->items, sizeof(size_t)*1024)));

Type_t d_set;
*)&d_set, sizeof(sizeof(Type_t)));

size_t items;
*)&items, sizeof(size_t)*1024)));

d_set->items = items;

Why the cross post?

Just allocate Type_t on the CPU, cudaMalloc the items member and pass the Type_t in as an argument to the kernel. Or copy it to constant memory. If you REALLY want it in global memory, cudaMalloc a Type_t and copy the temporary structure from the CPU to there. I would advise against the last though, for performance reasons.