fix little issue and add some code for gpu computing.