Create a context that will be cleaned up properly.
Create a context on the specified device and register its pop() method with atexit.
dev : pycuda.driver.Device
GPU device.
ctx : pycuda.driver.Context
Created context.