added "internal" for helper functions to avoid them being exported to PTX