You and your physician should discuss the burdens and benefits of CPR, and the options that are best for you in your medical condition.
In some situations, CPR will not be life-saving, and will only cause harm. If the physicians caring for you or your loved one believe strongly that this is the case, they will discuss with you why it is not being offered as an option.