A cardiopulmonary bypass machine (sometimes referred to as a heart-lung machine) is a device that temporarily takes over the function of the heart and lungs during open-heart surgery. It pumps oxygenated blood to the body while the heart is stopped and allows surgeons to perform certain types of heart surgery.