    // messaging
    PubMaster pm({"modelV2", "model", "cameraOdometry"});
    SubMaster sm({"pathPlan", "frame"});
  
  #if defined(QCOM) || defined(QCOM2)
    cl_device_type device_type = CL_DEVICE_TYPE_DEFAULT;
  #else
    cl_device_type device_type = CL_DEVICE_TYPE_CPU;
  #endif
  
    // cl init
    cl_device_id device_id = cl_get_device_id(device_type);
    cl_context context = CL_CHECK_ERR(clCreateContext(NULL, 1, &device_id, NULL, NULL, &err));
    cl_command_queue q = CL_CHECK_ERR(clCreateCommandQueue(context, device_id, 0, &err));
  
 
</s> remove   cl_device_id device_id = cl_get_device_id(device_type);
 </s> add   cl_device_id device_id = cl_get_device_id(CL_DEVICE_TYPE_DEFAULT); </s> remove     ref_commit = open("model_replay_ref_commit").read().strip()
 </s> add     ref_commit = open(ref_commit_fn).read().strip() </s> remove     upload_file(log_fn, os.path.basename(log_fn))
 </s> add     try:
      upload_file(log_fn, os.path.basename(log_fn))
    except Exception as e:
      print("failed to upload", e)

    with open(ref_commit_fn, 'w') as f:
      f.write(str(new_commit))
    // messaging
    PubMaster pm({"modelV2", "model", "cameraOdometry"});
    SubMaster sm({"pathPlan", "frame"});
  






    // cl init
    cl_device_id device_id = cl_get_device_id(device_type);
    cl_context context = CL_CHECK_ERR(clCreateContext(NULL, 1, &device_id, NULL, NULL, &err));
    cl_command_queue q = CL_CHECK_ERR(clCreateCommandQueue(context, device_id, 0, &err));
  
keep keep keep keep replace replace replace replace replace replace keep keep keep keep keep
 Added model_replay and fixed some bugs in camera_replay (#2679)

* Added model_replay and fixed some bugs in camera_replay

* Unpack capnp logs on device

* add sync to device

* GPU now also works on PC

* update model ref

* update refs

* dont change this one

* Use pipeline calib instead of rlog calib

* remove that

* update refs

Co-authored-by: Willem Melching <willem.melching@gmail.com>
Co-authored-by: Adeeb Shihadeh <adeebshihadeh@gmail.com> 
selfdrive/modeld/modeld.cc