摘要 |
Embodiments of the present invention disclose a code generating method, a compiler, a scheduling method, an apparatus and a scheduling system. Code generated in the embodiments of the present invention is executable code applied to a heterogeneous system, and the heterogeneous system includes an accelerated processing unit and a central processing unit. The code generating method in the embodiments of the present invention includes: acquiring, by a compiler, resource information of the accelerated processing unit and resource information of the central processing unit so as to generate an operable platform list; identifying, by the compiler, accelerable code from first user code; embedding, by the compiler, a hook function and an exception handling function before the accelerable code to form second user code; and compiling, by the compiler, the second user code to obtain the executable code. The executable code generated in the embodiments of the present invention can automatically implement proper scheduling of processors during execution. |