Hi,
Still learning here. So I just discovered that host functions are inaccessible to the kernel. I’m going to split my question into two parts:
- First part lets stick to vanilla C only. For the program I am seeking to optimize the basic code (and its related data structures) have been given to me. A somewhat complex custom struct is used which requires a lot of helper functions for data access. Obviously once I move to the device I lose access to these, so for the moment I’ve had to resort to copy all the data I need for the calculation to a straight array and do the processing that way.
On the other hand I wouldn’t (think ?) it would be advisable to stuff a second copy of all your helper functions into the kernel (?!?).
Certainly there must be a better way to handle this scenario-- But I’m not sure what it is ?
- Let’s now pretend we are in C++ land where we have true objects that have methods. If I were to pass an entire object to the kernel, would any associated helper methods be pulled along with it (and thus usable) ? Or are we still in the same situation as above ?