Kernel Optimization #1

~15% speedup for device functions.