Patent ID: 11947941
Assignee: RED HAT, INC.
Field: Computer technology (Electrical engineering)
Classification: CPC G | IPC G

Claim 6:
7. A system comprising:
a memory; and
a processing device operatively coupled to the memory, the processing device to:
receive source code of a program to be compiled;
compile the source code of the program, wherein to compile the source code the processing device is to:
identify a first function in the source code of the program that is a candidate to be executed by a graphics processing unit (GPU);
generate a first intermediate representation and a second intermediate representation for the first function; and
insert a second function in the program in place of the first function, wherein the second function comprises an interceptor function to invoke an optimizer function, the optimizer function to select between the first intermediate representation or the second intermediate representation to be executed at runtime in view of available computing resources and a state of one or more computing devices available to execute the first or second intermediate representations, and wherein the interceptor function returns a result of the selected first intermediate representation or the second intermediate representation in place of the first function; and

provide a compiled program package comprising the second function, the first intermediate representation and the second intermediate representation.