Patent ID: 11886846
Assignee: SHANGHAI BIREN TECHNOLOGY CO., LTD
Field: Computer technology (Electrical engineering)
Classification: CPC G | IPC G

Claim 0:
1. A method for executing computation, comprising:
confirming, via a compiler, whether there is a call instruction related to a thread block modification request in a kernel function to be compiled;
in response to confirming that there is the call instruction related to the thread block modification request in the kernel function to be compiled, determining a corresponding program segment associated with the call instruction;
configuring a required thread resource for the corresponding program segment; and
inserting a control instruction into the corresponding program segment to enable the thread resource configured for the corresponding program segment to execute relevant computation of the corresponding program segment, wherein an unconfigured thread resource does not execute the relevant computation,
wherein enabling the thread resource configured for the corresponding program segment to execute the relevant computation of the corresponding program segment comprises:
controlling an executive stream through a control flow code to encapsulate the corresponding program segment, so that when a thread identifier of a current thread is determined to belong to a thread block identifier set configured for the corresponding program segment, the current thread is used to execute the relevant computation of the corresponding program segment; and when the thread identifier of the current thread is determined to not belong to the thread block identifier set configured for the corresponding program segment, the current thread is skipped.