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

Claim 0:
1. A method comprising:
receiving source code of a program to be compiled;
compiling the source code of the program, wherein compiling the source code comprises: identifying, by a processing device, a first function in the source code of the program that is a candidate to be executed by a graphics processing unit (GPU);
generating, by the processing device, a first intermediate representation and a second intermediate representation for the first function; and
inserting, by the processing device, 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
providing a compiled program package comprising the second function, the first intermediate representation and the second intermediate representation.