[gpu] move GetIndexBounds to common
Merge pull request #3802 from Ced2911/gpu_c_fixes

[gpu] move GetIndexBounds to common