Added a function to set up the device for the kernel call, and added a kernel function for comuting the gcd