I've got a class with nested classes mixing both C++, CUDA and Thrust. I want to split member definitions across a number of files.
// In cls.h:
#include <thrust/device_vector.h>
class cls {
    class foo {   // define in foo.cu    (include "cls.h")
        kernelWrapper();
    }
    class bar {   // define in bar.cu    (include "cls.h")
        thrust::device_vector A;
        thrustStuff();
    }
    thrust::device_vector B;
    pureCPP();      // define in cls.cpp (include "cls.h")
    moreThrust();   // define in cls.cu  (include "cls.h")
}
In each definition file I simply #include "cls.h". However, I am currently getting an assortment of compiler errors no matter what I try, like pureCPP was referenced but not defined.
I've read Thrust can only be used with
.cufiles. Because my parent classclsdeclares Thrust-type variables likeB(and hence#includesthrust/device_vector.h), does that force all files that#includecls.hto be made into.cufiles?Where do I use
extern "C"in this case? I supposecls.cppwould require all functions in.cufiles to be wrapped inextern "C", but what about.cuto.cucalls, likemoreThrust()callingbar::thrustStuff()I've also been made aware members of classes don't work with
extern "C", so do I have to write anextern "C"wrapper function for each member function?
I'm utterly confused as to how to make this all work - what cocktail of #includes and extern "C"s do I need for each file?