Refactor CUDA kernel use of tables