US 12,474,903 B1
Systems and methods for automatically generating computer programming code and schedules and comparing their performance
Ivan Garcia Alsina, Framingham, MA (US); Partha Biswas, Wayland, MA (US); and Jianyi Li, Framingham, MA (US)
Assigned to The Math Works, Inc., Natick, MA (US)
Filed by The MathWorks, Inc., Natick, MA (US)
Filed on Nov. 1, 2023, as Appl. No. 18/386,178.
Claims priority of provisional application 63/506,988, filed on Jun. 8, 2023.
Int. Cl. G06F 8/35 (2018.01); G06F 8/30 (2018.01); G06F 8/36 (2018.01); G06F 8/41 (2018.01); G06F 8/51 (2018.01); G06F 8/10 (2018.01); G06F 8/52 (2018.01); G06F 8/75 (2018.01); G06F 9/30 (2018.01); G06F 9/38 (2018.01); G06F 9/455 (2018.01); G06F 9/48 (2006.01)
CPC G06F 8/41 (2013.01) [G06F 8/10 (2013.01); G06F 8/31 (2013.01); G06F 8/315 (2013.01); G06F 8/35 (2013.01); G06F 8/36 (2013.01); G06F 8/42 (2013.01); G06F 8/443 (2013.01); G06F 8/447 (2013.01); G06F 8/451 (2013.01); G06F 8/51 (2013.01); G06F 8/52 (2013.01); G06F 8/75 (2013.01); G06F 9/3005 (2013.01); G06F 9/30174 (2013.01); G06F 9/38873 (2023.08); G06F 9/45558 (2013.01); G06F 9/4881 (2013.01)] 12 Claims
OG exemplary drawing
 
1. A computer-implemented method comprising:
accessing a computer program written in a first programming language, the computer program including tensor-based operations that are implemented as programming idioms or vectorized statements of the first programming language;
receiving information on resources of a target hardware system;
receiving an identification of a scheduler of a second programming language different from the first programming language;
generating, by one or more processors, a first Intermediate Representation (IR) of the computer program;
partitioning the first IR of the computer program into a plurality of partitions wherein the plurality of partitions include the tensor-based operations, the partitioning including searching the first IR for the programming idioms or the vectorized statements;
generating, by the one or more processors, an IR for the plurality of partitions, the Intermediate Representation for the plurality of partitions compatible with the second programming language;
generating, by the scheduler of the second programming language, a schedule for the plurality of partitions, wherein the generating the schedule includes analyzing the IR for the plurality of partitions, further wherein the scheduler considers the information on the resources of the target hardware system;
generating, by the one or more processors, a second IR for the computer program, wherein the second IR for the computer program includes the schedule for the plurality of partitions as generated by the scheduler of the second programming language; and
generating code based on the second IR for the computer program, wherein the code implements the schedule for the plurality of partitions as generated by the scheduler of the second programming language.