Patent ID: 7788468

Claim:
A method of synchronizing a cooperative thread array comprising a plurality of threads concurrently executing a same program on different input data, the method performed in a processor having a plurality of processing engines configured to execute the cooperative thread array in a plurality of single-instruction, multiple-data (SIMD) groups, wherein different threads in a same one of the SIMD groups are assigned to different ones of the processing engines for execution in parallel, and a central instruction unit configured to issue a same instruction for all of the threads of one of the SIMD groups in parallel to each of the plurality of processing engines, the method comprising, in the central instruction unit: selecting a first one of the SIMD groups; selecting a next instruction, the next instruction being an instruction from the shared sequence of program instructions for the first one of the SIMD groups; detecting whether the next instruction is a first barrier instruction associated with a first barrier point or an instruction to be issued to the processing engines; in response to detecting that the next instruction is the first barrier instruction: redirecting the first barrier instruction for further processing within the central processing unit instead of to the processing engines; updating a first indicator to reflect arrival of the first one of the SIMD groups at the first barrier point; and suspending issue from the central instruction unit to the processing engines of subsequent instructions for the threads of the first one of the SIMD groups; determining, based on the first indicator, whether a sufficient number of the SIMD groups of the cooperative thread array have arrived at the first barrier point; and in response to determining that a sufficient number of the SIMD groups of the cooperative thread array have arrived at the first barrier point: resuming issue to the processing engines of subsequent instructions for the threads of the first one of the SIMD groups; and resetting the first indicator.