1. A computer-readable storage medium containing computer-executable instructions for controlling a computer to generate code for execution based on a SIMT model with parallel units of threads, by a method comprising: determining whether a program includes vector processing; and upon determining that the program includes vector processing, generating instructions for a thread that include an instruction to set a predicate based on whether the thread of a parallel unit corresponds to an element of a vector as indicated by the length of the vector and a thread identifier and instructions to perform the vector processing via scalar operations predicated on the predicate, wherein execution of the generated instructions to perform the vector processing avoids branch divergence within the parallel unit of threads that would result from checking whether a thread corresponds to an element of the vector.