fixed some kernel compile errors for running on GPUs
seems to work on a GPU now