Added a check in ptx runtime for bad device pointers