The invention discloses a compiling method for an automatic mixing precision optimization program, which comprises the following steps of: firstly, preprocessing a
source code file of a to-be-optimized program by using a
static error analysis technology based on
chain type automatic differentiation, and then analyzing the precision sensitivity of a
floating point variable in the program by using the
static error analysis technology based on
chain type automatic differentiation; determining a precision-insensitive variable, and storing variable information in a
JSON (
JavaScript Object Notation) file; taking a
source code file of a to-be-optimized program as input, traversing the file by utilizing a variable information search tool, obtaining information of all variables in the program to form a variable configuration file, and forming a configuration file of a
variable precision to-be-searched space according to a precision configuration scheme of the current program; reducing the
variable precision to-be-searched space by using an
error analysis result to form an optimized
variable precision to-be-searched space file; according to the method, the technical problem that an automatic mixing precision optimization technology based on
error analysis cannot ensure that the execution efficiency of an optimized program can be improved can be solved.