Cpp code conversion to cuda

while i m converting my cuda cpp code to cuda,i m having some vector variables in the cpp code .how to transfer it to the cuda…and the header files also contain vector structures ,i m getting error “type is not defined” while using this vector variables

If you have a custom class type let say class A with method let say foo() and attributes fee. You have to do this.

class A {

void foo();

bool fee;

};
  1. Write extern "C" __global__ class A
  2. Before every function write __host__ if you want to use it in host device or __device__if you want to use it on device. You can use both at once too.
  3. Write __global__ before every attributes.
extern "C" __global__ class A {

__host__ __device__ void foo();

__global__ bool fee;

};

What?

__global__ is not a valid decorator for a struct, class, or variable. There is also no reason such a thing needs to be extern "C".