The purpose of a caucus/primary is to select delegates to the convention where a candidate is nominated. Most states require delegates to cast their first round vote for the candidate they were selected to nominate.
Caucus/primary =>delegates => convention => nomination.