class A
{
B *b;
}
Supose that I have an array of elements of Class A, and I want to send them to a CUDA kernel! Without the pointer inside it would be trivial, because I'll just need to call
cudaMalloc(&arrayA, sizeof(A) * numberof A elements).
In this situation if I just call cudaMalloc, what happens to memory pointed by *b pointer? It remains as a pointer to Host memory? I searched that I could pin memory on the host and access to it from the device, is it viable to pin *b pointed memory and access it from device (Access times)? Or if I should copy the entire b object to device memory and make *b as a reference to device memory?