inline referencecalculation.

This cpp file is included in the cuda file. The function should be inlined (failed on my compiler).