Coupled gpu code with matlab to run entire simulation, some small bug still