Alternative to function pointer?
Posted on 2010-11-09
I need to define a function in one file but reference it in another. I am currently doing this by passing a function pointer. However, I can no longer use function pointers for this*, so is there an alternative way of achieving the same thing?
* For those interested in why: I am actually using C for CUDA, and it turns out that the architecture version one needs to compile for in order to use the 'constant memory' on GPUs does not support function pointers within GPU kernels! And since using constant memory is more important for me than using function pointers, I am forced to look for an alternative.