Templated kernel with class as argument fails

I have a weak solution : if i pass my class to a kernel and its data struct as parameter.

The only thing that’s a bit special is that I store my classes in a void* vector and do a static cast before calling them.