I have a question regarding non-POD type classes being copied from GPU to CPU.
According to the C++ standard, non-POD classes contain any of the following (not fully inclusive list):
My class that I have allocated on the GPU memory DOES include inheritance, and is therefore non-POD.
The question is: Is it not safe to cudaMemCopy this class from GPU to CPU given that it is not POD compliant (or is cudaMemCopy more smart than that?). If so, is there a standard way to handle this situation?
The best I can think of is implementing the copy constructor to copy from “this” to the “other”. Then from the user standpoint, the user must allocated a cpu instantiated class and use the copy constructor of the gpu instantiated class to copy over the members to the cpu class. Then internally, the copy function must deduce the “other”'s memory location and if its on host, it must cudaMemCopy each of its members to the CPU side.