Register configuration techniques using metrics

By analyzing register allocation and transformation in the compilation stage, optimizing instruction sequences, the problem of low data transmission efficiency in the existing technology is solved, and more efficient resource utilization and execution speed is achieved.

CN118939314APending Publication Date: 2024-11-12NVIDIA CORP
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410562683.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Priority Date
2023-05-09
Filing Date
2024-05-08
Publication Date
2024-11-12

AI Technical Summary

Technical Problem

The prior art is difficult to effectively optimize performance costs when modifying instructions for moving data into and out of memory, resulting in inefficient resource utilization of computing platforms.

Method used

The compiler optimizes the instruction sequence by analyzing register allocation and transformation during the compilation stage to reduce register pressure and improve data transmission efficiency. Transformation technologies such as overflow, segmentation, renaming, copy insertion, reconcretization, etc. are used to dynamically adjust register allocation and Assign a strategy.

Benefits of technology

By optimizing register allocation and assignment strategies, register pressure is reduced, program execution speed is improved, and resource utilization efficiency of the computing platform is improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118939314A_ABST
    Figure CN118939314A_ABST
Patent Text Reader

Abstract

The invention discloses register configuration techniques using metrics, and specifically discloses devices, systems, and techniques for allocating and / or assigning registers. In at least one embodiment, registers are allocated based at least in part on a set of estimated performance metrics associated with transformations generated prior to a compiled register allocation stage.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] At least one embodiment is directed to a processing resource for executing one or more programs written for a parallel computing platform.For example, at least one embodiment is directed to a processor or computing system that enables information to be stored in registers during execution of a software program. Background Art

[0002] Modifying instructions for moving data into and out of memory requires consideration of one or more performance costs incurred by those modifications. Modifying instructions for moving data into and out of memory while considering performance costs may result in improvements. BRIEF DESCRIPTION OF THE DRAWINGS

[0003] Figure 1 A process according to at least one embodiment is shown, the process comprising one or more operations performed by a compiler to analyze, at least in part, potential transformations that the compiler may implement with respect to register assignments and allocations;

[0004] Figure 2 A process according to at least one embodiment is shown, the process comprising one or more operations performed by a compiler to analyze potential transformations at least in part before a register allocation stage;

[0005] Figure 3 A process according to at least one embodiment is shown, the process comprising one or more operations performed by a compiler to at least partially record and / or reverse a transformation;

[0006] Figure 4 A process according to at least one embodiment is shown, the process comprising one or more operations performed by a compiler to at least partially analyze potential transformations associated with a register preferencing task;

[0007] Figure 5 A process according to at least one embodiment is shown, the process comprising one or more operations performed by a compiler to at least partially analyze different types of potential transformations to be performed by the compiler to reduce the number of registers required;

[0008] Figure 6 A process according to at least one embodiment is shown, the process comprising one or more operations performed by a compiler to analyze, at least in part, how many register banks to use;

[0009] Figure 7 is a block diagram of a computing system including a compiler according to at least one embodiment;

[0010] Figure 8illustrates an exemplary data center in accordance with at least one embodiment;

[0011] Fig. 9 A processing system according to at least one embodiment is shown;

[0012] Fig.10 A computer system according to at least one embodiment is shown;

[0013] Fig.11 A system according to at least one embodiment is shown;

[0014] Fig.12 An exemplary integrated circuit according to at least one embodiment is shown;

[0015] Fig.13 A computing system according to at least one embodiment is shown;

[0016] Fig.14 An APU is shown according to at least one embodiment;

[0017] Fig.15 A CPU according to at least one embodiment is shown;

[0018] Fig.16 An exemplary accelerator integrated slice is shown in accordance with at least one embodiment;

[0019] Fig.17A and Fig. 17B An exemplary graphics processor is shown in accordance with at least one embodiment;

[0020] Fig.18A illustrates a graphics core according to at least one embodiment;

[0021] Fig.18B A GPGPU is shown according to at least one embodiment;

[0022] Fig.19A illustrates a parallel processor according to at least one embodiment;

[0023] Fig.19B illustrates a processing cluster according to at least one embodiment;

[0024] Fig.19C A graphics multiprocessor is shown in accordance with at least one embodiment;

[0025] Fig. 20 A graphics processor according to at least one embodiment is shown;

[0026] Fig.21 A processor according to at least one embodiment is shown;

[0027] Fig. 22A processor according to at least one embodiment is shown;

[0028] Fig.23 illustrates a graphics processor core according to at least one embodiment;

[0029] Fig.24 illustrates a PPU according to at least one embodiment;

[0030] Fig.25 shows a GPC according to at least one embodiment;

[0031] Fig.26 A streaming multiprocessor is shown according to at least one embodiment;

[0032] Fig. 27 A software stack for a programming platform according to at least one embodiment is shown;

[0033] Fig.28 According to at least one embodiment, Fig. 27 CUDA implementation of the software stack;

[0034] Fig.29 According to at least one embodiment, Fig. 27 ROCm implementation of the software stack;

[0035] Fig.30 According to at least one embodiment, Fig. 27 OpenCL implementation of the software stack;

[0036] Fig.31 illustrates software supported by a programming platform according to at least one embodiment;

[0037] Fig.32 According to at least one embodiment, Figure 27-30 Compiled code executed on the programming platform;

[0038] Fig.33 According to at least one embodiment, Figure 27-30 More detailed compiled code executed on the programming platform;

[0039] Fig.34 Transforming source code prior to compiling the source code according to at least one embodiment is shown;

[0040] Fig.35A A system configured to compile and execute CUDA source code using different types of processing units according to at least one embodiment is shown;

[0041] Fig.35B A method configured to compile and execute using a CPU and a CUDA-enabled GPU according to at least one embodiment is shown. Fig.35A CUDA source code system;

[0042] Fig.35C A method configured to compile and execute using a CPU and a non-CUDA enabled GPU according to at least one embodiment is shown. Fig.35A CUDA source code system;

[0043] Fig.36 According to at least one embodiment, Fig.35C An example kernel transformed by the CUDA to HIP transformation tool;

[0044] Fig.37 In more detail, the Fig.35C A non-CUDA-enabled GPU; and

[0045] Fig.38 shows how threads of an exemplary CUDA grid are mapped to Fig.37 different computing units of

[0046] Fig.39 It shows how to migrate existing CUDA code to data parallel C++ code according to at least one embodiment. DETAILED DESCRIPTION

[0047] In the following description, many specific details are set forth in order to provide a more thorough understanding of at least one embodiment. However, it will be apparent to those skilled in the art that the inventive concept can be practiced without one or more of these specific details, and any two or more embodiments described herein can be combined.

[0048] Figure 1 A process 100 for analyzing one or more software program modifications that may be made by a compiler is shown according to at least one embodiment. In at least one embodiment, the compiler modifies instructions. In at least one embodiment, the compiler modifies a sequence of instructions. In at least one embodiment, a compiler (such as Figure 7 The compiler 714 of the embodiment of the present invention performs one or more operations of process 100 before the compilation stage (such as the register allocation stage), which is further described herein. In at least one embodiment, a register is a type of memory used to receive, hold, and transmit data to be operated by a processor, and is at least in conjunction with the register in the present invention. Fig. 9 In at least one embodiment, one or more operations of any process described herein (including in combination with Figures 1 to 6In at least one embodiment, the modification of a software program is referred to as a transformation or edit, which are further described herein. In at least one embodiment, a compiler performs one or more operations of process 100 based at least in part on one or more embodiments of process 200, process 300, process 400, process 500, process 600, or some combination thereof.

[0049] In at least one embodiment, a compiler performs one or more aspects of process 100 to at least partially analyze transformations that can be applied to software program code, such as intermediate representation (IR) code, wherein the IR code includes one or more data structures used by a compiler or virtual machine to represent source code. In at least one embodiment, a data structure is any data format capable of organizing, processing, retrieving, storing information, or some combination thereof. In at least one embodiment, a data format is a data format such as an array, vector, matrix, tree, hash, table, map, graph, or some combination thereof. In at least one embodiment, when a compiler performs one or more aspects of a process, it is referred to as being automatically executed. In at least one embodiment, software program code is referred to as program code or code. In at least one embodiment, code includes source code, which is code written in a human-readable programming language. In at least one embodiment, a software program is referred to as a computer program, software, or program. In at least one embodiment, a compiler performs one or more aspects of process 100 to at least partially store in memory an estimated performance cost that will be caused by implementing transformations to the IR code. In at least one embodiment, a compiler uses one or more aspects of process 100 to estimate which transformations, if applied, will result in a threshold level of program performance. In at least one embodiment, the compiler uses one or more aspects of process 100 to select which transformations to implement during one or more stages of compilation. In at least one embodiment, the compiler uses one or more aspects of process 100 to at least partially allocate and / or assign registers. In at least one embodiment, the process of allocating registers includes selecting variable values ​​to be stored in registers versus other types of memory. In at least one embodiment, the process of assigning registers includes operations that assign specific variable values ​​to specific virtual and / or physical registers. In at least one embodiment, an operation referred to as a register allocation operation is referred to as an assignment operation; and / or an operation referred to as an assignment operation is referred to as an assignment operation. In at least one embodiment, the compiler performs one or more aspects of process 100 to at least partially allocate and / or assign registers to one or more functions. In at least one embodiment, the compiler performs one or more aspects of process 100 to at least partially help a user set a performance budget for program execution, wherein the performance budget is further described herein.

[0050] In at least one embodiment, the compiler performs one or more aspects of process 100 to allocate and / or assign threads to registers. In at least one embodiment, assigning a thread to a register refers to assigning a register for use by a thread. In at least one embodiment, assigning a thread to a register refers to assigning an identifier such as a thread identifier (thread ID) to be stored in the register. In at least one embodiment, a thread refers to a sequence of instructions within an IR. In at least one embodiment, a thread refers to a path through which control flows through a control flow graph (CFG). In at least one embodiment, a thread is a set of instructions that can be independently managed by an operating system. In at least one embodiment, an instruction causes other instructions to be executed. In at least one embodiment, an instruction may refer to a macroinstruction, which includes a sequence of instructions and / or other macroinstructions provided to a processor for execution. In at least one embodiment, an instruction may refer to a microinstruction, which includes instructions generated by a decoder of a processor decoding a macroinstruction. In at least one embodiment, a decoder of a processor reads an instruction from a memory and transfers and / or sends one or more portions of the instruction to other memories, such as an instruction register.

[0051] In at least one embodiment, a thread is referred to as a software thread. In at least one embodiment, a thread is referred to as program code. In at least one embodiment, a thread is referred to as a program or process. In at least one embodiment, a kernel is a graphics processing unit (GPU) (such as a combination of Fig.17A and Fig. 17B In at least one embodiment, a kernel includes one or more threads. In at least one embodiment, a kernel is referred to as a program or process. In at least one embodiment, a kernel is referred to as a software kernel, a software program, software, or a program. In at least one embodiment, a control flow refers to a sequence of instructions in which a software program is executed, wherein the software program includes one or more sequences of instructions in a programming language that can be executed or interpreted by a computing device, such as device 704, as described herein at least in conjunction with Figure 7 Further described.

[0052] In at least one embodiment, a software program is any collection of ordered operations or instructions for a computing device to perform, such as a thread, a kernel, a warp, or any combination thereof. In at least one embodiment, a computer program is a computer file. In at least one embodiment, a computer program includes any type of code, such as high-level programming code, low-level machine code, or some combination thereof. In at least one embodiment, a computer program is referred to as a program. In at least one embodiment, a code is referred to as a programming language. In at least one embodiment, the code is written in a programming language. In at least one embodiment, the code includes instructions executed or implemented by a computing device.

[0053] In at least one embodiment, transformation refers to any modification of the instructions of a program. In at least one embodiment, transformation is referred to as editing. In at least one embodiment, transformation is the modification and / or translation of program code into low-level code by a compiler. In at least one embodiment, transformation includes any technique for allocating and / or assigning registers. In at least one embodiment, transformation includes any register allocation technique, such as instruction reordering, spilling, refilling, cancellation, or some combination thereof, as further described herein. In at least one embodiment, spilling includes moving information stored in registers to a slower memory such as a cache, wherein caches and registers are at least combined herein. Fig. 9 Further description. In at least one embodiment, refilling includes moving information stored in the cache to registers. In at least one embodiment, canceling includes canceling the use of registers. In at least one embodiment, canceling the use of registers occurs after the last use of a particular value. In at least one embodiment, the register allocation task includes register scheduling and / or register assignment tasks. In at least one embodiment, transformation is a form of code movement, in which a portion of the code within a program is moved to a different location in the program in order to affect the performance of the program, such as improving the execution speed of the program, maximizing the number of threads that can be handled by registers, some combination thereof, or in other ways. In at least one embodiment, transformation involves loop unrolling, the purpose of which is to improve the performance of code that repeats until a condition is satisfied, for example, by duplicating each iteration of the loop in hardware and executing them simultaneously. In at least one embodiment, transformation is one or more instructions for implementing one or more register allocation and / or assignment techniques. In at least one embodiment, register allocation and / or assignment includes selecting what data values ​​will be stored in registers at each point in the program. In at least one embodiment, points in a program are referred to as program points. In at least one embodiment, register allocation and / or assignment includes the compiler selecting which variable values ​​will be stored in registers at each program point. In at least one embodiment, the compiler organizes multiple transformations into a set of transformations. In at least one embodiment, a set of transformations is referred to as an edit set. In at least one embodiment, a set of transformations includes transformations to be implemented in some order, concurrently, or some combination thereof.

[0054] In at least one embodiment, process 100 begins with a compiler that reads or processes program code to analyze the code using operation 102. In at least one embodiment, reading the program includes lexical analysis, parsing, semantic analysis, or some combination thereof. In at least one embodiment, when the compiler reads the program, the compiler stores different parameters indicating characteristics of the kernel's code in a memory, including function locations, values ​​used, live ranges of values, the number of values ​​used, or some combination thereof. In at least one embodiment, a value is referred to as a variable. In at least one embodiment, a value is data represented by a variable. In at least one embodiment, a live range refers to one or more points within a program, also referred to as program points, at which a variable is active, which is further described in detail below at least in conjunction with operation 104. In at least one embodiment, the process for storing information in a memory is referred to as recording information. In at least one embodiment, the compiler performs a read of the program before a register allocation phase of compilation. In at least one embodiment, the compiler performs a read of the program before an optimization phase of compilation. In at least one embodiment, the optimization phase of compilation includes a register allocation phase. In at least one embodiment, the compiler performs a read of an intermediate representation (IR) of the program code.

[0055] In at least one embodiment, the compiler continues process 100 by identifying the live scope of the variable based at least in part on the compiler's analysis of the program code using operation 102 using operation 104. In at least one embodiment, the scope of the live variable begins at the program point where the variable is defined and ends at the program point where the variable will stop being used during the execution of the program. In at least one embodiment, the live scope of the variable is referred to as the live scope. In at least one embodiment, the point within the program is referred to as the position. In at least one embodiment, the variable is active at the point after the value is defined. In at least one embodiment, the variable is active at the point after the value of the variable is placed in the register. In at least one embodiment, if the value of the variable can be read later before it is written again, the variable is active at the program point. In at least one embodiment, if the program is needed to be used for tasks such as reading and / or writing to memory from memory, the variable is active at the program point. In at least one embodiment, if the variable holds a value that may be needed in the future, and / or if the value of the variable can be read before the next write to the variable, the variable is active at the program point. In at least one embodiment, the active scope of a variable refers to a set of instructions (not necessarily continuous) spanning from the program point where the variable is defined to the program point where the variable will no longer be used by the program. In at least one embodiment, a fragment of an active scope is referred to as an active scope fragment. In at least one embodiment, an active scope refers to an active scope fragment.

[0056] In at least one embodiment, the compiler continues process 100 by identifying potential transformations using operation 106, which can be applied to the active scope of the variable identified using operation 104. In at least one embodiment, a potential transformation is a transformation that can be legally applied to a part of the software. In at least one embodiment, if the compiler can implement the transformation without causing the software program to fail unintentionally when executed, the transformation can be legally applied. In at least one embodiment, the compiler identifies two or more types of transformations that can be combined for one or more active scopes. In at least one embodiment, the compiler identifies various combinations of transformations that can be applied to active scopes. In at least one embodiment, a combination of transformations of different types is referred to as a set of heterogeneous transformations. In at least one embodiment, a set of transformations of one type is referred to as a set of homogeneous transformations. In at least one embodiment, examples of transformation types include transformations that result in the execution of different allocation and / or assignment techniques, such as overflow, splitting, renaming, copy insertion, merging, re-materialization, or reordering, which are further described herein. In at least one embodiment, the compiler records the combination of transformations that can be applied to the active scope as a set of those transformations. In at least one embodiment, the compiler records multiple sets of combined transformations.

[0057] In at least one embodiment, the compiler continues process 100 by calculating performance metrics for one or more potential transformations identified using operation 106 using operation 108. In at least one embodiment, when the compiler generates a calculated performance metric, or otherwise generates any value, modification, instruction, comparison of values, comparison of instructions, identification of instructions, identification of instruction sets, identification of modifications, identification of software parts, or some combination thereof, the generation is referred to as calculation. In at least one embodiment, the calculated performance metric is referred to as a performance metric or performance cost. In at least one embodiment, a performance metric is a value associated with a factor indicating program performance (such as running time, power consumption, memory requirements, or some combination thereof). In at least one embodiment, a performance metric refers to a type of value used to estimate the performance of a transformation to be implemented in a program. In at least one embodiment, a calculated performance metric refers to an estimated performance metric. In at least one embodiment, a measured performance metric refers to an estimated performance metric calculated by the compiler and used in part to select which transformations to apply. In at least one embodiment, as opposed to implementing modifications to the code, the compiler uses one or more heuristics to calculate the estimated performance metric, executing the code while measuring the performance effects of those modifications. In at least one embodiment, heuristics are methods for solving problems that do not guarantee to find the best or exact solution, but are designed to find a satisfactory solution within a reasonable amount of time. In at least one embodiment, heuristics are used to calculate estimated performance metrics. In at least one embodiment, the measured performance metrics refer to the performance metrics observed by the compiler during program execution via devices such as load sensors, temperature sensors, power monitors, or some combination thereof. In at least one embodiment, the measured performance metrics refer to metrics based on observed and / or estimated results. In at least one embodiment, the results are referred to as data. In at least one embodiment, the compiler estimates the performance metrics of those potential transformations before the potential transformations are implemented by the compiler. In at least one embodiment, potential transformations refer to transformations that can be applied to a program but have not yet been implemented. In at least one embodiment, the compiler calculates performance metrics relative to any computational constraints, such as computational time, required number of instructions, use of computational resources, financial budgets, temperature budgets, power budgets, or some combination thereof.

[0058] In at least one embodiment, the performance metric includes a value associated with a compiler performance characteristic such as throughput, code quality, or some combination thereof. In at least one embodiment, the performance metric is a characteristic and / or value indicating the throughput of the compiler, which refers to the number of software instructions that the compiler can process in a given time period. In at least one embodiment, the compiler processes software instructions by modifying those instructions. In at least one embodiment, the performance metric is a characteristic and / or value indicating the quality of the code, wherein the quality of the code includes factors such as the number of repeated instructions, the number of executable conditional instruction loops, the percentage of code running during software performance testing, code size, the number of control flow paths, or some combination thereof. In at least one embodiment, code size refers to the average number of instructions per function, which is a part of the code that performs one or more tasks when executed.

[0059] In at least one embodiment, the compiler selects the transformation to be implemented based on a threshold performance metric value that is not exceeded during program execution. In at least one embodiment, the compiler selects the transformation to be implemented based on comparing performance metrics associated with different transformations. In at least one embodiment, the compiler performs the comparison by measuring the difference between two or more performance metrics of two or more transformations (such as potential transformations and already implemented transformations). In at least one embodiment, the compiler selects the transformation to be implemented by performing a cost-benefit analysis. In at least one embodiment, the compiler compares the estimated performance metrics of different combinations of transformations. In at least one embodiment, the compiler uses a cost estimation heuristic to calculate the cost of one or more potential transformations. In at least one embodiment, the cost estimate or cost estimate is referred to as a calculation performance metric. In at least one embodiment, a heuristic is a method for solving problems that do not guarantee to find an optimal solution, but are designed to find a satisfactory solution within a reasonable amount of time. In at least one embodiment, the estimated cost of applying a potential transformation (such as an overflow instruction) is based at least in part on a weighted sum of the number of times a variable is used, where each use is weighted in proportion to its occurrence at a particular loop nesting depth. In at least one embodiment, the estimated cost of applying potential transformations is based at least in part on definitions, writes to memory, reads from memory, copies between registers, the number of re-concrete computations, or some combination thereof. In at least one embodiment, the loop nesting depth is a value indicating the extent to which a variable in a loop is contained in one or more other loops. In at least one embodiment, the compiler records the costs of different combinations of transformations in a set. In at least one embodiment, the compiler calculates and records a set of transformations and corresponding performance metrics for a portion of a program (such as an active scope or active fragment of a variable). In at least one embodiment, a set of transformations and / or corresponding performance metrics is referred to as an edit set.

[0060] In at least one embodiment, the compiler continues process 100 by applying one or more transformations using operation 110 based at least in part on the performance metric calculated using operation 108. In at least one embodiment, the compiler selects to apply the transformation based at least in part on the lowest estimated cost in a set of potential transformations. In at least one embodiment, the compiler selects to apply a combination of transformations based at least in part on the lowest estimated cost in a set of potential combined transformations. In at least one embodiment, a combination of transformations refers to a plurality of transformations that each cause different register allocations and / or assignment techniques to be performed, such as a combination of split and rename transformations. In at least one embodiment, the compiler selects an edit set during the optimization phase of compilation and applies its transformations to program code. In at least one embodiment, the compiler applies the transformation by inserting, removing, and / or otherwise modifying program instructions to cause the expected effect of the transformation, such as assigning the value of a variable to a specific register.

[0061] Figure 2 A process 200 is shown for a compiler to estimate and reduce register pressure for multiple portions of a program before executing a register allocation phase of the compiler in accordance with at least one embodiment. In at least one embodiment, one or more operations of process 200 cause storage to be allocated and / or assigned to a software program based on future modifications to the software program. In at least one embodiment, the modification to the software includes a modification to one or more software instructions, such as the insertion of an instruction, the removal of an instruction, the movement of an instruction, or any other editing of an instruction.

[0062] In at least one embodiment, the compiler performs one or more aspects of process 200 to reduce register pressure earlier in the compilation process than in the absence of process 200, at least in part. In at least one embodiment, the compiler performs one or more aspects of process 200 to use at least in part any combination of register pressure reduction techniques. In at least one embodiment, the compiler performs one or more aspects of process 200 to select from a plurality of register pressure reduction transformation options for an active scope using a cost estimate. In at least one embodiment, the compiler performs one or more aspects of process 200 to adjust the target register pressure threshold based at least in part on a prediction and / or expectation that a register pressure reduction phase occurring after a future transformation will be able to reduce a certain amount of pressure at a low cost, wherein the cost may be referred to as a performance penalty. In at least one embodiment, future modification refers to a compiler that modifies the software at a later time during the compilation process, such as during a later stage of compilation. In at least one embodiment, future modification refers to a modification of one or more instructions of the software during a compilation phase, such as an optimization phase, which follows a compilation phase in which the compiler is currently performing operations, such as an intermediate representation (IR) code generation phase. In at least one embodiment, future modification refers to the modification performed during any compilation phase after the stage currently being operated by the compiler, wherein the future modification is automatically performed by the compiler. In at least one embodiment, future modification refers to the modification performed during any compilation phase after the stage currently being operated by the compiler, wherein the current stage and subsequent stage will be performed during a single pass (single pass). In at least one embodiment, the single pass execution of the compiler refers to each stage of compiler execution compilation once. In at least one embodiment, future modification refers to the modification performed during any compilation phase after the stage currently being operated by the compiler, wherein the current stage and subsequent stage will be performed between multiple passes. In at least one embodiment, the compilation phase is referred to as the phase of lexical analysis, syntactic analysis, parsing, semantic analysis, intermediate code generation, code optimization, pre-register allocation, register allocation, code generation or its certain combination.

[0063] In at least one embodiment, causing storage to be allocated and / or assigned to one or more software programs refers to the processor causing the compiler to perform operations such as inserting, removing, moving, or otherwise editing software instructions to assign variables to registers and manage data transfers to and from registers. Figure 1 Register allocation, as further described, refers to the compiler determining which variable values ​​will be stored in registers rather than in slower memory. Figure 1Register assignment, as further described, refers to the compiler determining which specific variable values ​​are to be stored in which specific register. In at least one embodiment, register allocation is referred to as register assignment, and vice versa. In at least one embodiment, register allocation and / or assignment includes modifications or operations applied to software instructions, such as spilling, splitting, renaming, copy insertion, re-materialization, merging, reordering, or some combination thereof, and as described herein at least in conjunction with Figure 4 Further described.

[0064] In at least one embodiment, a processor (e.g., at least in conjunction with Fig.15 The central processing unit (CPU) 1500 described above causes a compiler to perform register allocation and / or assignment operations. In at least one embodiment, the processor causes a compiler to perform operations by executing a compiler, which is a program that translates code written in one programming language into another programming language and optimizes the code by modifying the code, where such optimization can be measured by a performance metric, which may be described in at least one embodiment in conjunction with Figure 1 In at least one embodiment, the processor causes the compiler to perform operations by reading and / or executing a compiler program stored on a non-volatile computer-readable storage medium, in at least one embodiment of the present invention. Figure 7 In at least one embodiment, a system (such as described herein at least in conjunction with Fig.10 The computer system 1000 described further) causes the compiler to perform register allocation and / or assignment operations. In at least one embodiment, the system causes the compiler to perform operations by reading, extracting or otherwise obtaining instructions from a compiler program stored in a memory and executing the instructions using hardware such as a CPU.

[0065] In at least one embodiment, storage refers to any type of virtual or physical memory, such as registers, and allocating memory to a software program includes allocating memory to one or more variables of the software program. In at least one embodiment, register pressure is the number of values ​​at a program point that requires registers. In at least one embodiment, register pressure is referred to as excess if the number of values ​​exceeds a certain number of registers available. In at least one embodiment, register pressure indicates the number of available registers relative to the number of values ​​of active variables to be stored in memory. In at least one embodiment, register pressure increases as the number of available registers decreases relative to the number of values ​​to be stored; register pressure decreases as the number of available registers increases relative to the number of values ​​to be stored.

[0066] In at least one embodiment, in combination Figure 2 One or more aspects of one or more embodiments described herein are at least in combination with those described herein. Figure 1 and Figures 3 to 7 In at least one embodiment, a compiler (such as a combination of Figure 7 The compiler 714 described herein performs one or more operations of process 200 based at least in part on one or more embodiments of process 100, process 300, process 400, process 500, process 600, or some combination thereof. In at least one embodiment, the compiler utilizes operation 201 to identify the active scope of a variable, which is described herein at least in conjunction with Figure 1 104 is further described. In at least one embodiment, the compiler performs process 200 during a compilation phase (such as an IR code generation phase) to better select the transformation to be applied relative to other transformations that may be applied during a subsequent phase of compilation (such as a register allocation phase). In at least one embodiment, the compiler calculates which active scopes may accept the transformation based at least in part on calculating which transformations will impose a performance cost below a threshold. In at least one embodiment, the threshold refers to a performance-related value that the compiled program must equal or exceed to meet a performance standard, such as the average number of instructions per function set by a user. In at least one embodiment, the threshold refers to a performance-related value that the compiled program must equal or be less than to meet a performance standard (such as a runtime limit set by a user). In at least one embodiment, the compiled program is a program that has been at least partially translated, modified, or otherwise processed by the compiler. In at least one embodiment, the compiler calculates which active scopes may accept the transformation based at least in part on a probability value that exceeds a threshold probability value. In at least one embodiment, the register allocation phase is included in the code optimization phase.

[0067] In at least one embodiment, the compiler analyzes the code to estimate and / or reduce register pressure in multiple parts of the program before the register allocation stage. In at least one embodiment, the compiler selects which transformations to be implemented to reduce register pressure before the register allocation stage based at least in part on the register pressure reduction transformations predicted to be implemented during the register allocation stage using operation 202. In at least one embodiment, the compiler implements the selected transformations before and / or during the register allocation stage. In at least one embodiment, selecting register pressure reduction transformations based on the predicted transformations better optimizes the performance of the program by partially reducing the possibility that the compiler will select redundant and / or unnecessary transformations, wherein unnecessary transformations may slow down the performance of the program. In at least one embodiment, reducing unnecessary transformations reduces unnecessary code, which, if implemented, will impose a performance cost that exceeds the benefit of reducing the number of registers required during program execution.

[0068] In at least one embodiment, using operation 202 to predict transformations that may be implemented during the register allocation phase is referred to as predictive analysis. In at least one embodiment, determining which transformations to apply before the register allocation phase is referred to as pre-register allocation pressure reduction, where pressure reduction refers to register pressure reduction. In at least one embodiment, preventing unnecessary transformations to a program prevents slowing down the overall performance of the program. In at least one embodiment, the compiler selects the transformations to be applied based on a performance metric value, such as a cost value, as a threshold that the program will not exceed. In at least one embodiment, the compiler selects the transformations to be applied based on a minimum threshold that the program remains above.

[0069] In at least one embodiment, the compiler performs operation 202 by identifying or marking which active scopes identified by operation 201 may accept transformations during the register allocation phase of compilation. In at least one embodiment, the compiler performs operation 202 based at least in part on the likelihood that it will implement the transformation during a future compilation phase. In at least one embodiment, the likelihood is represented by a probability value. In at least one embodiment, operation 202 includes identifying which transformations can be applied to one or more parts of the program. In at least one embodiment, the applicable transformations are referred to as legal transformations. In at least one embodiment, the compiler predicts which active scopes may accept register pressure reduction transformations based at least in part on calculating which transformations will impose a performance cost below a threshold. In at least one embodiment, the compiler predicts which transformations will be applied during the register allocation phase based on the transformations assumed to be applied before the register allocation phase. In at least one embodiment, a transformation estimated to impose a performance cost below a threshold is referred to as a low-cost transformation. In at least one embodiment, a transformation is low-cost if it falls within a cost range and / or a percentage of a threshold cost. In at least one embodiment, operation 202 includes predicting which transformations (if applied to the active scope) are estimated to result in a performance cost above and / or below a threshold performance cost value.

[0070] In at least one embodiment, the compiler identifies low-cost legal transformations that can be applied to the active scope during the pre-stage analysis, wherein the pre-stage analysis refers to the analysis of the compiler performed before the register allocation stage. In at least one embodiment, the low-cost transformation is any transformation of the register allocation or assignment technology that applies a performance cost that results in a threshold value set by the user. In at least one embodiment, identifying which low-cost transformations can be applied to the active scope is called predictive analysis because the compiler is at least conceptually predicting what transformations the compiler can apply during the register allocation stage. In at least one embodiment, predictive analysis allows the compiler to analyze which transformations are implemented before the register allocation stage by considering the transformations that can be performed during the register allocation stage.

[0071] In at least one embodiment, the low-cost transformation applies a register pressure reduction technique. In at least one embodiment, increased register pressure indicates an increase in register shortage relative to the number of variable values ​​that need to be stored in memory. In at least one embodiment, the register pressure reduction technique reduces the need of a program for registers to store its variables. In at least one embodiment, an active range that includes more active variables than available registers is referred to as an excess region. In at least one embodiment, an active variable is a variable in program code that can use the value of the variable during execution of the program but before the value of the variable is redefined. In at least one embodiment, active variables and / or active ranges are identified by analyzing the code of the program before executing the program. In at least one embodiment, a demand refers to an active range to which a register pressure reduction transformation needs to be applied. In at least one embodiment, the compiler identifies the active range as a demand during activity analysis, which is an analysis of points where variables are active.

[0072] In at least one embodiment, the compiler continues process 200 by calculating a performance cost using operation 204 based at least in part on the prediction of the low-cost transformation generated using operation 202. In at least one embodiment, the compiler calculates the performance cost of implementing a pre-phase transformation in conjunction with the low-cost transformation predicted to be implemented during the register allocation stage. In at least one embodiment, the compiler stores the performance costs of the plurality of pre-phase transformations combined with the predicted low-cost transformations.

[0073] In at least one embodiment, the compiler continues process 200 by comparing the performance cost calculated using operation 204 to a performance cost budget using operation 206. In at least one embodiment, a user or program sets a performance cost budget for the transformations that the compiler will apply. In at least one embodiment, a user or program sets a register requirement level that the compiler should meet for the transformations it applies. In at least one embodiment, the performance cost budget includes thresholds associated with different metrics and / or constraints, such as the number of overflow instructions allowed, the runtime of the program, the number of allowed transformations, or a combination thereof.

[0074] In at least one embodiment, the compiler continues process 200 by applying the transformation selected using operation 208 based at least in part on the performance cost comparison performed using operation 206. In at least one embodiment, the compiler selects the transformation based at least in part on a set of performance costs associated with different combinations of pre-stage transformations and register allocation stage transformations. In at least one embodiment, the compiler selects the transformation based on the lowest associated performance cost in a set of performance costs. In at least one embodiment, the compiler applies the transformation described at least using operation 110 during the pre-register allocation stage. In at least one embodiment, the pre-register allocation stage is referred to as a pre-register allocation (pre-RA) reducer pass. In at least one embodiment, the compiler applies the transformation before and / or during the register allocation stage. In at least one embodiment, the compiler performs one or more embodiments of operations 201, 202, 204, 206, 208 or some combination thereof as part of a pre-RA reducer pass. In at least one embodiment, the compiler uses the pre-RA reducer pass to calculate where one or more transformations can be applied to reduce register pressure. In at least one embodiment, the compiler only performs register pressure reduction that meets the specifications of the user specification, wherein the user specification includes restrictions such as the desired demand level and / or cost budget. In at least one embodiment, the user is referred to as a client. In at least one embodiment, process 200 is performed during multiple stages of compilation, where the user sets different performance metrics and cost budgets for each stage of compilation.

[0075] Figure 3 A process 300 for recording register allocation operations performed by a compiler is shown in accordance with at least one embodiment. In at least one embodiment, the compiler performs process 300 to modify software to be compiled based in part on an estimated performance metric of the software, wherein recording the modifications to the software allows the compiler to reverse the modifications if the estimated performance metric corresponding to the modifications is calculated to be undesirable by a user, the software, or other software. In at least one embodiment, in conjunction with Figure 3 One or more aspects of one or more embodiments described herein are at least in combination with those described herein. Figure 1-24-7. In at least one embodiment, a compiler such as compiler 714 performs one or more operations of process 300 based at least in part on one or more embodiments of process 100, process 200, process 400, process 500, process 600, or some combination thereof. In at least one embodiment, the compiler performs one or more aspects of process 300 to at least partially allow the compiler to revert to a previous version of the compiler's intermediate representation (IR) without having to re-implement one or more modifications required to generate the previous version. In at least one embodiment, process 300 allows the compiler to revert to a previous version of the compiler's IR by reading previously calculated and stored values ​​instead of recalculating those values. In at least one embodiment, the compiler performs one or more operations of process 300 to at least partially reverse a transformation that has been applied. In at least one embodiment, the compiler performs one or more operations of process 300 to at least partially reverse a previously applied transformation to restore the IR to an earlier point in the register allocation process. In at least one embodiment, process 300 begins with the compiler calculating whether the transformation can be applied together with operation 302 as part of the process of generating the IR. In at least one embodiment, if the compiler determines that the transformation can be applied, process 300 continues to operation 304. In at least one embodiment, if the transformation can be applied, the transformation is referred to as a legal transformation. In at least one embodiment, if the compiler determines that the new transformation cannot be applied, process 300 ends.

[0076] In at least one embodiment, one or more aspects of compiler execution process 300 unmodify software during compilation based at least in part on one or more estimated performance metrics of software, which is further described herein. In at least one embodiment, during compilation refers to any part or phase of the compilation process performed by the compiler or any combination of parts or phases. In at least one embodiment, unmodifying software is called undoing transformation. In at least one embodiment, one or more aspects of compiler execution process 300 perform register assignment and register pressure reduction operations using backtracking search of previous transformations applied to software. In at least one embodiment, one or more aspects of compiler execution process 300 record the sequence of edits applied and their performance, which is further described herein. In at least one embodiment, one or more aspects of compiler execution process 300 replay the edit sequence of application, and continue to search downward for the applied branch edit sequence if it is determined to be better than the alternative edit sequence considered.

[0077] In at least one embodiment, the compiler applies a set of transformations to generate a new version of the IR using operation 304, wherein at least Figure 1 A set of transformations are further described. In at least one embodiment, the compiler applies a set of transformations using operation 304 after moving to another program point in the IR. In at least one embodiment, the compiler applies one or more types of transformations as described herein in conjunction with Figure 1 In at least one embodiment, the set of transformations is a heterogeneous set of transformations. In at least one embodiment, the set of transformations is a homogeneous set of transformations. In at least one embodiment, when the compiler applies the set of transformations using operation 304, the compiler calculates one or more costs resulting from applying the set of transformations, wherein calculating the costs is described herein at least in conjunction with Figure 1 Operation 108 is further described.

[0078] In at least one embodiment, process 300 continues to the compiler recording information about the transformations during operation 306 after applying a set of transformations using operation 304. In at least one embodiment, the compiler stores information needed to reverse the transformations in a memory. In at least one embodiment, for example, if the transformation moves a portion of the code from one location to another, the compiler records information about the current location and the previous location of the code. In at least one embodiment, the compiler records information about the transformation or set of transformations in a data structure other than another data structure that stores information about the IR code.

[0079] In at least one embodiment, the compiler utilizes operation 308 to calculate whether to keep a set of transformations. In at least one embodiment, the compiler calculates whether to retain a set of transformations applied using operation 304. In at least one embodiment, the compiler calculates whether to keep a set of transformations based at least in part on the cost of those transformations. In at least one embodiment, the compiler calculates whether to keep a set of transformations based at least in part on a cost budget. In at least one embodiment, if the compiler keeps a set of transformations, the compiler will return to operation 302 of process 300 and record information about the IR and the set of transformations. In at least one embodiment, the compiler includes a measurement function that tracks the cost generated by applying these sets of transformations when applying one or more sets of transformations. In at least one embodiment, the compiler records a series of transformations and their performance metrics. In at least one embodiment, the compiler records the order in which a series of transformations are executed. In at least one embodiment, the compiler applies multiple sets of transformations for a single active scope.

[0080] In at least one embodiment, if the compiler does not maintain a set of transformations, the compiler reverses one or more sets of transformations that have been applied to the IR to return to a previous point in the IR. In at least one embodiment, a previous point in the IR refers to a program point within the instruction stream of the IR. In at least one embodiment, a previous point in the IR refers to an earlier version of the IR. In at least one embodiment, reversing one or more transformations or sets of transformations is referred to as reverting to a previous version of the code, or is referred to as undoing those transformations. In at least one embodiment, undoing a transformation is referred to as unmodifying software. In at least one embodiment, undoing a transformation is referred to as reverting to a previous version of the software. In at least one embodiment, reverting to a previous version of the software is referred to as unmodifying software. In at least one embodiment, if the compiler does not maintain a set of transformations, the compiler utilizes operation 310 to revert to a previous version of the compiler's IR. In at least one embodiment, the compiler reverts to a previous version of the compiler's IR by reading previously calculated and stored values ​​instead of recalculating those values. In at least one embodiment, the compiler calculates whether to unmodify software based at least in part on an evaluation of replacing one or more modifications with one or more other modifications. In at least one embodiment, the evaluation of replacing one or more modifications with one or more other modifications is based at least in part on information indicating the effect of those modifications on computing performance. In at least one embodiment, the information indicating the effect of the modifications is referred to as a performance metric of the software. In at least one embodiment, the compiler reverts to a previous version of the compiler's IR by reading previously calculated and stored values ​​rather than recalculating a register interference map, wherein the register interference map indicates at least in part which variables can share registers at which points within the program. In at least one embodiment, the compiler reverts to a previous version of the compiler's IR by reading previously stored information indicating previous transformations made to the IR. In at least one embodiment, the register interference map indicates at least in part which variables cannot share registers at which points within the program. In at least one embodiment, the compiler reverts to a previous version of the compiler's IR that is not immediately prior to the application of a set of transformations; for example, the compiler reverts to a version of the IR that existed prior to one or more intermediate versions. In at least one embodiment, the compiler reverts to a previous version of the compiler's IR by at least conceptually removing one or more applications of a set of transformations. In at least one embodiment, the compiler reverses the application of a set of transformations back to a previous point in the IR. In at least one embodiment, after the compiler resumes to a previous point in the IR via operation 310, the compiler performs operation 302 to determine whether any new transformations can be applied.

[0081] Figure 4A process 400 for a compiler to assign a value to a specific register according to at least one embodiment is shown. Figure 4 One or more aspects of one or more embodiments described herein are at least in combination with those described herein. Figures 1 to 3 and Figures 5 to 7 One or more aspects of one or more embodiments described herein are combined. In at least one embodiment, the compiler performs process 400 to replace the storage location assigned to the data value with the replacement storage location based on the estimated performance metric of one or more replacement storage locations. In at least one embodiment, the storage location refers to a memory address, a physical memory, or a combination thereof. In at least one embodiment, the storage location includes a register address, a physical register, a virtual register, a group of registers, or some combination thereof. In at least one embodiment, the replacement storage location is a storage location assigned and / or allocated to store the variable value instead of another storage location previously assigned to store the value. In at least one embodiment, the compiler replaces the storage location with the replacement storage location by estimating how well those replacement storage locations will perform if implemented and / or during program execution, based on the estimated performance metric of the replacement storage location. In at least one embodiment, the compiler replaces the storage location with the replacement storage location by estimating and / or observing how well those storage locations will perform and / or how well they will perform if implemented and / or during program execution, based on the performance metric of the estimated storage location.

[0082] In at least one embodiment, a compiler performs one or more aspects of process 400 to assign a storage location (such as a register) to a variable corresponding to a first portion of a computer program, independently of assigning another storage location to a variable corresponding to a second portion of the computer program. In at least one embodiment, a portion of a computer program refers to a fragment of an active scope. In at least one embodiment, a portion of a computer program refers to an active scope. In at least one embodiment, the compiler assigns a storage location to a variable corresponding to the first portion of the computer program independently of assigning a storage location to a variable corresponding to the second portion, refers to another assignment that assigns a register to a different fragment of the active scope of the variable, assigning a register to a fragment of the active scope of that variable. In at least one embodiment, the compiler assigns a storage location to a variable corresponding to the first portion of the computer program independently of assigning a storage location to a variable corresponding to the second portion, refers to another assignment that assigns a register to an active scope of a variable independently of assigning a register to a different active scope of the variable. In at least one embodiment, the compiler does not perform independent assignments of registers to variables corresponding to different portions of the computer program, but rather uses, at least in part, a computational performance metric to perform such assignments.

[0083] In at least one embodiment, the compiler performs one or more aspects of process 400 to select from a plurality of register assignment options based on the estimated performance effects of a plurality of transformations that affect register assignment. In at least one embodiment, the compiler performs one or more aspects of process 400 to pre-plan assignments of a plurality of webs simultaneously, which may, for example, refer to assigning a plurality of webs without repeating a particular compilation phase. In at least one embodiment, the compiler performs one or more aspects of process 400 to assign registers to only a portion of one or more webs. In at least one embodiment, the compiler performs one or more aspects of process 400 to modify a previous assignment of a register. In at least one embodiment, the compiler performs one or more aspects of process 400 to apply a non-assignment transformation during the process of register assignment.

[0084] In at least one embodiment, certain registers are better suited for storing certain types of data values, which makes software performance dependent on which registers are used to store which data values. Figure 7The compiler of the compiler 714 performs one or more operations of process 400 based at least in part on one or more embodiments of process 100, process 200, process 300, process 500, process 600, or some combination thereof. In at least one embodiment, the compiler performing one or more operations in 400 combines heterogeneous types of transformations for different active scopes. In at least one embodiment, heterogeneous types of transformations refer to different types of modifications to a computer program. In at least one embodiment, the type of modification refers to one or more modifications to software instructions that, when executed by a processor, achieve a specific goal, such as spilling, reassignment, or rematerialization, as further discussed herein. In at least one embodiment, the compiler performs one or more operations of process 400 to apply transformations to active scopes, active segments, active nets, or some combination thereof. In at least one embodiment, an active segment is a portion of an active scope. In at least one embodiment, an active net is two or more active scopes. In at least one embodiment, active scopes, active segments, and active nets are calculated using a data structure such as a control flow graph. In at least one embodiment, a data structure such as an interference graph is used to determine the active scopes that must be allocated and / or assigned different registers. In at least one embodiment, a compiler performs one or more aspects of process 400 to apply one or more assignment transformations to one or more active scopes that do not require shared registers; for example, a compiler may apply a transformation that renames active scope B so that active scope A may always use register B that was previously assigned to active scope B. In at least one embodiment, one or more aspects of process 400 are applied to map intermediate representation (IR) virtual registers to physical resources, such as physical registers, during a compilation process.

[0085] In at least one embodiment, the compiler performs process 400 to select and / or implement transformations to perform register preference tasks, which are further described herein at least in conjunction with operation 408. In at least one embodiment, performing register preference tasks is referred to as register preference. In at least one embodiment, process 400 is used to assign values ​​of certain variables or variable types to certain registers based on factors such as frequency of use, data type, or some combination thereof. In at least one embodiment, process 400 is used to assign values ​​to registers. In at least one embodiment, process 400 is used to add instructions to move values ​​in registers to different locations. In at least one embodiment, register preference improves the performance of a program.

[0086] In at least one embodiment, process 400 begins with the compiler calculating the specific registers available to each active scope 402, as described herein in conjunction with Figure 1 In at least one embodiment, the compiler performs operation 403 to create an edit set for each available register that can be used by each active fragment, wherein the edit set is a set of transformations, which are described in at least one embodiment of the present invention in conjunction with Figure 2 Further description. In at least one embodiment, the edit set is referred to as an edit sequence. In at least one embodiment, the edit set includes one or more edits, wherein the edit is a transformation. In at least one embodiment, the edit is referred to as a transformation. In at least one embodiment, the edit set includes one or more transformations that can be conceptually applied to an active scope, an active fragment, an active net, or some combination thereof. In at least one embodiment, the edit set includes one or more transformations that can be conceptually applied to a register. In at least one embodiment, an edit is a set of instructions that are at least partially used to allocate and / or assign one or more registers to a specific active scope, an active fragment, an active net, or some combination thereof. In at least one embodiment, an edit is an instruction set that is at least partially used to modify program code to allocate and / or assign one or more registers. In at least one embodiment, the edit set includes one or more edits, such as assignment, reassignment, net splitting, renaming, or some combination thereof. In at least one embodiment, assignment is a cost-free edit, wherein the assignment does not cause a cost to the performance of the program. In at least one embodiment, a net split is a cost-free edit that changes an assignment from one physical register to a different physical register. In at least one embodiment, net splitting refers to splitting apart a static single assignment (SSA) net, which is a graphical representation of data as it is processed by a program. In at least one embodiment, SSA refers to a variable that is defined once before the program uses the variable. In at least one embodiment, SSA refers to a variable that has a single point of definition. In at least one embodiment, net splitting is an edit that inserts a copy between two or more sections of an SSA net. In at least one embodiment, net splitting is part of a modification to the control flow of a program.

[0087] In at least one embodiment, the compiler continues process 400 by calculating the edit set (if any) of the active net using operation 404. In at least one embodiment, the active net is referred to as a net. In at least one embodiment, a net is a set of connected active fragments, wherein the connected active fragments are active fragments including variables whose values ​​can be shared by a single register. In at least one embodiment, the connected active fragments are active fragments that share at least one register preference, which is further described herein at least in conjunction with operation 408. In at least one embodiment, the compiler builds the net from the connected active fragments. In at least one embodiment, the compiler performs a construction pass, wherein the compiler builds a net for each connected set of active fragments that share a register preference set. In at least one embodiment, the shared register preference set is referred to as the same preference. In at least one embodiment, the compiler calculates the available edit set for each active fragment as part of the construction pass. In at least one embodiment, the compiler calculates the available set for each net as the intersection of the available sets of all active fragments in the net.

[0088] In at least one embodiment, the compiler performs a self-conflict resolution pass as part of operation 406, where the compiler calculates whether a single net has one or more issues that prevent register assignments. In at least one embodiment, the compiler calculates whether two or more active fragments and their associated register assignments conflict with each other. In at least one embodiment, the compiler calculates whether the available edit set of the net is empty. In at least one embodiment, the compiler decomposes the net into subnets to resolve issues such as two or more active fragments that conflict with each other and / or an empty available set of the net. In at least one embodiment, the compiler decomposes the net into subnets by inserting copy instructions between member active fragments. In at least one embodiment, the compiler calculates one or more options for inserting copies and places them in a priority queue. In at least one embodiment, the compiler removes and applies edit sets until all issues have been resolved.

[0089] In at least one embodiment, the compiler performs one or more aspects of each of operations 404 and 406 to complete an assignment pass including two or more passes - the entire net assignment and problem solving. In at least one embodiment, a pass is referred to as a mode. In at least one embodiment, the assignment pass alternates between two or more modes. In at least one embodiment, the compiler performs one or more aspects of operation 404 as part of the entire net assignment pass. In at least one embodiment, during the entire net assignment, the compiler adds all nets to a priority queue and removes those nets in the order of highest to lowest priority. In at least one embodiment, the compiler removes any available register from the available set of nets and assigns the available register. In at least one embodiment, during problem solving, the compiler performs one or more aspects of self-conflict resolution passes, such as one or more aspects of operation 406. In at least one embodiment, the compiler generates a priority queue of edits, which will be further described herein. In at least one embodiment, the priority queue includes a performance metric indicating the cost of a particular edit. In at least one embodiment, the compiler generates a preference set for each net, such as a preference for using a specific register or using multiple registers. In at least one embodiment, the compiler uses a function to calculate the order of priority of edits. In at least one embodiment, the function that calculates the order of priority of edits is based on the size of the available register sets. In at least one embodiment, the compiler can prioritize one edit set over another edit set because the one edit set is larger than the other edit set.

[0090] In at least one embodiment, when a set of available registers of a net becomes empty after its edit has been selected for application to one or more nets, the compiler performs a transitional reassignment of registers from one net to another using operation 408. In at least one embodiment, transitional reassignment refers to the edit used when registers are assigned to a net, which can be used to assign those same registers to different nets. In at least one embodiment, operation 408 includes register assignment operations associated with active scopes and / or active nets that require two or more registers during program execution. In at least one embodiment, the compiler performs one or more aspects of operation 408 as part of a transitional reassignment pass, wherein the compiler reassigns registers to two or more active scopes and / or nets. In at least one embodiment, for example, if no registers are available for active scope A during its entire life cycle when one or more active scopes B1...Bn overlap with register Rx and are all assigned register Rx, then transitional reassignment occurs, and the compiler constructs a single edit set, which renames each active scope B1...Bn to other available registers, and assigns active scope A to use register Rx.

[0091] In at least one embodiment, the compiler performs process 400 by placing all edit sets calculated using operation 402 and / or operation 404 in a priority queue. In at least one embodiment, a priority queue refers to a data structure indicating the order in which edits are assigned, executed, or applied. In at least one embodiment, the data structure of the priority queue is any data structure capable of storing information indicating the priority order of application edits, such as an array, vector, matrix, tree, hash, or some combination thereof. In at least one embodiment, the priority level of the edit is based at least in part on constraints applied to map registers to active ranges, active fragments, active nets, or some combination thereof. In at least one embodiment, the constraints applied to map registers to active ranges are conventions defined by an application binary interface, which are rules by which program code is written to operate specific hardware.

[0092] In at least one embodiment, the priority level for editing is based at least in part on the suitability of registers to execute program functions, sometimes referred to as register preference or register affinity. In at least one embodiment, the priority level for editing is based at least in part on restrictions on the physical registers that can be assigned to active elements such as active nets, active ranges, or active fragments. In at least one embodiment, the type of register preference is referred to as required or required preference, where the compiler must assign specific physical registers to specific active elements. In at least one embodiment, the required preference arises due to an application binary interface (ABI), restrictions on specific instructions, or some combination thereof. In at least one embodiment, the ABI is referred to as a calling convention. In at least one embodiment, two or more active elements have a shared required preference or affinity, where the compiler must assign a single specific register to each of those active elements. In at least one embodiment, the compiler must A phi node is a node that assigns a single specific register to two or more active elements. In at least one embodiment, a phi node is part of the SSA form. In at least one embodiment, a phi node is an instruction for selecting a value based on a previous portion of the code.

[0093] In at least one embodiment, the type of register preference is referred to as a beneficial preference, a preferred preference, or a preferred preference, wherein assigning a particular register to an active element will result in better performance than assigning a different register to that active element, but assigning that different register will still allow at least a portion of the program to be executed. In at least one embodiment, two or more active elements have a shared beneficial preference or affinity, wherein assigning a particular register to those active elements will produce better performance than assigning two or more different registers to those active scopes. In at least one embodiment, the type of register preference is referred to as a don't care preference, wherein the compiler can assign any register to an active scope.

[0094] In at least one embodiment, the compiler continues process 400 by removing the edit set from the priority queue using operation 410 and applying it to the active fragment. In at least one embodiment, when the compiler removes each edit set from the priority queue, the compiler deletes all other edit sets associated with the active fragment. In at least one embodiment, the compiler checks whether the edit set is legal before removing the edit set from the priority queue. In at least one embodiment, if the registers assigned between the active fragments interfere, the compiler will insert a copy instruction. In at least one embodiment, non-copy and copy versions of the edit set are added to the priority queue. In at least one embodiment, the copy version of the edit set is an edit set copied from a previously calculated edit set. In at least one embodiment, the compiler performs two passes and only adds the non-copy version of the edit set. In at least one embodiment, if the priority queue is exhausted and one or more active fragments have not been assigned, the compiler performs a second pass in which only the copy version of the edit set is added. In at least one embodiment, when the compiler creates an edit set for each available register and each active fragment, the process is called per-fragment assignment. In at least one embodiment, if a set of active segments assigned to a single edit sequence is a subset of the active net, then copy instructions are inserted between the active segments. In at least one embodiment, the prioritization factors for considering active segments to be added to the edit sequence include preference type, size of the available set, or some combination thereof.

[0095] In at least one embodiment, one or more aspects of process 400 transform an active net, an active range, an active fragment, or some combination thereof, to make one or more physical registers available for use in an assignment. In at least one embodiment, for example, active net W1 has a required affinity for register R6, and W1 interferes with active net W2 that has been assigned to R6. In at least one embodiment, multiple edit sequences can be created: one edit sequence in which the edit sequence renames a portion of W2 so that R6 becomes available to all of W1; another edit sequence in which the edit sequence copies data to and from R6 of W1 at locations where W1 and W2 do not interfere, and assigns available registers to areas of W1 that do interfere with W2; and another edit sequence in which the edit sequence modifies the assignments for portions of each of W1 and W2.

[0096] In at least one embodiment, the type of affinity is insignificant for register assignment. In at least one embodiment, any number of registers may be assigned to any number of active nets or active fragments, or some combination thereof. In at least one embodiment, transformations that are traditionally classified as allocation transformations (such as splits or re-materializations) may be created and applied. In at least one embodiment, transformations that are traditionally classified as allocation transformations are used at least in part to perform the assignment task. In at least one embodiment, the allocation task and the assignment task are solved simultaneously or in a fine-grained interleaved manner. In at least one embodiment, the intermediate representation is not taken from the SSA form before register allocation and assignment. In at least one embodiment, it is preferred to have the intermediate representation in SSA form or to omit or perform an optional copy operation before allocation and assignment. In at least one embodiment, the selection and application of edit sequences are prioritized based on the type of affinity, whether the edit is traditionally considered to be an allocation or assignment task, the cost of the inserted instruction; the size of the availability set, the number of assigned active fragments, the amount of register pressure reduced by allocating related edits, or some combination thereof.

[0097] Figure 5 A process 500 for allocating registers by a compiler according to at least one embodiment is shown. In at least one embodiment, one or more aspects of process 500 are used to perform heterogeneous register pressure reduction, which is a different type of transformation implemented by a compiler to reduce register pressure. In at least one embodiment, a compiler performs process 500 to select heterogeneous register pressure reduction based on an estimated performance metric of the modified software, at least in conjunction with Figure 1 , operation 108 is further described. In at least one embodiment, the compiler performs process 500 to replace one or more memory operations with replacement memory operations based on estimated performance metrics of those memory operations and the replacement memory operations. In at least one embodiment, the memory operation is one or more instructions that allocate and / or assign registers to active scopes, active segments, active nets, or some combination thereof. In at least one embodiment, the memory operation is a transformation that allocates and / or assigns registers to active scopes, active segments, active nets, or some combination thereof. In at least one embodiment, the replacement memory operation is a memory operation implemented by the compiler to remove another memory operation. In at least one embodiment, the memory operations include allocation and / or assignment operations such as spill, split, rename, copy insert, rematerialize, merge, and reorder, which are described in at least one embodiment herein. Figure 4 Further description.

[0098] In at least one embodiment, the compiler performs one or more aspects of process 500 using any combination of register pressure reduction techniques to reduce register pressure in the compiler. In at least one embodiment, the compiler performs one or more aspects of process 500 to use cost estimates to select from a plurality of register pressure reduction options for a particular active scope.

[0099] In at least one embodiment, in combination Figure 5 One or more aspects of one or more embodiments described herein may be combined with at least one Figures 1 to 4 and Figure 6 to Figure 7 One or more aspects of one or more of the described embodiments are combined. In at least one embodiment, a compiler, such as compiler 714, performs one or more operations of process 500 based at least in part on one or more embodiments of process 100, process 200, process 300, process 400, process 600, or some combination thereof. In at least one embodiment, register pressure refers to the number of registers available to store multiple active elements, where a lower number of available registers results in higher register pressure. In at least one embodiment, register pressure refers to the number of elements that are simultaneously active at an instruction. In at least one embodiment, higher register pressure refers to a higher number of simultaneously active elements, such as variables or data values, at an instruction. In at least one embodiment, process 500 begins with the compiler identifying available registers using operation 502. In at least one embodiment, the compiler identifies all registers available for each active scope, as described herein in conjunction with Figure 1 500. In at least one embodiment, a compiler performing one or more aspects of process 500 applies assignment and / or allocation transformations all at once to a set of related active scopes. In at least one embodiment, a compiler performing one or more aspects of process 500 combines assignment and / or allocation transformations of heterogeneous types for different active fragments of one or more related active scopes.

[0100] In at least one embodiment, process 500 continues with the compiler generating an edit set using operation 504 for each available register identified using operation 502. In at least one embodiment, the compiler places the edit set in a priority queue, as described herein in at least conjunction with Figure 4As further described. In at least one embodiment, the compiler performs a pass to analyze all active scopes that are members of one or more excess regions. In at least one embodiment, an excess region is a portion of a program where an insufficient number of registers are available to execute the program to meet a desired performance metric determined by a user. In at least one embodiment, an excess region is a portion of the code where there are insufficient registers to store all active elements in that portion of the code. In at least one embodiment, the analysis examines each active fragment of each active scope.

[0101] In at least one embodiment, the compiler generates a set of heterogeneous register pressure reduction transformations using operation 504. In at least one embodiment, register pressure reduction transformations refer to any transformation implemented by the compiler to reduce register pressure. In at least one embodiment, an example of register pressure reduction is a spill instruction, which is an instruction that stores a value in a memory other than a register (which is typically a memory that operates more slowly than a register). In at least one embodiment, the compiler considers all applicable reduction transformations for an active segment to see if those reduction transformations can be legally applied to the active segment. In at least one embodiment, the compiler analyzes the reduction transformations of the active segment to determine whether the reduction transformation is cost-effective. In at least one embodiment, the compiler selects one or more legal transformations. In at least one embodiment, the compiler places the transformations for all excess active segments into a single edit set. In at least one embodiment, multiple transformations are possible for one or more active segments, and the compiler creates multiple edit sets. In at least one embodiment, a single edit set includes multiple types of transformations, each of which is applied to a different active segment. In at least one embodiment, the transformations include any type of transformation that is at least partially used to allocate and / or assign registers, including spilling, splitting, renaming, copy insertion, re-materialization, merging, and reordering. In at least one embodiment, the compiler applies a unique overflow for each definition (def) of a variable and a unique fill for each use of the variable. In at least one embodiment, the split instruction includes a single overflow instruction covering multiple defs and / or a single fill instruction covering multiple uses. In at least one embodiment, the rename transformation includes changing the assignment of a previously assigned active range. In at least one embodiment, the copy-insert transformation includes changing the assignment of an appropriate subset of active fragments of the active range by inserting a copy instruction. In at least one embodiment, the re-materialization transformation includes inserting an instruction sequence for recalculating one or more values ​​from currently available values. In at least one embodiment, the merge transformation removes the move instruction that moves the assignment of a data value from one register to another register by assigning the data value to a register. In at least one embodiment, the reorder transformation includes changing the order of existing instructions to reduce register pressure. In at least one embodiment, the compiler handles all possible transformations consistently without prioritizing one transformation over another. In at least one embodiment, all legal transformations can be applied during a major reduction pass, which includes a pass in which the compiler implements transformations to reduce register pressure.

[0102] In at least one embodiment, process 500 continues by applying a set of reduction transformations according to the priority queue using operation 506, which is described herein in at least Figure 3The priority queue is further described in operation 304. In at least one embodiment, the compiler applies the heterogeneous transformation set to a single active scope, active fragment, active net, or some combination thereof. In at least one embodiment, the compiler applies the heterogeneous transformation set so that a single variable value is stored in one or more specific registers.

[0103] Figure 6 A process 600 for allocating registers for a compiler according to at least one embodiment is shown. In at least one embodiment, the compiler performs process 600 to select multiple processor register configurations for allocation to threads based on previously measured performance metrics associated with register allocation configurations. In at least one embodiment, a register configuration refers to a specific number of register blocks. In at least one embodiment, a register block is a type of register grouping. In at least one embodiment, a register block is referred to as a register group. In at least one embodiment, a register configuration refers to how registers are grouped for use by software, such as how many register blocks are allocated and / or assigned to each thread. In at least one embodiment, a replacement register configuration refers to a new register configuration for a thread that replaces another register configuration for the same thread. In at least one embodiment, the registers of a processor are grouped into register blocks, wherein each register block contains the same number of registers. In at least one embodiment, the compiler performs process 600 to reduce the number of register blocks required for one or more threads. In at least one embodiment, the compiler performs process 600 to increase the number of threads that can be executed in parallel. In at least one embodiment, the compiler performs process 600 to increase the number of threads that can be executed in parallel, while estimating that those threads will still exceed one or more performance values ​​if executed.

[0104] In at least one embodiment, a compiler performs one or more aspects of process 600 to allocate a first plurality of processor registers to be allocated to one or more software threads based at least in part on one or more computational performance metrics associated with the allocated second plurality of registers, wherein the computational performance metrics are measured prior to allocating the first plurality of processor registers. In at least one embodiment, the plurality of registers refers to a configuration of registers, such as a block of registers. In at least one embodiment, the compiler allocates the plurality of registers as part of an iterative process that repeatedly allocates the plurality of registers to identify the plurality of registers that optimize computational performance.

[0105] In at least one embodiment, in combination Figure 6 One or more aspects of one or more embodiments described herein may be combined with at least one Figures 1 to 5 and Figure 7In at least one embodiment, a compiler (such as Figure 7 A compiler 714) performs one or more operations of process 600 based at least in part on one or more embodiments of process 100, process 200, process 300, process 400, process 500, or some combination thereof. In at least one embodiment, the compiler performs one or more aspects of process 600 to allocate multiple registers to threads. In at least one embodiment, the compiler performs one or more aspects of process 600 to allocate multiple register blocks to threads. In at least one embodiment, a register block is a fixed number of registers that can be assigned to a thread; for example, if a register block includes 8 registers and a thread requires 9 registers, the compiler must assign two blocks of 8 registers each to the thread. In at least one embodiment, the compiler begins process 600 by identifying all active scopes 602 within the program, which is described herein at least in conjunction with Figure 1 Operation 104 is further described.

[0106] In at least one embodiment, the compiler continues process 600 by generating a set of transformations that will allow multiple register blocks to be assigned to more threads using operation 604. In at least one embodiment, the compiler generates a set of transformations that will allow a smaller number of register blocks to be assigned to multiple threads. In at least one embodiment, the compiler generates a set of transformations for each active range that spans an excess region, wherein the excess region refers to a portion of a program where not enough registers are available to store all data values ​​associated with the portion. In at least one embodiment, the excess region refers to an area where the register requirements of the program code of the application are higher than one or more register targets. In at least one embodiment, the register target is the desired number of registers that the compiler or user intends to use in the area of ​​the program code of the application. In at least one embodiment, the compiler reduces the register requirements by selecting and applying a set of reduction transformations. In at least one embodiment, the compiler generates and maintains a separate data structure to represent the transformations implemented during the intermediate representation (IR) stage of compilation and / or information about the transformations implemented during the intermediate representation (IR) stage of compilation, which reduces the number of register blocks, while maintaining a separate interference graph to represent other transformation intermediate representation (IR) transformations.

[0107] In at least one embodiment, a transformation that reduces the number of register blocks required to execute multiple threads is referred to as moving down a cliff, or cliff rappelling. In at least one embodiment, increasing the number of register blocks required to execute multiple threads is referred to as moving up acliff. In at least one embodiment, multiple register blocks are referred to as a cliff or register cliff; for example, a cliff may be 5 register blocks, while a lower cliff would be 4 register blocks, and an upper cliff would be 6 register blocks. In at least one embodiment, a particular processor register configuration is referred to as a cliff.

[0108] In at least one embodiment, the compiler continues process 600 by calculating a move to a higher register cliff, a move to a lower register cliff, or maintaining a current register cliff with operation 606. In at least one embodiment, the compiler performs operation 606 to allocate an additional register block to the thread, to deallocate a register block to the thread, or to maintain a current allocation of a register block with operation 606. In at least one embodiment, allocating an additional register block is referred to as moving to a higher register cliff. In at least one embodiment, deallocating a register block is referred to as moving to a lower register cliff. In at least one embodiment, calculating whether to move from a higher register cliff to a lower register cliff, or vice versa, is based at least in part on the performance cost of reducing the transformation required to achieve the move from one cliff to another. In at least one embodiment, a user provides input to the compiler, which sets a threshold number of transformations acceptable to the user. In at least one embodiment, the user inputs a number of overflow and / or inserted instructions that are acceptable to the target cliff.

[0109] In at least one embodiment, the compiler continues process 600 by identifying whether a move improves performance using operation 607, where the move refers to a move to a higher or lower register cliff calculated using operation 606. In at least one embodiment, if the compiler identifies that the move will improve performance, the compiler applies the associated transformation using operation 608. In at least one embodiment, if the compiler identifies that the move will not improve performance, process 600 ends. In at least one embodiment, if the compiler identifies that a move to another register cliff will not improve performance, the most recent move to the register cliff is applied using operation 608.

[0110] In at least one embodiment, the compiler continues process 600 by applying the selected set of transformations using operation 608. In at least one embodiment, the transformations are applied according to a priority queue, and at least one embodiment of the present invention is combined with Figure 4 The priority queue is further described. In at least one embodiment, the compiler application is as described herein in conjunction with Figure 3 The transformation is further described in operation 304 of FIG. In at least one embodiment, after the compiler completes operation 608, the compiler performs operation 602 in another iteration of a portion of process 600 to identify a register cliff that is optimal for performance.

[0111] Figure 7 A block diagram is shown of a system 700 for causing one or more circuits to allocate and / or assign registers to active scopes, active segments, active nets, or some combination thereof, in accordance with at least one embodiment. Figure 7 One or more aspects of one or more embodiments described perform one or more embodiments of process 100, process 200, process 300, process 400, process 500, process 600, or some combination thereof. In at least one embodiment, host 702 is a computer system including a processor 706 (such as a CPU) and a memory 708. In at least one embodiment, instruction set 710 includes one or more definitions of one or more functions.

[0112] In at least one embodiment, the processor 706 is used to execute a compiler 714 that is used to generate code 716 based at least in part on the instructions 710. In at least one embodiment, the instruction set 710 is referred to as source code or a representation of a function, kernel, or program. In at least one embodiment, the compiler 714 translates code from one programming language to another programming language. In at least one embodiment, the compiler 714 translates code from a high-level programming language (e.g., Python, Fortran, C++, C#, Java, Visual Basic, JavaScript) to a low-level programming language, such as machine language and assembly language (e.g., GCN, x64Assembly, PTX). In at least one embodiment, compiler 714 includes more than one type of compiler, such as a host compiler, an interpreter, a cross compiler, an incremental compiler, or some combination thereof. In at least one embodiment, compiler 714 is a compiler, such as Optimizing C / C++ Compiler (AOCC), oneAPIDPC++ / C++ compiler, Compiler (NVCC), NVFORTRAN, NVC++, NVC, or some combination thereof. In at least one embodiment, compiler 714 is an optimizing compiler. In at least one embodiment, compiler 714 is configured for parallel computing. In at least one embodiment, compiler 714 is configured for high performance computing (HPC) in different fields, such as scientific research (e.g., meteorology), media and entertainment (e.g., graphics rendering), oil and gas (e.g., identification of where to drill), artificial intelligence (e.g., autonomous driving), financial services (e.g., automatic trading), or some combination thereof.

[0113] In at least one embodiment, as used in any implementation described herein, unless otherwise clear from the context or explicitly stated to the contrary, terms such as "module" and nominalized verbs (e.g., compiler, model preference generator, model selector, performance monitor, model trainer, encoder, decoder, downlink channel estimator, beamformer, controller, and / or other terms) each refer to any combination of software logic, firmware logic, hardware logic, and / or circuitry configured to provide the functionality described herein. In at least one embodiment, software may be embodied as a software package, code, and / or instruction set or instructions, and as used in any implementation described herein, "hardware" may, for example, include hardwired circuits, programmable circuits, state machine circuits, fixed function circuits, execution unit circuits, and / or firmware storing instructions executed by programmable circuits, alone or in any combination. In at least one embodiment, modules may be collectively or individually embodied as circuits that form part of a larger system (e.g., an integrated circuit (IC), a system on a chip (SoC), etc.).

[0114] In at least one embodiment, system 700 includes a computer-readable storage medium and / or code stored on the computer-readable storage medium in the form of a computer program that includes a plurality of computer-readable instructions executable by one or more processors. In at least one embodiment, the computer-readable storage medium is a non-transitory computer-readable medium. In at least one embodiment, the computer-readable storage medium may be used to perform operations related to the computer-readable storage medium. Figure 1 At least some of the computer readable instructions for the operations described in process 100 are stored using more than just transient signals (e.g., propagated transient electrical or electromagnetic transmissions). In at least one embodiment, the non-transitory computer readable medium does not necessarily include non-transitory data storage circuits (e.g., buffers, caches, and queues) within a transceiver of transient signals. In at least one embodiment, system 700 is at least partially implemented as a non-transitory computer readable storage medium storing executable instructions that, if executed by one or more processors of a computer system, cause the computer system to cause a compiler to allocate and / or assign registers to active scopes, active fragments, active nets, or some combination thereof, at least as described herein in conjunction with Figure 1 The process 100 is further described.

[0115] In at least one embodiment, code 716 is referred to as an instruction, executable instruction, or representation of a function, kernel, or program. In at least one embodiment, code 716 is an intermediate representation of a function, kernel, or program. In at least one embodiment, code 716 is an executable version of a function, kernel, or program. In at least one embodiment, the type of memory (e.g., constant memory, shared memory, device memory, and / or other suitable types of memory) is not a specific location defined in hardware, but rather a designation for a specific portion of memory that is to be handled and / or treated in a specific manner.

[0116] In at least one embodiment, processor 706 executes application programming interface (API) 717 to perform one or more aspects of one or more embodiments described herein, including at least in conjunction with Figures 1 to 7 In at least one embodiment, API 717 is at least in combination with Fig.24 and Figure 27 to Figure 29 In at least one embodiment, the input to the API 717 includes an indication, such as a flag, that a user sets to enable one or more aspects of one or more embodiments described herein. In at least one embodiment, the input to the API 717 includes any type of metric or value, which may include a threshold, a register number, or some combination thereof, which is further described herein.

[0117] In at least one embodiment, compiler 714 generates edit set 718, as described herein at least in conjunction with Figure 1-6 In at least one embodiment, the edit set 718 is stored in the memory 708. In at least one embodiment, the host 702 is configured to launch one or more kernels based at least in part on the edit set 718. In at least one embodiment, the thread set 724 is configured to execute the launched one or more kernels, wherein the performance is based at least in part on the edit set 718. In at least one embodiment, the processor 720 is configured to execute the kernel using the thread set 724, wherein the performance is based at least in part on the edit set 718.

[0118] In at least one embodiment, device 704 is an accelerator including a processor 720 (e.g., one or more parallel processors) and a memory 722. In at least one embodiment, device 704 is a parallel processing unit (PPU) or a graphics processing unit (GPU). In at least one embodiment, host 702 is used to initiate operations and / or instructions to be executed on device 704 (e.g., by launching parallel processing framework instructions, such as Compute Unified Device Architecture (CUDA) kernels). In at least one embodiment, parallel processing framework instructions for frameworks other than CUDA are used (e.g., for Radeon OpenCompute Platform ("ROCm"), HIP, OpenCL (OpenCL TM In at least one embodiment, an executor (not shown for clarity) running on host 702 is used to launch the instructions. In at least one embodiment, the executor runs on a CPU (such as processor 706) and launches the instructions on a parallel processing unit (e.g., GPU), for example as a kernel. In at least one embodiment, the executor is a virtual machine running on processor 706 (e.g., CPU).

[0119] In at least one embodiment, a different number of processors (e.g., more than one processor 706 and / or more than one processor 720), a different number of devices (e.g., more than one device 704), and / or a different number of memories (e.g., more than one memory 708 and / or more than one memory 722) are included in the computer system 700. In at least one embodiment, the computer system 700 includes one or more other components not shown for clarity (e.g., a network interface card, a persistent storage device, one or more input devices, one or more output devices, and / or one or more other suitable components).

[0120] In at least one embodiment, the host 702 is used to launch one or more functions (e.g., kernels). In at least one embodiment, the host 702 is used to launch one or more kernels. In at least one embodiment, a thread set 724 is used to execute the launched one or more kernels. In at least one embodiment, the processor 720 is used to execute the kernel using the thread set 724. In at least one embodiment, the thread set 724 is specified when the kernel is launched (e.g., from the host 702). In at least one embodiment, one or more functions and / or kernels will be launched on the host 702 instead of the device 704 (e.g., using a multi-threaded processor and / or a multi-core processor to execute multiple threads, where the processor 706 can be a multi-threaded and / or multi-core processor, and the memory 708 includes one or more memories, such as constant memory, shared memory, and / or device memory). In at least one embodiment, one or more other thread sets (e.g., thread grids) not shown for clarity are executed by the device 704 (e.g., concurrently executing one or more other kernels).

[0121] In at least one embodiment, the thread set 724 is referred to as a thread grid or thread array. In at least one embodiment, the thread set 724 is referred to as a first-level thread. In at least one embodiment, the thread set 724 includes one or more thread subsets (e.g., thread subset 726 and thread subset 728). In at least one embodiment, the thread subset 726 is referred to as a first thread block, and the thread subset 728 is referred to as a second thread block. In at least one embodiment, the first thread subset 726 and the second thread subset 728 are referred to as second-level threads. In at least one embodiment, the thread set 724 includes one or more additional levels of threads (e.g., third-level threads). In at least one embodiment, the third-level threads include thread sets that are subsets of the grouping of threads at the second-level threads. In at least one embodiment, the first thread subset 726 includes a thread subset 730 and a thread subset 732. In at least one embodiment, the second thread subset 728 includes a thread subset 734 and a thread subset 736. In at least one embodiment, thread subset 730, thread subset 732, thread subset 734, and thread subset 736 are each referred to as a cooperative thread array (CTA). In at least one embodiment, each CTA includes multiple individual threads, which are not shown for clarity.

[0122] In at least one embodiment, one or more names are associated with memory 722. In at least one embodiment, the names are referred to as types of memory. In at least one embodiment, the names include constant memory 738, shared memory 740, and device memory 742. In at least one embodiment, different numbers and / or types of names are used. In at least one embodiment, one or more names refer to how the values ​​stored in the memory associated with those names will be handled (e.g., the values ​​stored in the memory designated as constants use hardware and / or software optimizations to perform accelerated operations using constant values). In at least one embodiment, one or more names can be used for more than one type, location, and / or level of memory (e.g., off-chip, on-chip, different cache levels, and / or some other suitable memory types).

[0123] Data Center

[0124] Figure 8 An example data center 800 is shown in accordance with at least one embodiment. In at least one embodiment, the data center 800 includes, but is not limited to, a data center infrastructure layer 810, a framework layer 820, a software layer 830, and an application layer 840.

[0125] In at least one embodiment, Figure 8 As shown, the data center infrastructure layer 810 may include a resource coordinator 812, grouped computing resources 814, and node computing resources ("node CRs") 816 (1)-816 (N), where "N" represents any complete positive integer. In at least one embodiment, the node CRs 816 (1)-816 (N) may include, but are not limited to, any number of central processing units ("CPUs") or other processors (including accelerators, active field programmable gate arrays ("FPGAs"), data processing units (DPUs) in network devices, graphics processors, etc.), memory devices (e.g., dynamic read-only memories), storage devices (e.g., solid-state drives or disk drives), network input / output ("NW I / O") devices, network switches, virtual machines ("VMs"), power modules and cooling modules, etc. In at least one embodiment, one or more of the node CRs 816 (1)-816 (N) may be a server having one or more of the above computing resources.

[0126] In at least one embodiment, the grouped computing resources 814 may include a separate grouping of node CRs housed in one or more racks (not shown), or many racks (also not shown) housed in data centers at various geographic locations. The separate grouping of node CRs within the grouped computing resources 814 may include computing, network, memory or storage resources that can be configured or allocated to support groupings of one or more workloads. In at least one embodiment, several node CRs including a CPU or processor may be grouped in one or more racks to provide computing resources to support one or more workloads. In at least one embodiment, one or more racks may also include any number of power modules, cooling modules and network switches in any combination.

[0127] In at least one embodiment, resource coordinator 812 may configure or otherwise control one or more node CRs 816(1)-816(N) and / or grouped computing resources 814. In at least one embodiment, resource coordinator 812 may include a software design infrastructure ("SDI") management entity for data center 800. In at least one embodiment, resource coordinator 812 may include hardware, software, or some combination thereof.

[0128] In at least one embodiment, Figure 8 As shown, the framework layer 820 includes, but is not limited to, a job scheduler 832, a configuration manager 834, a resource manager 836, and a distributed file system 838. In at least one embodiment, the framework layer 820 may include a framework that supports software 852 of the software layer 830 and / or one or more applications 842 of the application layer 840. In at least one embodiment, the software 852 or the application 842 may include web-based service software or applications, such as those provided by Amazon Web Services, Google Cloud, and Microsoft Azure. In at least one embodiment, the framework layer 820 may be, but is not limited to, a free and open source software web application framework, such as Apache Spark, which may utilize the distributed file system 838 for large-scale data processing (e.g., "big data"). TM(hereinafter referred to as "Spark"). In at least one embodiment, the job scheduler 832 may include a Spark driver to facilitate scheduling of workloads supported by various layers of the data center 800. In at least one embodiment, the configuration manager 834 may be able to configure different layers, such as the software layer 830 and the framework layer 820 including Spark and a distributed file system 838 for supporting large-scale data processing. In at least one embodiment, the resource manager 836 can manage cluster or group computing resources mapped to or allocated to support the distributed file system 838 and the job scheduler 832. In at least one embodiment, the cluster or group computing resources may include grouped computing resources 814 on the data center infrastructure layer 810. In at least one embodiment, the resource manager 836 may coordinate with the resource coordinator 812 to manage these mapped or allocated computing resources.

[0129] In at least one embodiment, the software 852 included in the software layer 830 may include software used by at least a portion of the node CRs 816(1)-816(N), the grouped computing resources 814, and / or the distributed file system 838 of the framework layer 820. The one or more types of software may include, but are not limited to, Internet web page search software, email virus scanning software, database software, and streaming video content software.

[0130] In at least one embodiment, the one or more applications 842 included in the application layer 840 may include one or more types of applications used by at least a portion of the node CRs 816(1)-816(N), the grouped computing resources 814, and / or the distributed file system 838 of the framework layer 820. The one or more types of applications may include, but are not limited to, CUDA applications.

[0131] In at least one embodiment, any of the configuration manager 834, resource manager 836, and resource coordinator 812 can implement any number and type of self-modification actions based on any number and type of data acquired in any technically feasible manner. In at least one embodiment, the self-modification actions can relieve a data center operator of the data center 800 from making potentially bad configuration decisions and can avoid underutilized and / or poorly performing portions of the data center.

[0132] In at least one embodiment, Figure 8 At least one component shown or described is used to implement the invention described herein and at least in conjunction with Figures 1 to 7 In at least one embodiment, server 812 enables the compiler to be based on the techniques and / or functions described herein. Figure 1The process 100 further describes the estimated performance cost of assigning registers to active scopes.

[0133] Computer-based systems

[0134] The following figures set forth, but are not limiting of, exemplary computer-based systems that may be used to implement at least one embodiment.

[0135] Fig. 9 A processing system 900 according to at least one embodiment is shown. In at least one embodiment, the system 900 includes one or more processors 902 and one or more graphics processors 908, and can be a single processor desktop system, a multi-processor workstation system, or a server system with a large number of processors 902 or processor cores 907. In at least one embodiment, the processing system 900 is a processing platform incorporated into a system on a chip (SoC) integrated circuit for use in a mobile, handheld, or embedded device. In at least one embodiment, the processor core 907 is referred to as an operation unit or a computing unit.

[0136] In at least one embodiment, the processing system 900 may include or be incorporated into a server-based gaming platform, including a gaming console, a mobile gaming console, a handheld gaming console, or an online gaming console for gaming and media consoles. In at least one embodiment, the processing system 900 is a mobile phone, a smart phone, a tablet computing device, or a mobile Internet device. In at least one embodiment, the processing system 900 may also include a wearable device coupled to or integrated in a wearable device, such as a smart watch wearable device, a smart glasses device, an augmented reality device, or a virtual reality device. In at least one embodiment, the processing system 900 is a television or set-top box device having one or more processors 902 and a graphical interface generated by one or more graphics processors 908.

[0137] In at least one embodiment, one or more processors 902 each include one or more processor cores 907 to process instructions that, when executed, perform operations for system and user software. In at least one embodiment, each of the one or more processor cores 907 is configured to process a specific instruction set 909. In at least one embodiment, the instruction set 909 can facilitate complex instruction set computing (CISC), reduced instruction set computing (RISC), or calculate by very long instruction words (VLIW). In at least one embodiment, a plurality of processor cores 907 can each process a different instruction set 909, which can include instructions that contribute to emulating other instruction sets. In at least one embodiment, the processor core 907 can also include other processing devices, such as a digital signal processor (DSP).

[0138] In at least one embodiment, the processor 902 includes a cache memory (cache) 904. In at least one embodiment, the processor 902 can have a single internal cache or multiple levels of internal cache. In at least one embodiment, the cache memory is shared between the various components of the processor 902. In at least one embodiment, the processor 902 also uses an external cache (e.g., a level 3 (L3) cache or a last level cache (LLC)) (not shown), which can share the logic between the processor cores 907 using known cache coherence techniques. In at least one embodiment, the processor 902 additionally includes a register file 906, and the processor 902 may include different types of registers (e.g., integer registers, floating point registers, status registers, and instruction pointer registers) for storing different types of data. In at least one embodiment, the register file 906 may include general registers or other registers.

[0139] In at least one embodiment, one or more processors 902 are coupled to one or more interface buses 910 to transmit communication signals, such as address, data, or control signals, between the processor 902 and other components in the system 900. In at least one embodiment, the interface bus 910 can be a processor bus in one embodiment, such as a version of a direct media interface (DMI) bus. In at least one embodiment, the interface bus 910 is not limited to a DMI bus, and can include one or more peripheral component interconnect buses (e.g., PCI, PCI Express), memory buses, or other types of interface buses. In at least one embodiment, the processor 902 includes an integrated memory controller 916 and a platform controller hub 930. In at least one embodiment, the memory controller 916 facilitates communication between storage devices and other components of the processing system 900, while the platform controller hub (PCH) 930 provides connections to input / output (I / O) devices through a local I / O bus. In at least one embodiment, one or more peripheral component interconnect buses include PCIe Gen5, which provides an interface for the processor.

[0140] In at least one embodiment, the storage device 920 may be a dynamic random access memory (DRAM) device, a static random access memory (SRAM) device, a flash memory device, a phase change memory device, or have appropriate performance for use as a processor memory. In at least one embodiment, the storage device 920 may be used as a system memory of the processing system 900 to store data 922 and instructions 921 for use when one or more processors 902 execute an application or process. In at least one embodiment, the memory controller 916 is also coupled to an optional external graphics processor 912, which may communicate with one or more graphics processors 908 in the processor 902 to perform graphics and media operations. In at least one embodiment, the display device 911 may be connected to the processor 902. In at least one embodiment, the display device 911 may include one or more of the internal display devices, such as in a mobile electronic device or portable computer device or an external display device connected via a display interface (e.g., a display port (DisplayPort) or the like). In at least one embodiment, the display device 911 may include a head mounted display (HMD), such as a stereoscopic display device for virtual reality (VR) applications or augmented reality (AR) applications.

[0141] In at least one embodiment, the platform controller hub 930 enables peripheral devices to be connected to the storage device 920 and the processor 902 via a high-speed I / O bus. In at least one embodiment, the I / O peripherals include, but are not limited to, an audio controller 946, a network controller 934, a firmware interface 928, a wireless transceiver 926, a touch sensor 925, a data storage device 924 (e.g., a hard drive, flash memory, etc.). In at least one embodiment, the data storage device 924 can be connected via a memory interface (e.g., SATA) or via a peripheral bus, such as a peripheral component interconnect bus (e.g., PCI, PCIe). In at least one embodiment, the touch sensor 925 can include a touch screen sensor, a pressure sensor, or a fingerprint sensor. In at least one embodiment, the wireless transceiver 926 can be a Wi-Fi transceiver, a Bluetooth transceiver, or a mobile network transceiver, such as a 3G, 4G, or long-term evolution (LTE) transceiver. In at least one embodiment, the firmware interface 928 enables communication with the system firmware, and can be, for example, a unified extensible firmware interface (UEFI). In at least one embodiment, the network controller 934 can enable network connection to a wired network. In at least one embodiment, a high performance network controller (not shown) is coupled to the interface bus 910. In at least one embodiment, the audio controller 946 is a multi-channel high definition audio controller. In at least one embodiment, the processing system 900 includes an optional legacy I / O controller 940 for coupling legacy (e.g., Personal System 2 (PS / 2)) devices to the processing system 900. In at least one embodiment, the platform controller hub 930 may also be connected to one or more universal serial bus (USB) controllers 942 that connect input devices such as a keyboard and mouse 943 combination, a camera 944, or other USB input devices.

[0142] In at least one embodiment, instances of memory controller 916 and platform controller hub 930 may be integrated into a discrete external graphics processor, such as external graphics processor 912. In at least one embodiment, platform controller hub 930 and / or memory controller 916 may be external to one or more processors 902. For example, in at least one embodiment, processing system 900 may include external memory controller 916 and platform controller hub 930, which may be configured as a memory controller hub and a peripheral controller hub in a system chipset that communicates with processor 902.

[0143] In at least one embodiment, Fig. 9 At least one component shown or described is used to implement the invention described herein and at least in conjunction with Figures 1 to 7In at least one embodiment, one or more processors 902 cause the compiler to be based on the techniques and / or functions described herein. Figure 1 The process 100 further describes the estimated performance cost of assigning registers to active scopes.

[0144] Fig.10 A computer system 1000 is shown in accordance with at least one embodiment. In at least one embodiment, the computer system 1000 may be a system with interconnected devices and components, a SOC, or some combination. In at least one embodiment, the computer system 1000 is formed by a processor 1002, which may include an execution unit for executing instructions. In at least one embodiment, the computer system 1000 may include, but is not limited to, components, such as the processor 1002, which employs an execution unit including logic to execute algorithms for processing data. In at least one embodiment, the computer system 1000 may include a processor, such as Intel Corporation of Santa Clara, California, available from Processor family, XeonTM, XScaleTM and / or StrongARMTM, Core TM or Nervana TM microprocessor, although other systems (including PCs with other microprocessors, engineering workstations, set-top boxes, etc.) may also be used. In at least one embodiment, computer system 1000 may execute a version of the WINDOWS operating system available from Microsoft Corporation of Redmond, Wash., although other operating systems (e.g., UNIX and Linux), embedded software, and / or graphical user interfaces may also be used.

[0145] In at least one embodiment, computer system 1000 can be used in other devices, such as handheld devices and embedded applications. Some examples of handheld devices include cellular phones, Internet Protocol (Internet Protocol) devices, digital cameras, personal digital assistants ("PDAs"), and handheld PCs. In at least one embodiment, embedded applications can include microcontrollers, digital signal processors ("DSPs"), SoCs, network computers ("NetPCs"), set-top boxes, network hubs, wide area network ("WAN") switches, or any other system that can execute one or more instructions according to at least one embodiment.

[0146] In at least one embodiment, computer system 1000 may include, but is not limited to, a processor 1002, which may include, but is not limited to, one or more execution units 1008, which may be configured to execute Compute Unified Device Architecture (“CUDA”) ( Developed by NVIDIA Corporation of Santa Clara, California) program. In at least one embodiment, a CUDA program is at least a portion of a software application written in the CUDA programming language. In at least one embodiment, the computer system 1000 is a single processor desktop or server system. In at least one embodiment, the computer system 1000 may be a multi-processor system. In at least one embodiment, the processor 1002 may include, but is not limited to, a CISC microprocessor, a RISC microprocessor, a VLIW microprocessor, a processor that implements an instruction set combination, or any other processor device, such as a digital signal processor. In at least one embodiment, the processor 1002 may be coupled to a processor bus 1010, which may transmit data signals between the processor 1002 and other components in the computer system 1000.

[0147] In at least one embodiment, processor 1002 may include, but is not limited to, a level 1 ("L1") internal cache memory ("cache") 1004. In at least one embodiment, processor 1002 may have a single internal cache or multiple levels of internal cache. In at least one embodiment, cache memory may reside external to processor 1002. In at least one embodiment, processor 1002 may include a combination of internal and external caches. In at least one embodiment, register file 1006 may store different types of data in various registers, including but not limited to integer registers, floating point registers, status registers, and instruction pointer registers.

[0148] In at least one embodiment, an execution unit 1008, including but not limited to logic to perform integer and floating point operations, is also located in the processor 1002. The processor 1002 may also include a microcode ("ucode") read-only memory ("ROM") for storing microcode for certain macroinstructions. In at least one embodiment, the execution unit 1008 may include logic for processing a packed instruction set 1009. In at least one embodiment, by including the packed instruction set 1009 in the instruction set of the general purpose processor 1002, and the associated circuitry to execute the instructions, operations used by many multimedia applications may be performed using packed data in the general purpose processor 1002. In at least one embodiment, many multimedia applications may be executed faster and more efficiently by using the full width of the processor's data bus to perform operations on packed data, which may not require the transfer of smaller units of data on the processor's data bus to perform one or more operations on one data element at a time.

[0149] In at least one embodiment, execution unit 1008 may also be used in microcontrollers, embedded processors, graphics devices, DSPs, and other types of logic circuits. In at least one embodiment, computer system 1000 may include, but is not limited to, memory 1020. In at least one embodiment, memory 1020 may be implemented as a DRAM device, an SRAM device, a flash memory device, or other storage device. Memory 1020 may store instructions 1019 and / or data 1021 represented by data signals that may be executed by processor 1002.

[0150] In at least one embodiment, the system logic chip can be coupled to the processor bus 1010 and the memory 1020. In at least one embodiment, the system logic chip can include, but is not limited to, a memory controller hub ("MCH") 1016, and the processor 1002 can communicate with the MCH 1016 via the processor bus 1010. In at least one embodiment, the MCH 1016 can provide a high bandwidth memory path 1018 to the memory 1020 for instruction and data storage and for storage of graphics commands, data, and textures. In at least one embodiment, the MCH 1016 can initiate data signals between the processor 1002, the memory 1020, and other components in the computer system 1000, and bridge data signals between the processor bus 1010, the memory 1020, and the system I / O 1022. In at least one embodiment, the system logic chip can provide a graphics port for coupling to a graphics controller. In at least one embodiment, the MCH 1016 may be coupled to the memory 1020 via a high bandwidth memory path 1018 , and the graphics / video card 1012 may be coupled to the MCH 1016 via an Accelerated Graphics Port (“AGP”) interconnect 1014 .

[0151] In at least one embodiment, computer system 1000 may use system I / O 1022 as a proprietary hub interface bus to couple MCH 1016 to I / O controller hub ("ICH") 1030. In at least one embodiment, ICH 1030 may provide direct connection to certain I / O devices through a local I / O bus. In at least one embodiment, the local I / O bus may include, but is not limited to, a high-speed I / O bus used to connect peripheral devices to memory 1020, chipsets, and processor 1002. Examples may include, but are not limited to, an audio controller 1029, a firmware hub ("Flash BIOS") 1028, a wireless transceiver 1026, a data store 1024, a traditional I / O controller 1023 including user input 1025 and a keyboard interface, a serial expansion port 1027 (e.g., USB), and a network controller 1034. Data store 1024 may include a hard drive, a floppy drive, a CD-ROM device, a flash memory device, or other mass storage device.

[0152] In at least one embodiment, Fig.10 A system comprising interconnected hardware devices or "chips" is shown. In at least one embodiment, Fig.10 An exemplary SoC may be shown. In at least one embodiment, Fig.10The devices shown in can be interconnected with a proprietary interconnect, a standardized interconnect (eg, PCIe), or some combination thereof. In at least one embodiment, one or more components of system 1000 are interconnected using a compute express link (CXL) interconnect.

[0153] In at least one embodiment, Fig.10 At least one component shown or described is used to implement the invention described herein and at least in conjunction with Figures 1 to 7 In at least one embodiment, processor 1002 causes a compiler to be based on the techniques and / or functions described herein. Figure 1 The process 100 further describes the estimated performance cost of assigning registers to active scopes.

[0154] Fig.11 A system 1100 is shown in accordance with at least one embodiment. In at least one embodiment, the system 1100 is an electronic device utilizing a processor 1110. In at least one embodiment, the system 1100 can be, for example but not limited to, a notebook computer, a tower server, a rack server, a blade server, an edge device communicatively coupled to one or more local or cloud service providers, a laptop computer, a desktop computer, a tablet computer, a mobile device, a phone, an embedded computer, or any other suitable electronic device.

[0155] In at least one embodiment, system 1100 may include, but is not limited to, a processor 1110 communicatively coupled to any suitable number or variety of components, peripherals, modules, or devices. In at least one embodiment, processor 1110 is coupled using a bus or interface, such as an I 2 C bus, system management bus ("SMBus"), low pin count (LPC) bus, serial peripheral interface ("SPI"), high definition audio ("HDA") bus, serial advanced technology attachment ("SATA") bus, USB (version 1, 2, 3), or universal asynchronous receiver / transmitter ("UART") bus. In at least one embodiment, Fig.11 A system is shown, which includes interconnected hardware devices or "chips". In at least one embodiment, Fig.11 An exemplary SoC may be shown. In at least one embodiment, Fig.11 The devices shown in can be interconnected with a proprietary interconnect, a standardized interconnect (e.g., PCIe), or some combination thereof.

[0156] In at least one embodiment, Fig.11 One or more components of the system are interconnected using Compute Express Link (CXL) interconnect lines.

[0157] In at least one embodiment, Fig.11The display 1124, touch screen 1125, touch pad 1130, near field communication unit ("NFC") 1145, sensor hub 1140, thermal sensor 1146, fast chipset ("EC") 1135, trusted platform module ("TPM") 1138, BIOS / firmware / flash memory ("BIOS, FW Flash") 1122, DSP 1160, solid state disk ("SSD") or hard disk drive ("HDD") 1120, wireless local area network unit ("WLAN") 1150, Bluetooth unit 1152, wireless wide area network unit ("WWAN") 1156, global positioning system (GPS) 1155, camera ("USB 3.0 camera") 1154 (e.g., USB 3.0 camera) or low power double data rate ("LPDDR") memory unit ("LPDDR3") 1115 implemented in, for example, the LPDDR3 standard. Each of these components can be implemented in any suitable manner.

[0158] In at least one embodiment, other components may be communicatively coupled to the processor 1110 through the components discussed above. In at least one embodiment, an accelerometer 1141, an ambient light sensor (“ALS”) 1142, a compass 1143, and a gyroscope 1144 may be communicatively coupled to the sensor hub 1140. In at least one embodiment, a thermal sensor 1139, a fan 1137, a keyboard 1136, and a touchpad 1130 may be communicatively coupled to the EC 1135. In at least one embodiment, a speaker 1163, an earphone 1164, and a microphone (“mic”) 1165 may be communicatively coupled to an audio unit (“audio codec and class D amplifier”) 1162, which in turn may be communicatively coupled to the DSP 1160. In at least one embodiment, the audio unit 1162 may include, for example, but not limited to, an audio encoder / decoder (“codec”) and a class D amplifier. In at least one embodiment, a SIM card (“SIM”) 1157 may be communicatively coupled to the WWAN unit 1156. In at least one embodiment, components such as the WLAN unit 1150 and the Bluetooth unit 1152 and the WWAN unit 1156 may be implemented as a next generation form factor (NGFF).

[0159] In at least one embodiment, Fig.11 At least one component shown or described is used to implement the invention described herein and at least in conjunction with Figures 1 to 7 In at least one embodiment, processor 1110 causes a compiler to be based on the techniques and / or functions described herein. Figure 1 The process 100 further describes the estimated performance cost of assigning registers to active scopes.

[0160] Fig.12An exemplary integrated circuit 1200 is shown in accordance with at least one embodiment. In at least one embodiment, the exemplary integrated circuit 1200 is a SoC, which may be manufactured using one or more IP cores. In at least one embodiment, the integrated circuit 1200 includes one or more application processors 1205 (e.g., CPU, DPU), at least one graphics processor 1210, and may additionally include an image processor 1215 and / or a video processor 1220, any of which may be modular IP cores. In at least one embodiment, the integrated circuit 1200 includes peripheral or bus logic, including a USB controller 1225, a UART controller 1230, an SPI / SDIO controller 1235, and an I 2 S / I 2 C controller 1240. In at least one embodiment, the integrated circuit 1200 may include a display device 1245 coupled to one or more of a high-definition multimedia interface (HDMI) controller 1250 and a mobile industry processor interface (MIPI) display interface 1255. In at least one embodiment, storage may be provided by a flash memory subsystem 1260, including flash memory and a flash memory controller. In at least one embodiment, a memory interface may be provided via a memory controller 1265 for accessing SDRAM or SRAM memory devices. In at least one embodiment, some integrated circuits also include an embedded security engine 1270.

[0161] Fig.13 A computing system 1300 is shown in accordance with at least one embodiment. In at least one embodiment, the computing system 1300 includes a processing subsystem 1301 having one or more processors 1302 and a system memory 1304 communicating via an interconnect path that may include a memory hub 1305. In at least one embodiment, the memory hub 1305 may be a separate component within a chipset component or may be integrated within the one or more processors 1302. In at least one embodiment, the memory hub 1305 is coupled to an I / O subsystem 1311 via a communication link 1306. In at least one embodiment, the I / O subsystem 1311 includes an I / O hub 1307 that may enable the computing system 1300 to receive input from one or more input devices 1308. In at least one embodiment, the I / O hub 1307 may enable a display controller, included in the one or more processors 1302, to provide output to the one or more display devices 1310A. In at least one embodiment, the one or more display devices 1310A coupled to I / O hub 1307 may include local, internal, or embedded display devices.

[0162] In at least one embodiment, the processing subsystem 1301 includes one or more parallel processors 1312 coupled to the memory hub 1305 via a bus or other communication link 1313. In at least one embodiment, the communication link 1313 can be one of many standard-based communication link technologies or protocols, such as but not limited to PCIe, or can be a communication interface or communication structure for a vendor. In at least one embodiment, the one or more parallel processors 1312 form a parallel or vector processing system in a computing concentration, which can include a large number of processing cores and / or processing clusters, such as a multi-integrated core (MIC) processor or computing unit. In at least one embodiment, the one or more parallel processors 1312 form a graphics processing subsystem that can output pixels to one of the one or more display devices 1310A coupled via the I / O hub 1307. In at least one embodiment, the one or more parallel processors 1312 can also include a display controller and display interface (not shown) to enable direct connection to one or more display devices 1310B.

[0163] In at least one embodiment, system storage unit 1314 can be connected to I / O hub 1307 to provide a storage mechanism for computing system 1300. In at least one embodiment, I / O switch 1316 can be used to provide an interface mechanism to enable connection between I / O hub 1307 and other components, such as network adapter 1318 and / or wireless network adapter 1319 that can be integrated into the platform, as well as various other devices that can be added through one or more additional devices 1320. In at least one embodiment, network adapter 1318 can be an Ethernet adapter or another wired network adapter. In at least one embodiment, wireless network adapter 1319 can include one or more of Wi-Fi, Bluetooth, NFC, or other network devices including one or more radios.

[0164] In at least one embodiment, computing system 1300 may include other components not explicitly shown, including USB or other port connections, optical storage drives, video capture devices, etc., which may also be connected to I / O hub 1307. Fig.13 The communication paths that interconnect the various components in the system can be implemented using any suitable protocol, such as a PCI (Peripheral Component Interconnect)-based protocol (e.g., PCIe), or other bus or point-to-point communication interfaces and / or protocols (e.g., NVLink high-speed interconnect or interconnect protocol).

[0165] In at least one embodiment, one or more parallel processors 1312 include circuits optimized for graphics and video processing (including, for example, video output circuits) and constitute a graphics processing unit (GPU). In at least one embodiment, one or more parallel processors 1312 include circuits optimized for general processing. In at least one embodiment, the components of the computing system 1300 can be integrated with one or more other system elements on a single integrated circuit. For example, in at least one embodiment, one or more parallel processors 1312, memory hub 1305, processor 1302, and I / O hub 1307 can be integrated into a system-on-chip (SoC) integrated circuit. In at least one embodiment, the components of the computing system 1300 can be integrated into a single package to form a system-in-package (SIP) configuration. In at least one embodiment, at least a portion of the components of the computing system 1300 can be integrated into a multi-chip module (MCM), which can be interconnected with other multi-chip modules into a modular computing system. In at least one embodiment, the I / O subsystem 1311 and the display device 1310B are omitted from the computing system 1300. In at least one embodiment, one or more parallel processors 1312 include one or more tensor memory accelerator (TMA) units capable of transferring blocks of data between global memory and shared memory. In at least one embodiment, one or more processors use or access one or more TMAs to perform bidirectional copy operations, such as from global memory to shared memory and vice versa.

[0166] In at least one embodiment, Fig.13 At least one component shown or described is used to implement the invention described herein and at least in conjunction with Figures 1 to 7 In at least one embodiment, one or more processors 1302 cause the compiler to be based on the techniques and / or functions described herein. Figure 1 The process 100 further describes the estimated performance cost of assigning registers to active scopes.

[0167] Processing system

[0168] The following figures illustrate, but are not limited to, exemplary processing systems that may be used to implement at least one embodiment.

[0169] Fig.14An accelerated processing unit ("APU") 1400 is shown in accordance with at least one embodiment. In at least one embodiment, the APU 1400 was developed by AMD, Inc. of Santa Clara, California. In at least one embodiment, the APU 1400 may be configured to execute application programs, such as CUDA programs. In at least one embodiment, the APU 1400 includes, but is not limited to, a core complex 1410, a graphics complex 1440, a fabric 1460, an I / O interface 1470, a memory controller 1480, a display controller 1492, and a multimedia engine 1494. In at least one embodiment, the APU 1400 may include, but is not limited to, any combination of any number of core complexes 1410, any number of graphics complexes 1440, any number of display controllers 1492, and any number of multimedia engines 1494. For purposes of illustration, multiple instances of similar objects are represented herein by reference numerals, where the reference numeral identifies the object and the number in parentheses identifies the desired instance.

[0170] In at least one embodiment, core complex 1410 is a CPU, graphics complex 1440 is a GPU, and APU 1400 is a processing unit that is not limited to core complex 1410 and graphics complex 1440 integrated onto a single chip. In at least one embodiment, some tasks may be assigned to core complex 1410, while other tasks may be assigned to graphics complex 1440. In at least one embodiment, core complex 1410 is configured to execute main control software associated with APU 1400, such as an operating system. In at least one embodiment, core complex 1410 is the main processor of APU 1400, which controls and coordinates the operations of other processors. In at least one embodiment, core complex 1410 issues commands that control the operations of graphics complex 1440. In at least one embodiment, core complex 1410 may be configured to execute host executable code derived from CUDA source code, and graphics complex 1440 may be configured to execute device executable code derived from CUDA source code.

[0171] In at least one embodiment, core complex 1410 includes, but is not limited to, cores 1420(1)-1420(4) and L3 cache 1430. In at least one embodiment, core complex 1410 may include, but is not limited to, any number of cores 1420 and any combination of any number and type of caches. In at least one embodiment, cores 1420 are configured to execute instructions of a particular instruction set architecture ("ISA"). In at least one embodiment, each core 1420 is a CPU core. In at least one embodiment, cores 1420 are referred to as operation units or computational units.

[0172] In at least one embodiment, each core 1420 includes, but is not limited to, a fetch / decode unit 1422, an integer execution engine 1424, a floating point execution engine 1426, and an L2 cache 1428. In at least one embodiment, the fetch / decode unit 1422 fetches instructions, decodes these instructions, generates micro-operations, and dispatches separate micro-instructions to the integer execution engine 1424 and the floating point execution engine 1426. In at least one embodiment, the fetch / decode unit 1422 can dispatch one micro-instruction to the integer execution engine 1424 and another micro-instruction to the floating point execution engine 1426 at the same time. In at least one embodiment, the integer execution engine 1424 performs, but is not limited to, integer and memory operations. In at least one embodiment, the floating point engine 1426 performs, but is not limited to, floating point and vector operations. In at least one embodiment, the fetch-decode unit 1422 dispatches micro-instructions to a single execution engine that replaces both the integer execution engine 1424 and the floating point execution engine 1426.

[0173] In at least one embodiment, each core 1420(i) may access an L2 cache 1428(i) included in the core 1420(i), where i is an integer representing a specific instance of the core 1420. In at least one embodiment, each core 1420 included in the core complex 1410(j) is connected to other cores 1420 included in the core complex 1410(j) via an L3 cache 1430(j) included in the core complex 1410(j), where j is an integer representing a specific instance of the core complex 1410. In at least one embodiment, a core 1420 included in a core complex 1410(j) may access all L3 caches 1430(j) included in the core complex 1410(j), where j is an integer representing a specific instance of the core complex 1410. In at least one embodiment, the L3 cache 1430 may include, but is not limited to, any number of slices.

[0174] In at least one embodiment, graphics complex 1440 can be configured to perform computational operations in a highly parallel manner. In at least one embodiment, graphics complex 1440 is configured to perform graphics pipeline operations, such as drawing commands, pixel operations, geometry calculations, and other operations associated with rendering an image to a display. In at least one embodiment, graphics complex 1440 is configured to perform operations that are not related to graphics. In at least one embodiment, graphics complex 1440 is configured to perform both graphics-related operations and graphics-independent operations.

[0175] In at least one embodiment, graphics complex 1440 includes, but is not limited to, any number of compute units 1450 and L2 cache 1442. In at least one embodiment, compute units 1450 share L2 cache 1442. In at least one embodiment, L2 cache 1442 is partitioned. In at least one embodiment, graphics complex 1440 includes, but is not limited to, any number of compute units 1450 and any number (including zero) and type of caches. In at least one embodiment, graphics complex 1440 includes, but is not limited to, any number of specialized graphics hardware.

[0176] In at least one embodiment, each computing unit 1450 includes, but is not limited to, any number of SIMD units 1452 and shared memory 1454. In at least one embodiment, each SIMD unit 1452 implements a SIMD architecture and is configured to perform operations in parallel. In at least one embodiment, each computing unit 1450 can execute any number of thread blocks, but each thread block is executed on a single computing unit 1450. In at least one embodiment, thread blocks include, but are not limited to, any number of execution threads. In at least one embodiment, a work group is a thread block. In at least one embodiment, each SIMD unit 1452 executes a different warp. In at least one embodiment, a warp is a group of threads (e.g., 16 threads), where each thread in a warp belongs to a single thread block and is configured to process different data sets based on a single instruction set. In at least one embodiment, a prediction can be used to disable one or more threads in a warp. In at least one embodiment, a channel is a thread. In at least one embodiment, a work item is a thread. In at least one embodiment, a wavefront is a warp. In at least one embodiment, different wavefronts in a thread block can be synchronized together and communicated via a shared memory 1454. In at least one embodiment, each compute unit 1450 includes one or more thread block clusters, where the thread block clusters enable program control of location at a greater granularity than a single thread block of a single streaming multiprocessor (SM). In at least one embodiment, thread block clusters (also referred to as "clusters") enable multiple thread blocks running concurrently across a streaming multiprocessor to synchronously and cooperatively acquire, exchange, or otherwise use data.

[0177] In at least one embodiment, fabric 1460 is a system interconnect that facilitates data and control transfers across core complex 1410, graphics complex 1440, I / O interface 1470, memory controller 1480, display controller 1492, and multimedia engine 1494. In at least one embodiment, APU 1400 may include, but is not limited to, any number and type of system interconnects in addition to or in lieu of fabric 1460 that facilitate data and control transfers across any number and type of directly or indirectly linked components that may be internal or external to APU 1400. In at least one embodiment, I / O interface 1470 represents any number and type of I / O interfaces (e.g., PCI, PCI-Extended (“PCI-X”), PCIe, Gigabit Ethernet (“GBE”), USB, etc.). In at least one embodiment, various types of peripherals are coupled to I / O interface 1470. In at least one embodiment, peripheral devices coupled to I / O interface 1470 may include, but are not limited to, a keyboard, a mouse, a printer, a scanner, a joystick or other type of game controller, a media recording device, an external storage device, a network interface card, etc.

[0178] In at least one embodiment, display controller AMD92 displays images on one or more display devices, such as liquid crystal display (LCD) devices. In at least one embodiment, multimedia engine 240 includes, but is not limited to, any number and type of multimedia-related circuits, such as video decoders, video encoders, image signal processors, etc. In at least one embodiment, memory controller 1480 facilitates data transfer between APU 1400 and unified system memory 1490. In at least one embodiment, core complex 1410 and graphics complex 1440 share unified system memory 1490.

[0179] In at least one embodiment, the APU 1400 implements a memory subsystem including, but not limited to, any number and type of memory controllers 1480 and memory devices that may be dedicated to one component or shared among multiple components (e.g., shared memory 1454). In at least one embodiment, the APU 1400 implements a cache subsystem including, but not limited to, one or more cache memories (e.g., L2 cache 1528, L3 cache 1430, and L2 cache 1442), each of which may be private to a component or shared among any number of components (e.g., core 1420, core complex 1410, SIMD unit 1452, compute unit 1450, and graphics complex 1440).

[0180] In at least one embodiment, Fig.14At least one component shown or described is used to implement the invention described herein and at least in conjunction with Figures 1 to 7 In at least one embodiment, core 1420(1) enables a compiler to be based on the techniques and / or functions described herein. Figure 1 The process 100 further describes the estimated performance cost of assigning registers to active scopes.

[0181] Fig.15 A CPU 1500 according to at least one embodiment is shown. In at least one embodiment, the CPU 1500 is developed by AMD, Inc. of Santa Clara, California. In at least one embodiment, the CPU 1500 may be configured to execute an application program. In at least one embodiment, the CPU 1500 is configured to execute a main control software, such as an operating system. In at least one embodiment, the CPU 1500 issues commands to control the operation of an external GPU (not shown). In at least one embodiment, the CPU 1500 may be configured to execute a host executable code derived from a CUDA source code, and the external GPU may be configured to execute a device executable code derived from such a CUDA source code. In at least one embodiment, the CPU 1500 includes, but is not limited to, any number of core complexes 1510, structures 1560, I / O interfaces 1570, and memory controllers 1580.

[0182] In at least one embodiment, core complex 1510 includes, but is not limited to, cores 1520(1)-1520(4) and L3 cache 1530. In at least one embodiment, core complex 1510 may include, but is not limited to, any number of cores 1520 and any combination of any number and type of caches. In at least one embodiment, core 1520 is configured to execute instructions of a specific ISA. In at least one embodiment, each core 1520 is a CPU core.

[0183] In at least one embodiment, each core 1520 includes, but is not limited to, a fetch / decode unit 1522, an integer execution engine 1524, a floating point execution engine 1526, and an L2 cache 1528. In at least one embodiment, the fetch / decode unit 1522 fetches instructions, decodes these instructions, generates micro-operations, and dispatches separate micro-instructions to the integer execution engine 1524 and the floating point execution engine 1526. In at least one embodiment, the fetch / decode unit 1522 can dispatch one micro-instruction to the integer execution engine 1524 and another micro-instruction to the floating point execution engine 1526 at the same time. In at least one embodiment, the integer execution engine 1524 performs, but is not limited to, integer and memory operations. In at least one embodiment, the floating point engine 1526 performs, but is not limited to, floating point and vector operations. In at least one embodiment, the fetch-decode unit 1522 dispatches micro-instructions to a single execution engine that replaces both the integer execution engine 1524 and the floating point execution engine 1526.

[0184] In at least one embodiment, each core 1520(i) may access an L2 cache 1528(i) included in the core 1520(i), where i is an integer representing a specific instance of the core 1520. In at least one embodiment, each core 1520 included in a core complex 1510(j) is connected to other cores 1520 in the core complex 1510(j) via an L3 cache 1530(j) included in the core complex 1510(j), where j is an integer representing a specific instance of the core complex 1510. In at least one embodiment, a core 1520 included in a core complex 1510(j) may access all L3 caches 1530(j) included in the core complex 1510(j), where j is an integer representing a specific instance of the core complex 1510. In at least one embodiment, the L3 cache 1530 may include, but is not limited to, any number of slices.

[0185] In at least one embodiment, fabric 1560 is a system interconnect that facilitates data and control transfers across core complexes 1510(1)-1510(N) (where N is an integer greater than zero), I / O interface 1570, and memory controller 1580. In at least one embodiment, CPU 1500 may include, in addition to or in lieu of fabric 1560, but is not limited to, any number and type of system interconnects that facilitate data and control transfers across any number and type of directly or indirectly linked components that may be internal or external to CPU 1500. In at least one embodiment, I / O interface 1570 represents any number and type of I / O interfaces (e.g., PCI, PCI-X, PCIe, GBE, USB, etc.). In at least one embodiment, various types of peripherals are coupled to I / O interface 1570. In at least one embodiment, peripherals coupled to I / O interface 1570 may include, but are not limited to, a display, a keyboard, a mouse, a printer, a scanner, a joystick or other type of game controller, a media recording device, an external storage device, a network interface card, and the like.

[0186] In at least one embodiment, memory controller 1580 facilitates data transfers between CPU 1500 and system memory 1590. In at least one embodiment, core complex 1510 and graphics complex 1540 share system memory 1590. In at least one embodiment, CPU 1500 implements a memory subsystem, which includes, but is not limited to, any number and type of memory controllers 1580 and memory devices that may be dedicated to one component or shared between multiple components. In at least one embodiment, CPU 1500 implements a cache subsystem, which includes, but is not limited to, one or more cache memories (e.g., L2 cache 1528 and L3 cache 1530), each of which may be private to a component or shared between any number of components (e.g., core 1520 and core complex 1510).

[0187] In at least one embodiment, Fig.15 At least one component shown or described is used to implement the invention described herein and at least in conjunction with Figures 1 to 7 In at least one embodiment, CPU 1500 causes the compiler to perform a compiler operation based on the techniques and / or functions described herein. Figure 1 The process 100 further describes the estimated performance cost of assigning registers to active scopes.

[0188] Fig.16An exemplary accelerator integrated slice 1690 according to at least one embodiment is shown. As used herein, a "slice" includes a specified portion of the processing resources of an accelerator integrated circuit. In at least one embodiment, the accelerator integrated circuit provides cache management, memory access, environment management, and interrupt management services on behalf of multiple graphics processing engines in multiple graphics acceleration modules. The graphics processing engines may each include a separate GPU. Optionally, the graphics processing engine may include different types of graphics processing engines within the GPU, such as a graphics execution unit, a media processing engine (e.g., a video encoder / decoder), a sampler, and a blit engine. In at least one embodiment, the graphics acceleration module may be a GPU with multiple graphics processing engines. In at least one embodiment, the graphics processing engines may be individual GPUs integrated on a general package, line card, or chip.

[0189] The application effective address space 1682 within the system memory 1614 stores process elements 1683. In one embodiment, the process element 1683 is stored in response to a GPU call 1681 from an application 1680 executing on the processor 1607. The process element 1683 contains the processing state of the corresponding application 1680. The work descriptor (WD) 1684 contained in the process element 1683 can be a single job requested by the application or may contain a pointer to a job queue. In at least one embodiment, the WD 1684 is a pointer to a job request queue in the application effective address space 1682.

[0190] Graphics acceleration module 1646 and / or each graphics processing engine can be shared by all or part of the processes in the system. In at least one embodiment, an infrastructure for establishing a processing state and sending WD 1684 to graphics acceleration module 1646 to start a job in a virtualized environment can be included.

[0191] In at least one embodiment, a dedicated process programming model is implemented for . In this model, a single process owns a graphics acceleration module 1646 or an individual graphics processing engine. Since the graphics acceleration module 1646 is owned by a single process, the hypervisor initializes the accelerator integrated circuit for the owning partition, and the operating system initializes the accelerator integrated circuit for the owning partition when the graphics acceleration module 1646 is allocated.

[0192] In operation, the WD acquisition unit 1691 in the accelerator integrated slice 1690 acquires the next WD 1684, which includes an indication of work to be completed by one or more graphics processing engines of the graphics acceleration module 1646. Data from the WD 1684 can be stored in registers 1645 for use by a memory management unit (MMU) 1639, an interrupt management circuit 1647, and / or an environment management circuit 1648, as shown. For example, one embodiment of the MMU 1639 includes a segment / page roaming circuit for accessing a segment / page table 1686 within an OS virtual address space 1685. The interrupt management circuit 1647 can process an interrupt event (INT) 1692 received from the graphics acceleration module 1646. When performing a graph operation, an effective address 1693 generated by the graphics processing engine is transformed into an actual address by the MMU 1639.

[0193] In one embodiment, the same register set 1645 is replicated for each graphics processing engine and / or graphics acceleration module 1646 and can be initialized by a hypervisor or operating system. Each of these replicated registers can be included in an accelerator integrated slice 1690. An exemplary register that can be initialized by a hypervisor is shown in Table 1.

[0194] Table 1 – Registers initialized by the hypervisor

[0195]

[0196]

[0197] Example registers that may be initialized by the operating system are shown in Table 2.

[0198] Table 2 – Operating System Initialization Registers

[0199]

[0200] In one embodiment, each WD 1684 is specific to a specific graphics acceleration module 1646 and / or a specific graphics processing engine. It contains all the information needed by the graphics processing engine to do its work or work, or it can be a pointer to a memory location where the application has established a command queue for the work to be done.

[0201] In at least one embodiment, Fig.16 At least one component shown or described is used to implement the invention described herein and at least in conjunction with Figures 1 to 7 In at least one embodiment, processor 1607 causes the compiler to be based on the techniques and / or functions described herein. Figure 1 The process 100 further describes the estimated performance cost of assigning registers to active scopes.

[0202] Fig.17A and Fig. 17B An exemplary graphics processor according to at least one embodiment of the present invention is shown. In at least one embodiment, any exemplary graphics processor can be manufactured using one or more IP cores. In addition to the illustrations, other logic and circuits can be included in at least one embodiment, including additional graphics processors / cores, peripheral interface controllers, or general-purpose processor cores. In at least one embodiment, the exemplary graphics processor is used in a SoC.

[0203] Fig.17A An exemplary graphics processor 1710 of a SoC integrated circuit is shown, which may be manufactured using one or more IP cores, in accordance with at least one embodiment. Fig. 17B An additional exemplary graphics processor 1740 of a SoC integrated circuit is shown, which may be manufactured using one or more IP cores, according to at least one embodiment. In at least one embodiment, Fig.17A The graphics processor 1710 is a low power graphics processor core. In at least one embodiment, Fig. 17B The graphics processor 1740 is a higher performance graphics processor core. In at least one embodiment, each graphics processor 1710, 1740 can be Fig.12 A variant of graphics processor 1210.

[0204] In at least one embodiment, the graphics processor 1710 includes a vertex processor 1705 and one or more fragment processors 1715A-1715N (e.g., 1715A, 1715B, 1715C, 1715D to 1715N-1 and 1715N). In at least one embodiment, the graphics processor 1710 can execute different shader programs via separate logic, so that the vertex processor 1705 is optimized to perform operations for the vertex shader program, while one or more fragment processors 1715A-1715N perform fragment (e.g., pixel) shading operations for fragments or pixels or shader programs. In at least one embodiment, the vertex processor 1705 performs the vertex processing stage of the 3D graphics pipeline and generates primitives and vertex data. In at least one embodiment, the fragment processors 1715A-1715N use the primitives and vertex data generated by the vertex processor 1705 to generate a frame buffer displayed on a display device. In at least one embodiment, fragment processors 1715A-1715N are optimized to execute fragment shader programs as provided in the OpenGL API, which can be used to perform similar operations as pixel shader programs provided in the Direct 3D API.

[0205] In at least one embodiment, graphics processor 1710 additionally includes one or more MMUs 1720A-1720B, caches 1725A-1725B, and circuit interconnects 1730A-1730B. In at least one embodiment, one or more MMUs 1720A-1720B provide a mapping of virtual to physical addresses for graphics processor 1710, including for vertex processor 1705 and / or fragment processors 1715A-1715N, which may reference vertex or image / texture data stored in memory in addition to vertex or image / texture data stored in one or more caches 1725A-1725B. In at least one embodiment, one or more MMUs 1720A-1720B may synchronize with other MMUs within the system, including with Fig.12 One or more MMUs associated with one or more application processors 1205, image processor 1215, and / or video processor 1220 enable each processor 1205-1220 to participate in a shared or unified virtual memory system. In at least one embodiment, one or more circuit interconnects 1730A-1730B enable graphics processor 1710 to connect to other IP cores within the SoC via an internal bus of the SoC or via a direct connection.

[0206] In at least one embodiment, graphics processor 1740 includes Fig.17A One or more MMUs 1720A-1720B, caches 1725A-1725B, and circuit interconnects 1730A-1730B of a graphics processor 1710. In at least one embodiment, a graphics processor 1740 includes one or more shader cores 1755A-1755N (e.g., 1755A, 1755B, 1755C, 1755D, 1755E, 1755F, to 1755N-1 and 1755N) that provide a unified shader core architecture in which a single core or type or core can execute all types of programmable shader code, including shader program code for implementing vertex shaders, fragment shaders, and / or compute shaders. In at least one embodiment, the plurality of shader cores may vary. In at least one embodiment, the graphics processor 1740 includes an inter-core task manager 1745 that acts as a thread dispatcher to dispatch execution threads to one or more shader cores 1755A-1755N and a tiling unit 1758 to accelerate tile operations for tile-based rendering, in which rendering operations of a scene are subdivided in image space, for example, to exploit local spatial coherence within a scene or to optimize use of internal caches.

[0207] In at least one embodiment, FIG. 17A to FIG. 17BAt least one component shown or described is used to implement the invention described herein and at least in conjunction with Figures 1 to 7 In at least one embodiment, the graphics processor 1710 enables the compiler to be based on the techniques and / or functions described herein. Figure 1 The process 100 further describes the estimated performance cost of assigning registers to active scopes.

[0208] Fig.18A 1800 according to at least one embodiment. In at least one embodiment, the graphics core 1800 may include Fig.12 In at least one embodiment, the graphics core 1800 may be Fig. 17B 1755A-1755N. In at least one embodiment, the graphics core 1800 includes a shared instruction cache 1802, a texture unit 1818, and a cache / shared memory 1820, which are common to the execution resources within the graphics core 1800. In at least one embodiment, the graphics core 1800 may include multiple slices 1801A-1801N or partitions of each core, and the graphics processor may include multiple instances of the graphics core 1800. The slices 1801A-1801N may include support logic including a local instruction cache 1804A-1804N, a thread scheduler 1806A-1806N, a thread dispatcher 1808A-1808N, and a set of registers 1810A-1810N. In at least one embodiment, slices 1801A-1801N may include a set of additional function units (AFUs) 1812A-1812N, floating point units (FPUs) 1814A-1814N, integer arithmetic logic units (ALUs) 1816A-1816N, address calculation units (ACUs) 1813A-1813N, double precision floating point units (DPFPUs) 1815A-1815N, and matrix processing units (MPUs) 1817A-1817N. In at least one embodiment, graphics core 1800 is referred to as a compute unit or an operation unit.

[0209] In one embodiment, the FPU 1814A-1814N can perform single-precision (32-bit) and half-precision (16-bit) floating-point operations, while the DPFPU 1815A-1815N can perform double-precision (64-bit) floating-point operations. In at least one embodiment, the ALU 1816A-1816N can perform variable-precision integer operations with 8-bit, 16-bit, and 32-bit precision, and can be configured for mixed-precision operations. In at least one embodiment, the MPU 1817A-1817N can also be configured for mixed-precision matrix operations, including half-precision floating-point operations and 8-bit integer operations. In at least one embodiment, the MPU 1817A-1817N can perform various matrix operations to accelerate CUDA programs, including enabling support for accelerated general matrix-to-matrix multiplication (GEMM). In at least one embodiment, the AFU 1812A-1812N can perform additional logical operations that are not supported by the floating-point or integer units, including trigonometric operations (e.g., Sine, Cosine, etc.).

[0210] Fig.18B A general purpose graphics processing unit (GPGPU) 1830 in at least one embodiment is shown. In at least one embodiment, GPGPU 1830 is highly parallel and suitable for deployment on a multi-chip module. In at least one embodiment, GPGPU 1830 can be configured to enable highly parallel computing operations to be performed by a GPU array. In at least one embodiment, GPGPU 1830 can be directly linked to other instances of GPGPU 1830 to create a multi-GPU cluster to improve the execution time for CUDA programs. In at least one embodiment, GPGPU 1830 includes a host interface 1832 to enable connection with a host processor. In at least one embodiment, host interface 1832 is a PCIe interface. In at least one embodiment, host interface 1832 can be a manufacturer-specific communication interface or communication structure. In at least one embodiment, GPGPU 1830 receives commands from a host processor and uses a global scheduler 1834 to dispatch execution threads associated with those commands to a group of computing clusters 1836A-1836H. In at least one embodiment, compute clusters 1836A-1836H share cache memory 1838. In at least one embodiment, cache memory 1838 may be used as a higher level cache for cache memories within compute clusters 1836A-1836H.

[0211] In at least one embodiment, GPGPU 1830 includes memory 1844A-1844B coupled to compute clusters 1836A-1836H via a set of memory controllers 1842A-1842B. In at least one embodiment, memory 1844A-1844B may include various types of memory devices, including dynamic random access memory (DRAM) or graphics random access memory, such as synchronous graphics random access memory (SGRAM), including graphics double data rate (GDDR) memory.

[0212] In at least one embodiment, computing clusters 1836A-1836H each include a set of graphics cores, such as Fig.18A The graphics core 1800, which may include multiple types of integer and floating point logic units, may perform computational operations at various precisions, including computations suitable for use with CUDA programs. For example, in at least one embodiment, at least a subset of the floating point units in each of the compute clusters 1836A-1836H may be configured to perform 16-bit or 32-bit floating point operations, while a different subset of the floating point units may be configured to perform 64-bit floating point operations.

[0213] In at least one embodiment, multiple instances of GPGPU 1830 may be configured to operate as a computing cluster. Computing clusters 1836A-1836H may implement any technically feasible communication technology for synchronization and data exchange. In at least one embodiment, multiple instances of GPGPU 1830 communicate through host interface 1832. In at least one embodiment, GPGPU 1830 includes an I / O hub 1839 that couples GPGPU 1830 with GPU link 1840, enabling direct connection to other instances of GPGPU 1830. In at least one embodiment, GPU link 1840 is coupled to a dedicated GPU to GPU bridge that enables communication and synchronization between multiple instances of GPGPU 1830. In at least one embodiment, GPU link 1840 is coupled to a high-speed interconnect to send and receive data to other GPGPUs or parallel processors. In at least one embodiment, multiple instances of GPGPU 1830 are located in separate data processing systems and communicate via network devices accessible via host interface 1832. In at least one embodiment, GPU link 1840 may be configured to be connected to a host processor, in addition to or in place of host interface 1832. In at least one embodiment, GPGPU 1830 may be configured to execute CUDA programs.

[0214] In at least one embodiment, FIG. 18A to FIG. 18B At least one component shown or described is used to implement the invention described herein and at least in conjunction with Figures 1 to 7In at least one embodiment, the general purpose graphics processing unit 1830 enables the compiler to be based on the techniques and / or functions described herein. Figure 1 The process 100 further describes the estimated performance cost of assigning registers to active scopes.

[0215] Fig.19A A parallel processor 1900 is shown in accordance with at least one embodiment. In at least one embodiment, various components of the parallel processor 1900 may be implemented using one or more integrated circuit devices, such as a programmable processor, an application specific integrated circuit (ASIC), or an FPGA.

[0216] In at least one embodiment, parallel processor 1900 includes parallel processing unit 1902. In at least one embodiment, parallel processing unit 1902 includes I / O unit 1904, which enables communication with other devices, including other instances of parallel processing unit 1902. In at least one embodiment, I / O unit 1904 can be directly connected to other devices. In at least one embodiment, I / O unit 1904 is connected to other devices by using a hub or switch interface (e.g., memory hub 1905). In at least one embodiment, the connection between memory hub 1905 and I / O unit 1904 forms a communication link. In at least one embodiment, I / O unit 1904 is connected to host interface 1906 and memory crossbar switch 1916, wherein host interface 1906 receives commands for performing processing operations and memory crossbar switch 1916 receives commands for performing memory operations.

[0217] In at least one embodiment, when the host interface 1906 receives the command buffer via the I / O unit 1904, the host interface 1906 can direct work operations to execute those commands to the front end 1908. In at least one embodiment, the front end 1908 is coupled with a scheduler 1910, which is configured to distribute commands or other work items to the processing array 1912. In at least one embodiment, the scheduler 1910 ensures that the processing array 1912 is properly configured and in a valid state before assigning tasks to the processing array 1912 in the processing array 1912. In at least one embodiment, the scheduler 1910 is implemented by firmware logic executed on a microcontroller. In at least one embodiment, the microcontroller-implemented scheduler 1910 can be configured to perform complex scheduling and work distribution operations at coarse and fine granularity, thereby achieving fast preemption and context switching of threads executing on the processing array 1912. In at least one embodiment, the host software can prove the workload for scheduling on the processing array 1912 through one of a plurality of graphics processing doorbells. In at least one embodiment, the workload may then be automatically distributed across the processing array 1912 by scheduler 1910 logic within a microcontroller that includes scheduler 1910 .

[0218] In at least one embodiment, the processing array 1912 may include up to "N" processing clusters (e.g., cluster 1914A, cluster 1914B, through cluster 1914N). In at least one embodiment, each cluster 1914A-1914N of the processing array 1912 may execute a large number of concurrent threads. In at least one embodiment, the scheduler 1910 may allocate work to the clusters 1914A-1914N of the processing array 1912 using a variety of scheduling and / or work allocation algorithms, which may vary depending on the workload generated by each program or type of computation. In at least one embodiment, scheduling may be handled dynamically by the scheduler 1910, or may be assisted in part by compiler logic during the compilation of program logic configured to be executed by the processing array 1912. In at least one embodiment, different clusters 1914A-1914N of the processing array 1912 may be allocated to process different types of programs or to perform different types of computations.

[0219] In at least one embodiment, the processing array 1912 can be configured to perform various types of parallel processing operations. In at least one embodiment, the processing array 1912 is configured to perform general-purpose parallel computing operations. For example, in at least one embodiment, the processing array 1912 can include logic to perform processing tasks including filtering video and / or audio data, performing modeling operations including physics operations, and performing data transformations.

[0220] In at least one embodiment, the processing array 1912 is configured to perform parallel graphics processing operations. In at least one embodiment, the processing array 1912 may include additional logic to support the execution of such graphics processing operations, including but not limited to texture sampling logic to perform texture operations, as well as tessellation logic and other vertex processing logic. In at least one embodiment, the processing array 1912 may be configured to execute shader programs related to graphics processing, such as but not limited to vertex shaders, tessellation shaders, geometry shaders, and pixel shaders. In at least one embodiment, the parallel processing unit 1902 may transfer data from the system memory via the I / O unit 1904 for processing. In at least one embodiment, during processing, the transferred data may be stored to an on-chip memory (e.g., parallel processor memory 1922) during processing and then written back to the system memory.

[0221] In at least one embodiment, when parallel processing unit 1902 is used to perform graph processing, scheduler 1910 can be configured to divide the processing workload into tasks of approximately equal size to better distribute graphics processing operations to multiple clusters 1914A-1914N of processing array 1912. In at least one embodiment, portions of processing array 1912 can be configured to perform different types of processing. For example, in at least one embodiment, a first portion can be configured to perform vertex shading and topology generation, a second portion can be configured to perform tessellation and geometry shading, and a third portion can be configured to perform pixel shading or other screen space operations to generate a rendered image for display. In at least one embodiment, intermediate data generated by one or more of clusters 1914A-1914N can be stored in a buffer to allow the intermediate data to be transferred between clusters 1914A-1914N for further processing.

[0222] In at least one embodiment, the processing array 1912 can receive processing tasks to be performed via the scheduler 1910, which receives commands defining the processing tasks from the front end 1908. In at least one embodiment, the processing tasks can include an index of the data to be processed, which can include surface (patch) data, primitive data, vertex data, and / or pixel data, as well as state parameters and commands defining how to process the data (e.g., what program to execute). In at least one embodiment, the scheduler 1910 can be configured to obtain the index corresponding to the task, or can receive the index from the front end 1908. In at least one embodiment, the front end 1908 can be configured to ensure that the processing array 1912 is configured to a valid state before starting the workload specified by the incoming command buffer (e.g., batch buffer, push buffer, etc.).

[0223] In at least one embodiment, each of the one or more instances of parallel processing unit 1902 can be coupled to parallel processor memory 1922. In at least one embodiment, parallel processor memory 1922 can be accessed via memory crossbar switch 1916, which can receive memory requests from processing array 1912 and I / O unit 1904. In at least one embodiment, memory crossbar switch 1916 can access parallel processor memory 1922 via memory interface 1918. In at least one embodiment, memory interface 1918 can include multiple partition units (e.g., partition unit 1920A, partition unit 1920B to partition unit 1920N), which can each be coupled to a portion of parallel processor memory 1922 (e.g., memory units). In at least one embodiment, the plurality of partition units 1920A-1920N are configured to be equal to the number of memory cells, such that the first partition unit 1920A has a corresponding first memory cell 1924A, the second partition unit 1920B has a corresponding memory cell 1924B, and the Nth partition unit 1920N has a corresponding Nth memory cell 1924N. In at least one embodiment, the number of partition units 1920A-1920N may not be equal to the number of memory devices.

[0224] In at least one embodiment, memory units 1924A-1924N may include various types of memory devices, including dynamic random access memory (DRAM) or graphics random access memory, such as synchronous graphics random access memory (SGRAM), including graphics double data rate (GDDR) memory. In at least one embodiment, memory units 1924A-1924N may also include 3D stacked memory, including but not limited to high bandwidth memory (HBM). In at least one embodiment, rendering targets such as frame buffers or texture maps may be stored across memory units 1924A-1924N, allowing partition units 1920A-1920N to write portions of each rendering target in parallel to efficiently use the available bandwidth of parallel processor memory 1922. In at least one embodiment, local instances of parallel processor memory 1922 may be excluded in favor of a unified memory design utilizing system memory in combination with local cache memory.

[0225] In at least one embodiment, any of the clusters 1914A-1914N of the processing array 1912 can process data to be written to any memory unit 1924A-1924N within the parallel processor memory 1922. In at least one embodiment, the memory crossbar 1916 can be configured to transmit the output of each cluster 1914A-1914N to any partition unit 1920A-1920N or another cluster 1914A-1914N, and the cluster 1914A-1914N can perform other processing operations on the output. In at least one embodiment, each cluster 1914A-1914N can communicate with the memory interface 1918 through the memory crossbar 1916 to read from or write to various external storage devices. In at least one embodiment, memory crossbar switch 1916 has connections to memory interface 1918 to communicate with I / O unit 1904, and connections to local instances of parallel processor memory 1922 to enable processing units within different processing clusters 1914A-1914N to communicate with system memory or other memory that is not local to parallel processing unit 1902. In at least one embodiment, memory crossbar switch 1916 may use virtual channels to separate traffic flows between clusters 1914A-1914N and partition units 1920A-1920N.

[0226] In at least one embodiment, multiple instances of parallel processing unit 1902 may be provided on a single plug-in card, or multiple plug-in cards may be interconnected. In at least one embodiment, different instances of parallel processing unit 1902 may be configured to interoperate, even if different instances have different numbers of processing cores, different numbers of local parallel processor memories, and / or other configuration differences. For example, in at least one embodiment, some instances of parallel processing unit 1902 may include higher precision floating point units relative to other instances. In at least one embodiment, a system incorporating one or more instances of parallel processing unit 1902 or parallel processor 1900 may be implemented in a variety of configurations and form factors, including but not limited to desktop, laptop or handheld personal computers, servers, workstations, game consoles, and / or embedded systems.

[0227] Fig.19B 1 shows a processing cluster 1994 according to at least one embodiment. In at least one embodiment, the processing cluster 1994 is included in a parallel processing unit. In at least one embodiment, the processing cluster 1994 is Fig.19AIn at least one embodiment, processing cluster 1994 can be configured to execute many threads in parallel, where the term "thread" refers to an instance of a specific program executed on a specific set of input data. In at least one embodiment, single instruction multiple data (SIMD) instruction issuance technology is used to support the parallel execution of a large number of threads without providing multiple independent instruction units. In at least one embodiment, single instruction multiple thread (SIMT) technology is used to support the parallel execution of a large number of generally synchronized threads, which uses a common instruction unit that is configured to issue instructions to a group of processing engines within each processing cluster 1994.

[0228] In at least one embodiment, the operation of the processing cluster 1994 can be controlled by a pipeline manager 1932 that assigns processing tasks to SIMT parallel processors. In at least one embodiment, the pipeline manager 1932 Fig.19A The scheduler 1910 receives instructions and manages the execution of these instructions through the graphics multiprocessor 1934 and / or the texture unit 1936. In at least one embodiment, the graphics multiprocessor 1934 is an exemplary instance of a SIMT parallel processor. However, in at least one embodiment, various types of SIMT parallel processors of different architectures may be included in the processing cluster 1994. In at least one embodiment, one or more instances of the graphics multiprocessor 1934 may be included in the processing cluster 1994. In at least one embodiment, the graphics multiprocessor 1934 may process data, and the data crossbar 1940 may be used to distribute the processed data to one of multiple possible destinations (including other shader units). In at least one embodiment, the pipeline manager 1932 may facilitate the distribution of processed data by specifying the destination of the processed data to be distributed via the data crossbar 1940.

[0229] In at least one embodiment, each graphics multiprocessor 1934 within a processing cluster 1994 may include the same set of function execution logic (e.g., arithmetic logic unit, load store unit (LSU), etc.). In at least one embodiment, the function execution logic may be configured in a pipelined manner, where new instructions may be issued before previous instructions are completed. In at least one embodiment, the function execution logic supports a variety of operations, including integer and floating point arithmetic, comparison operations, Boolean operations, shifts, and calculations of various algebraic functions. In at least one embodiment, the same functional unit hardware may be utilized to perform different operations, and any combination of functional units may be present.

[0230] In at least one embodiment, the instructions transmitted to the processing cluster 1994 constitute threads. In at least one embodiment, a group of threads executed across a group of parallel processing engines is a thread group. In at least one embodiment, the thread group executes the program on different input data. In at least one embodiment, each thread within a thread group can be assigned to a different processing engine within the graphics multiprocessor 1934. In at least one embodiment, a thread group can include fewer threads than the number of processing engines within the graphics multiprocessor 1934. In at least one embodiment, when the number of threads included in the thread group is less than the number of processing engines, one or more processing engines may be idle during the cycle that is processing the thread group. In at least one embodiment, a thread group can also include more threads than the number of processing engines within the graphics multiprocessor 1934. In at least one embodiment, when the thread group includes more threads than the number of processing engines within the graphics multiprocessor 1934, processing can be performed in consecutive clock cycles. In at least one embodiment, multiple thread groups can be executed simultaneously on the graphics multiprocessor 1934.

[0231] In at least one embodiment, graphics multiprocessor 1934 includes internal cache memory to perform load and store operations. In at least one embodiment, graphics multiprocessor 1934 can abandon the internal cache and use cache memory (e.g., L1 cache 1948) within processing cluster 1994. In at least one embodiment, each graphics multiprocessor 1934 can also access partition units (e.g., Fig.19A 1920A-1920N) that are shared between all processing clusters 1994 and can be used to transfer data between threads. In at least one embodiment, graphics multiprocessor 1934 can also access off-chip global memory, which can include one or more of local parallel processor memory and / or system memory. In at least one embodiment, any memory external to parallel processing unit 1902 can be used as global memory. In at least one embodiment, processing cluster 1994 includes multiple instances of graphics multiprocessor 1934, which can share common instructions and data that can be stored in L1 cache 1948.

[0232] In at least one embodiment, each processing cluster 1994 may include an MMU 1945 configured to map virtual addresses to physical addresses. In at least one embodiment, one or more instances of MMU 1945 may reside in Fig.19A1918. In at least one embodiment, the MMU 1945 includes a set of page table entries (PTEs) that are used to map virtual addresses to physical addresses of tiles (talk more about tiles) and optionally to cache line indices. In at least one embodiment, the MMU 1945 may include an address translation lookaside buffer (TLB) or cache that may reside within the graphics multiprocessor 1934 or L1 cache 1948 or processing cluster 1994. In at least one embodiment, the physical addresses are processed to assign surface data access locality for efficient request interleaving between partition units. In at least one embodiment, the cache line index may be used to determine whether a request for a cache line is a hit or a miss.

[0233] In at least one embodiment, the processing clusters 1994 can be configured such that each graphics multiprocessor 1934 is coupled to a texture unit 1936 to perform texture mapping operations, which may involve, for example, determining texture sample locations, reading texture data, and filtering texture data. In at least one embodiment, texture data is read from an internal texture L1 cache (not shown) or from an L1 cache within the graphics multiprocessor 1934, and texture data is retrieved from an L2 cache, local parallel processor memory, or system memory as needed. In at least one embodiment, each graphics multiprocessor 1934 outputs processed tasks to a data crossbar 1940 to provide the processed tasks to another processing cluster 1994 for further processing or to store the processed tasks in an L2 cache, local parallel processor memory, or system memory via a memory crossbar 1916. In at least one embodiment, a pre-raster operations unit (preROP) 1942 is configured to receive data from the graphics multiprocessor 1934, direct the data to a ROP unit, which may communicate with a partition unit (e.g., Fig.19A In at least one embodiment, the PreROP 1942 unit may perform optimizations for color blending, organize pixel color data, and perform address translation.

[0234] Fig.19C A graphics multiprocessor 1996 is shown according to at least one embodiment. In at least one embodiment, the graphics multiprocessor 1996 is Fig.19B1934. In at least one embodiment, the graphics multiprocessor 1996 is coupled to the pipeline manager 1932 of the processing cluster 1994. In at least one embodiment, the graphics multiprocessor 1996 has an execution pipeline that includes, but is not limited to, an instruction cache 1952, an instruction unit 1954, an address mapping unit 1956, a register file 1958, one or more GPGPU cores 1962, and one or more LSUs 1966. The GPGPU cores 1962 and the LSUs 1966 are coupled to the cache memory 1972 and the shared memory 1970 via a memory and cache interconnect 1968.

[0235] In at least one embodiment, the instruction cache 1952 receives the instruction stream to be executed from the pipeline manager 1932. In at least one embodiment, the instructions are cached in the instruction cache 1952 and dispatched for execution by the instruction unit 1954. In one embodiment, the instruction unit 1954 can dispatch instructions as thread groups (e.g., warps), assigning each thread of the thread group to a different execution unit within the GPGPU core 1962. In at least one embodiment, the instruction can access any local, shared, or global address space by specifying an address within the unified address space. In at least one embodiment, the address mapping unit 1956 can be used to transform addresses in the unified address space into different memory addresses that can be accessed by the LSU 1966.

[0236] In at least one embodiment, register file 1958 provides a set of registers for the functional units of graphics multiprocessor 1996. In at least one embodiment, register file 1958 provides temporary storage for operands for data paths connected to the functional units (e.g., GPGPU core 1962, LSU 1966) of graphics multiprocessor 1996. In at least one embodiment, register file 1958 is divided between each functional unit so that a dedicated portion of register file 1958 is allocated to each functional unit. In at least one embodiment, register file 1958 is divided between different thread groups being executed by graphics multiprocessor 1996.

[0237] In at least one embodiment, the GPGPU cores 1962 may each include an FPU and / or ALU for executing instructions of the graphics multiprocessor 1996. The GPGPU cores 1962 may be similar in architecture or the architecture may be different. In at least one embodiment, the first portion of the GPGPU core 1962 includes a single-precision FPU and an integer ALU, while the second portion of the GPGPU core includes a double-precision FPU. In at least one embodiment, the FPU may implement the IEEE 754-2008 standard for floating-point arithmetic or enable variable-precision floating-point arithmetic. In at least one embodiment, the graphics multiprocessor 1996 may additionally include one or more fixed-function or special-function units to perform specific functions, such as copying rectangles or pixel blending operations. In at least one embodiment, one or more of the GPGPU cores 1962 may also include fixed or special-function logic.

[0238] In at least one embodiment, the GPGPU core 1962 includes SIMD logic capable of executing a single instruction to multiple sets of data. In at least one embodiment, the GPGPU core 1962 can physically execute SIMD4, SIMD8 and SIMD9 instructions, and logically execute SIMD1, SIMD2 and SIMD32 instructions. In at least one embodiment, the SIMD instructions for the GPGPU core can be generated by a shader compiler at compile time, or automatically generated when executing a program written and compiled for a single program multiple data (SPMD) or SIMT architecture. In at least one embodiment, multiple threads of a program configured for a SIMT execution model can be executed by a single SIMD instruction. For example, in at least one embodiment, eight SIMT threads that perform the same or similar operations can be executed in parallel by a single SIMD8 logic unit.

[0239] In at least one embodiment, the memory and cache interconnect 1968 is an interconnect network that connects each functional unit of the graphics multiprocessor 1996 to the register file 1958 and the shared memory 1970. In at least one embodiment, the memory and cache interconnect 1968 is a crossbar interconnect that allows the LSU 1966 to implement load and store operations between the shared memory 1970 and the register file 1958. In at least one embodiment, the register file 1958 can operate at the same frequency as the GPGPU core 1962, so that the latency of data transfer between the GPGPU core 1962 and the register file 1958 is very low. In at least one embodiment, the shared memory 1970 can be used to enable communication between threads executing on the functional units within the graphics multiprocessor 1996. In at least one embodiment, the cache memory 1972 can be used as, for example, a data cache to cache texture data communicated between the functional units and the texture unit 1936. In at least one embodiment, the shared memory 1970 can also be used as a program managed cache. In at least one embodiment, in addition to automatically cached data stored in cache memory 1972, threads executing on GPGPU core 1962 may programmatically store data in shared memory.

[0240] In at least one embodiment, a parallel processor or GPGPU as described herein is communicatively coupled to a host / processor core to accelerate graphics operations, machine learning operations, pattern analysis operations, and various general-purpose GPU (GPGPU) functions. In at least one embodiment, the GPU can be communicatively coupled to the host processor / core via a bus or other interconnect (e.g., a high-speed interconnect such as PCIe or NVLink). In at least one embodiment, the GPU can be integrated with the core on the same package or chip and communicatively coupled to the core via an internal processor bus / interconnect (i.e., inside the package or chip). In at least one embodiment, regardless of the manner in which the GPU is connected, the processor core can assign work to the GPU in the form of a sequence of commands / instructions contained in the WD. In at least one embodiment, the GPU then uses dedicated circuits / logic to efficiently process these commands / instructions.

[0241] In at least one embodiment, FIG. 19A to FIG. 19C At least one component shown or described is used to implement the invention described herein and at least in conjunction with Figures 1 to 7 In at least one embodiment, the parallel processor 1900 enables the compiler to be based on the techniques and / or functions described herein. Figure 1 The process 100 further describes the estimated performance cost of assigning registers to active scopes.

[0242] Fig. 20Graphics processor 2000 is shown in accordance with at least one embodiment. In at least one embodiment, graphics processor 2000 includes ring interconnect 2002, pipeline front end 2004, media engine 2037, and graphics cores 2080A-2080N. In at least one embodiment, ring interconnect 2002 couples graphics processor 2000 to other processing units, including other graphics processors or one or more general purpose processor cores. In at least one embodiment, graphics processor 2000 is one of many processors integrated within a multi-core processing system.

[0243] In at least one embodiment, the graphics processor 2000 receives batches of commands via the ring interconnect 2002. In at least one embodiment, the input commands are interpreted by a command streamer 2003 in a pipeline front end 2004. In at least one embodiment, the graphics processor 2000 includes scalable execution logic to perform 3D geometry processing and media processing via graphics cores 2080A-2080N. In at least one embodiment, for 3D geometry processing commands, the command streamer 2003 provides the commands to a geometry pipeline 2036. In at least one embodiment, for at least some media processing commands, the command streamer 2003 provides the commands to a video front end 2034, which is coupled to a media engine 2037. In at least one embodiment, the media engine 2037 includes a video quality engine (VQE) 2030 for video and image post-processing, and a multi-format encoding / decoding (MFX) 2033 engine for providing hardware accelerated media data encoding and decoding. In at least one embodiment, geometry pipeline 2036 and media engine 2037 each generate execution threads for thread execution resources provided by at least one graphics core 2080A.

[0244] In at least one embodiment, the graphics processor 2000 includes scalable thread execution resources featuring modular graphics cores 2080A-2080N (sometimes referred to as core slices), each of which has multiple sub-cores 2050A-2050N, 2060A-2060N (sometimes referred to as core sub-slices). In at least one embodiment, the graphics processor 2000 can have any number of graphics cores 2080A to 2080N. In at least one embodiment, the graphics processor 2000 includes a graphics core 2080A having at least a first sub-core 2050A and a second sub-core 2060A. In at least one embodiment, the graphics processor 2000 is a low-power processor having a single sub-core (e.g., 2050A). In at least one embodiment, the graphics processor 2000 includes multiple graphics cores 2080A-2080N, each of which includes a group of first sub-cores 2050A-2050N and a group of second sub-cores 2060A-2060N. In at least one embodiment, each of the first sub-cores 2050A-2050N includes at least a first set of execution units (EUs) 2052A-2052N and media / texture samplers 2054A-2054N. In at least one embodiment, each of the second sub-cores 2060A-2060N includes at least a second set of execution units 2062A-2062N and samplers 2064A-2064N. In at least one embodiment, each of the sub-cores 2050A-2050N, 2060A-2060N shares a set of shared resources 2070A-2070N. In at least one embodiment, the shared resources include a shared cache memory and pixel operation logic.

[0245] In at least one embodiment, Fig. 20 At least one component shown or described is used to implement the invention described herein and at least in conjunction with Figures 1 to 7 In at least one embodiment, the graphics processor 2000 enables the compiler to be based on the techniques and / or functions described herein. Figure 1 The process 100 further describes the estimated performance cost of assigning registers to active scopes.

[0246] Fig.21A processor 2100 is shown according to at least one embodiment. In at least one embodiment, the processor 2100 may include, but is not limited to, logic circuits for executing instructions. In at least one embodiment, the processor 2100 may execute instructions, including x86 instructions, ARM instructions, special instructions for ASICs, and the like. In at least one embodiment, the processor 2110 may include registers for storing packed data, such as 64-bit wide MMXTM registers in microprocessors enabled by Intel Corporation, Santa Clara, California, using MMX technology. In at least one embodiment, MMX registers available in integer and floating point form may operate with packed data elements, which are accompanied by SIMD and streaming SIMD extension ("SSE") instructions. In at least one embodiment, 128-bit wide XMM registers associated with SSE2, SSE3, SSE4, AVX or higher versions (generally referred to as "SSEx") technology may hold such packed data operands. In at least one embodiment, the processor 2110 may execute instructions to accelerate CUAD programs.

[0247] In at least one embodiment, the processor 2100 includes an in-order front end ("front end") 2101 to fetch instructions to be executed and prepare instructions for later use in the processor pipeline. In at least one embodiment, the front end 2101 may include several units. In at least one embodiment, an instruction prefetcher 2126 fetches instructions from memory and provides the instructions to an instruction decoder 2128, which in turn decodes or interprets the instructions. For example, in at least one embodiment, the instruction decoder 2128 decodes the received instructions into one or more operations of so-called "microinstructions" or "micro-operations" (also referred to as "micro-operations" or "microinstructions") for execution. In at least one embodiment, the instruction decoder 2128 parses the instructions into opcodes and corresponding data and control fields, which can be used by the microarchitecture to perform the operations. In at least one embodiment, the trace cache 2130 can assemble the decoded microinstructions into a program-ordered sequence or trace in the microinstruction queue 2134 for execution. In at least one embodiment, when the trace cache 2130 encounters a complex instruction, the microcode ROM 2132 provides the microinstructions required to complete the operation.

[0248] In at least one embodiment, some instructions may be transformed into a single micro-operation, while other instructions may require several micro-operations to complete the entire operation. In at least one embodiment, if more than four micro-operations are required to complete an instruction, the instruction decoder 2128 may access the microcode ROM 2132 to execute the instruction. In at least one embodiment, the instruction may be decoded into a small number of micro-operations for processing at the instruction decoder 2128. In at least one embodiment, if multiple micro-operations are required to complete the operation, the instruction may be stored in the microcode ROM 2132. In at least one embodiment, the trace cache 2130 references the entry point programmable logic array ("PLA") to determine the correct micro-instruction pointer for reading the microcode sequence from the microcode ROM 2132 to complete one or more instructions according to at least one embodiment. In at least one embodiment, after the microcode ROM 2132 completes the micro-operation sequencing of the instruction, the front end 2101 of the machine may resume fetching micro-operations from the trace cache 2130.

[0249] In at least one embodiment, an out-of-order execution engine ("out-of-order engine") 2103 can prepare instructions for execution. In at least one embodiment, the out-of-order execution logic has multiple buffers to smooth and reorder the instruction stream to optimize performance when the instructions go down the pipeline and are scheduled for execution. The out-of-order execution engine 2103 includes, but is not limited to, a distributor / register renamer 2140, a memory microinstruction queue 2142, an integer / floating point microinstruction queue 2144, a memory scheduler 2146, a fast scheduler 2102, a slow / general floating point scheduler ("slow / general FP scheduler") 2104, and a simple floating point scheduler ("simple FP scheduler") 2106. In at least one embodiment, the fast scheduler 2102, the slow / general floating point scheduler 2104, and the simple floating point scheduler 2106 are also collectively referred to as "microinstruction schedulers 2102, 2104, 2106". The distributor / register renamer 2140 allocates the machine buffers and resources required for each microinstruction to execute in sequence. In at least one embodiment, the allocator / register renamer 2140 renames the logical registers into entries in the register file. In at least one embodiment, the allocator / register renamer 2140 also allocates entries for each microinstruction in one of two microinstruction queues, a memory microinstruction queue 2142 for memory operations and an integer / floating point microinstruction queue 2144 for non-memory operations, in front of the memory scheduler 2146 and the microinstruction schedulers 2102, 2104, 2106. In at least one embodiment, the microinstruction schedulers 2102, 2104, 2106 determine when the microinstructions are ready to execute based on the readiness of their slave input register operand sources and the availability of the execution resource microinstructions that need to be completed. In at least one embodiment, the fast scheduler 2102 of at least one embodiment can schedule on every half of the main clock cycle, while the slow / general floating point scheduler 2104 and the simple floating point scheduler 2106 can schedule once per main processor clock cycle. In at least one embodiment, microinstruction schedulers 2102, 2104, 2106 arbitrate between dispatch ports to schedule microinstructions for execution.

[0250] In at least one embodiment, execution block 2111 includes, but is not limited to, integer register file / branch network 2108, floating point register file / branch network ("FP register file / branch network") 2110, address generation units ("AGU") 2112 and 2114, fast arithmetic logic units ("fast ALU") 2116 and 2118, slow ALU 2120, floating point ALU ("FP") 2122, and floating point move unit ("FP move") 2124. In at least one embodiment, integer register file / branch network 2108 and floating point register file / bypass network 2110 are also referred to herein as "register files 2108, 2110". In at least one embodiment, ALUs 2112 and 2114, fast ALUs 2116 and 2118, slow ALU 2120, floating point ALU 2122, and floating point move unit 2124 are also referred to herein as "execution units 2112, 2114, 2116, 2118, 2120, 2122, and 2124." In at least one embodiment, an execution block may include, but is not limited to, any number (including zero) and type of register files, branch networks, address generation units, and execution units (in any combination).

[0251] In at least one embodiment, register files 2108, 2110 can be arranged between microinstruction schedulers 2102, 2104, 2106 and execution units 2112, 2114, 2116, 2118, 2120, 2122 and 2124. In at least one embodiment, integer register file / branch network 2108 performs integer operations. In at least one embodiment, floating point register file / branch network 2110 performs floating point operations. In at least one embodiment, each of register files 2108, 2110 can include but is not limited to a branch network that can bypass or forward the just completed result that has not yet been written to the register file to a new slave object. In at least one embodiment, register files 2108, 2110 can communicate data with each other. In at least one embodiment, integer register file / branch network 2108 can include but is not limited to two separate register files, one register file for low-order 32-bit data, and a second register file for high-order 32-bit data. In at least one embodiment, floating point register file / branch network 2110 may include, but is not limited to, 128-bit wide entries, since floating point instructions typically have operands that are 64 to 128 bits wide.

[0252] In at least one embodiment, the execution units 2112, 2114, 2116, 2118, 2120, 2122, 2124 can execute instructions. In at least one embodiment, the register files 2108, 2110 store integer and floating point data operand values ​​that the microinstructions need to execute. In at least one embodiment, the processor 2100 may include, but is not limited to, any number of execution units 2112, 2114, 2116, 2118, 2120, 2122, 2124 and combinations thereof. In at least one embodiment, the floating point ALU 2122 and the floating point move unit 2124 can perform floating point, MMX, SIMD, AVX and SSE or other operations, including specialized machine learning instructions. In at least one embodiment, the floating point ALU 2122 may include, but is not limited to, a 64-bit by 64-bit floating point divider to perform division, square root and remainder micro-operations. In at least one embodiment, floating point hardware may be used to process instructions involving floating point values. In at least one embodiment, ALU operations can be passed to fast ALUs 2116, 2118. In at least one embodiment, fast ALUs 2116, 2118 can perform fast operations with an effective delay of half a clock cycle. In at least one embodiment, most complex integer operations enter slow ALUs 2120 because slow ALUs 2120 can include, but are not limited to, integer execution hardware for long-delay type operations, such as multipliers, shifts, flag logic, and branch processing. In at least one embodiment, memory load / store operations can be performed by ALUs 2112, 2114. In at least one embodiment, fast ALUs 2116, fast ALUs 2118, and slow ALUs 2120 can perform integer operations on 64-bit data operands. In at least one embodiment, fast ALUs 2116, fast ALUs 2118, and slow ALUs 2120 can be implemented to support various data bit sizes including 16, 32, 128, 256, etc. In at least one embodiment, the floating point ALU 2122 and floating point move unit 2124 can be implemented to support a range of operands having bits of various widths. In at least one embodiment, the floating point ALU 2122 and floating point move unit 2124 can operate on 128-bit wide packed data operands in conjunction with SIMD and multimedia instructions.

[0253] In at least one embodiment, microinstruction schedulers 2102, 2104, 2106 schedule dependent operations before the parent load completes execution. In at least one embodiment, since microinstructions can be speculatively scheduled and executed in processor 2100, processor 2100 can also include logic for handling memory misses. In at least one embodiment, if the data load in the data cache misses, there may be dependent operations running in the pipeline, which temporarily prevents the scheduler from having the correct data. In at least one embodiment, a replay mechanism tracks and re-executes instructions that use incorrect data. In at least one embodiment, it may be necessary to replay dependent operations and independent operations may be allowed to complete. In at least one embodiment, the scheduler and replay mechanism of at least one embodiment of the processor may also be designed to capture instruction sequences for text string comparison operations.

[0254] In at least one embodiment, the term "register" may refer to an onboard processor storage location that can be used as part of an instruction to identify an operand. In at least one embodiment, registers may be those that can be used from outside the processor (from a programmer's perspective). In at least one embodiment, registers may not be limited to a particular type of circuit. On the contrary, in at least one embodiment, registers can store data, provide data, and perform the functions described herein. In at least one embodiment, the registers described herein can be implemented using a variety of different techniques by circuits within the processor, such as dedicated physical registers, physical registers dynamically allocated using register renaming, a combination of dedicated and dynamically allocated physical registers, etc. In at least one embodiment, integer registers store 32-bit integer data. The register file of at least one embodiment also includes eight multimedia SIMD registers for packaging data.

[0255] Fig. 22 A processor 2200 is shown according to at least one embodiment. In at least one embodiment, the processor 2200 includes, but is not limited to, one or more processor cores (cores) 2202A-2202N, an integrated memory controller 2214, and an integrated graphics processor 2208. In at least one embodiment, the processor 2200 may include additional cores up to and including the additional processor core 2202N represented by the dashed box. In at least one embodiment, each processor core 2202A-2202N includes one or more internal cache units 2204A-2204N. In at least one embodiment, each processor core may also have access to one or more shared cache units 2206. In at least one embodiment, the one or more processor cores 2202A-2202N are referred to as one or more computational units or operation units.

[0256] In at least one embodiment, the internal cache units 2204A-2204N and the shared cache unit 2206 represent a cache memory hierarchy within the processor 2200. In at least one embodiment, the cache memory units 2204A-2204N may include at least one level of instruction and data within each processor core and one or more levels of cache in a shared mid-level cache, such as L2, L3, Level 4 (L4), or other levels of cache, where the highest level of cache is classified as LLC before external memory. In at least one embodiment, cache coherency logic maintains coherency between the various cache units 2206 and 2204A-2204N.

[0257] In at least one embodiment, the processor 2200 may also include a set of one or more bus controller units 2216 and a system agent core 2210. In at least one embodiment, the one or more bus controller units 2216 manage a set of peripheral buses, such as one or more PCI or PCI Express buses. In at least one embodiment, the system agent core 2210 provides management functions for various processor components. In at least one embodiment, the system agent core 2210 includes one or more integrated memory controllers 2214 to manage access to various external memory devices (not shown).

[0258] In at least one embodiment, one or more processor cores 2202A-2202N include support for multiple threads simultaneously. In at least one embodiment, system agent core 2210 includes components for coordinating and operating processor cores 2202A-2202N during multithreaded processing. In at least one embodiment, system agent core 2210 may additionally include a power control unit (PCU) that includes logic and components to adjust one or more power states of processor cores 2202A-2202N and graphics processor 2208.

[0259] In at least one embodiment, the processor 2200 additionally includes a graphics processor 2208 to perform graphics processing operations. In at least one embodiment, the graphics processor 2208 is coupled to a shared cache unit 2206 and a system agent core 2210 including one or more integrated memory controllers 2214. In at least one embodiment, the system agent core 2210 also includes a display controller 2211 for driving the graphics processor output to one or more coupled displays. In at least one embodiment, the display controller 2211 may also be a separate module coupled to the graphics processor 2208 via at least one interconnect, or may be integrated within the graphics processor 2208.

[0260] In at least one embodiment, a ring-based interconnect unit 2212 is used to couple the internal components of the processor 2200. In at least one embodiment, alternative interconnect units may be used, such as point-to-point interconnects, switched interconnects, or other technologies. In at least one embodiment, the graphics processor 2208 is coupled to the ring interconnect 2212 via an I / O link 2213.

[0261] In at least one embodiment, I / O link 2213 represents at least one of a variety of I / O interconnects, including packaged I / O interconnects that facilitate communication between various processor components and high-performance embedded memory modules 2218 (e.g., eDRAM modules). In at least one embodiment, each of processor cores 2202A-2202N and graphics processor 2208 uses embedded memory module 2218 as a shared LLC.

[0262] In at least one embodiment, the processor cores 2202A-2202N are homogeneous cores that execute a common instruction set architecture. In at least one embodiment, the processor cores 2202A-2202N are heterogeneous in terms of ISA, wherein one or more processor cores 2202A-2202N execute a common instruction set, while one or more other processor cores 2202A-2202N execute a subset of a common instruction set or a different instruction set. In at least one embodiment, the processor cores 2202A-2202N are heterogeneous in terms of microarchitecture, wherein one or more cores with relatively high power consumption are coupled with one or more power cores with lower power consumption. In at least one embodiment, the processor 2200 can be implemented on one or more chips or as a SoC integrated circuit.

[0263] In at least one embodiment, Fig. 22 At least one component shown or described is used to implement the invention described herein and at least in conjunction with Figures 1 to 7 In at least one embodiment, the processor 2200 causes the compiler to be based on the techniques and / or functions described herein. Figure 1 The process 100 further describes the estimated performance cost of assigning registers to active scopes.

[0264] Fig.23A graphics processor core 2300 is shown in accordance with at least one described embodiment. In at least one embodiment, the graphics processor core 2300 is included within a graphics core array. In at least one embodiment, the graphics processor core 2300 (sometimes referred to as a core slice) may be one or more graphics cores within a modular graphics processor. In at least one embodiment, the graphics processor core 2300 is an example of a graphics core slice, and the graphics processors described herein may include multiple graphics core slices based on target power and performance envelopes. In at least one embodiment, each graphics core 2300 may include a fixed function block 2330 coupled to multiple sub-cores 2301A-2301F, also referred to as sub-slices, which include modular blocks of general purpose and fixed function logic.

[0265] In at least one embodiment, fixed function block 2330 includes a geometry / fixed function pipeline 2336, which may be shared by all sub-cores in graphics processor 2300, for example, in lower performance and / or lower power graphics processor implementations. In at least one embodiment, geometry / fixed function pipeline 2336 includes a 3D fixed function pipeline, a video front end unit, a thread generator and thread dispatcher, and a unified return buffer manager that manages a unified return buffer.

[0266] In at least one embodiment, the fixed function block 2330 also includes a graphics SoC interface 2337, a graphics microcontroller 2338, and a media pipeline 2339. The graphics SoC interface 2337 provides an interface between the graphics core 2300 and other processor cores in the SoC integrated circuit system. In at least one embodiment, the graphics microcontroller 2338 is a programmable subprocessor that can be configured to manage various functions of the graphics processor 2300, including thread dispatching, scheduling, and preemption. In at least one embodiment, the media pipeline 2339 includes logic that helps decode, encode, pre-process, and / or post-process multimedia data including image and video data. In at least one embodiment, the media pipeline 2339 implements media operations via requests to calculation or sampling logic within the sub-cores 2301-2301F.

[0267] In at least one embodiment, the SoC interface 2337 enables the graphics core 2300 to communicate with a general application processor core (e.g., a CPU) and / or other components within the SoC, including memory hierarchy elements such as shared LLC memory, system RAM, and / or embedded on-chip or packaged DRAM. In at least one embodiment, the SoC interface 2337 may also enable communication with fixed-function devices within the SoC (e.g., a camera imaging pipeline), and enable the use and / or implementation of global memory atomics that can be shared between the graphics core 2300 and the CPU within the SoC. In at least one embodiment, the SoC interface 2337 may also implement power management controls for the graphics core 2300 and enable interfaces between the clock domain of the graphics core 2300 and other clock domains within the SoC. In at least one embodiment, the SoC interface 2337 enables command buffers to be received from a command stream converter and a global thread dispatcher, which are configured to provide commands and instructions to each of one or more graphics cores within the graphics processor. In at least one embodiment, commands and instructions may be dispatched to media pipeline 2339 when media operations are to be performed, or may be assigned to geometry and fixed function pipelines (e.g., geometry and fixed function pipeline 2336, geometry and fixed function pipeline 2314) when graph processing operations are to be performed.

[0268] In at least one embodiment, the graphics microcontroller 2338 can be configured to perform various scheduling and management tasks for the graphics core 2300. In at least one embodiment, the graphics microcontroller 2338 can perform graph and / or compute workload scheduling on various graphics parallel engines within the execution unit (EU) arrays 2302A-2302F, 2304A-2304F in the sub-cores 2301A-2301F. In at least one embodiment, host software executing on a CPU core of a SoC including the graphics core 2300 can submit a workload to one of a plurality of graphics processor doorbells, which invokes scheduling operations on the appropriate graphics engine. In at least one embodiment, the scheduling operations include determining which workload to run next, submitting the workload to the command stream converter, preempting existing workloads running on the engine, monitoring the progress of the workload, and notifying the host software when the workload is completed. In at least one embodiment, graphics microcontroller 2338 may also facilitate low power or idle states for graphics core 2300, thereby providing graphics core 2300 with the ability to save and restore registers across low power state transitions within graphics core 2300 independent of an operating system and / or graphics driver software on the system.

[0269] In at least one embodiment, the graphics core 2300 may have more or fewer sub-cores than the sub-cores 2301A-2301F shown, up to N modular sub-cores. For each set of N sub-cores, in at least one embodiment, the graphics core 2300 may also include shared function logic 2310, shared and / or cache memory 2312, geometry / fixed function pipelines 2314, and additional fixed function logic 2316 to accelerate various graphics and compute processing operations. In at least one embodiment, the shared function logic 2310 may include logic units (e.g., samplers, math and / or inter-thread communication logic) that may be shared by each of the N sub-cores within the graphics core 2300. The shared and / or cache memory 2312 may be the LLC for the N sub-cores 2301A-2301F within the graphics core 2300, and may also be used as a shared memory accessible by multiple sub-cores. In at least one embodiment, geometry / fixed function pipeline 2314 may be included in place of geometry / fixed function pipeline 2336 within fixed function block 2330 and may include the same or similar logic units.

[0270] In at least one embodiment, the graphics core 2300 includes additional fixed function logic 2316, which may include various fixed function acceleration logic for use by the graphics core 2300. In at least one embodiment, the additional fixed function logic 2316 includes an additional geometry pipeline for use in position-only shading. In position-only shading, there are at least two geometry pipelines, and in the full geometry pipeline and the culling pipeline within the geometry / fixed function pipelines 2316, 2336, it is an additional geometry pipeline that may be included in the additional fixed function logic 2316. In at least one embodiment, the culling pipeline is a trimmed version of the full geometry pipeline. In at least one embodiment, the full pipeline and the culling pipeline can execute different instances of an application, each with a separate environment. In at least one embodiment, position-only shading can hide long culling runs for discarded triangles, so that shading can be completed earlier in some cases. For example, in at least one embodiment, the culling pipeline logic in the additional fixed function logic 2316 can execute position shaders in parallel with the main application and generally generate critical results faster than the full pipeline because the culling pipeline obtains and masks the position attributes of the vertices without having to perform rasterization and render the pixels to the frame buffer. In at least one embodiment, the culling pipeline can use the generated critical results to calculate visibility information for all triangles, regardless of whether they are culled. In at least one embodiment, the full pipeline (which in this case may be called a replay pipeline) can consume visibility information to skip culled triangles to mask only visible triangles that are ultimately passed to the rasterization stage.

[0271] In at least one embodiment, the additional fixed function logic 2316 may also include general purpose processing acceleration logic, such as fixed function matrix multiplication logic, for implementing a slowed down CUAD program.

[0272] In at least one embodiment, a set of execution resources is included within each graphics sub-core 2301A-2301F, which can be used to perform graphics, media, and compute operations in response to requests from a graphics pipeline, a media pipeline, or a shader program. In at least one embodiment, the graphics sub-core 2301A-2301F includes multiple EU arrays 2302A-2302F, 2304A-2304F, thread dispatch and inter-thread communication (TD / IC) logic 2303A-2303F, 3D (e.g., texture) samplers 2305A-2305F, media samplers 2306A-2306F, shader processors 2307A-2307F, and shared local memory (SLM) 2308A-2308F. Each of the EU arrays 2302A-2302F, 2304A-2304F includes multiple execution units, which are GUGPUs capable of servicing graphics, media, or computing operations, performing floating-point and integer / fixed-point logic operations, including graphics, media, or computing shader programs. In at least one embodiment, the TD / IC logic 2303A-2303F performs local thread dispatching and thread control operations for the execution units within the sub-core, and facilitates communication between threads executed on the execution units of the sub-core. In at least one embodiment, the 3D samplers 2305A-2305F can read data associated with textures or other 3D graphics into memory. In at least one embodiment, the 3D samplers can read texture data differently based on the configured sampling state and texture format associated with a given texture. In at least one embodiment, the media samplers 2306A-2306F can perform similar read operations based on the type and format associated with the media data. In at least one embodiment, each graphics sub-core 2301A-2301F may alternatively include a unified 3D and media sampler. In at least one embodiment, threads executing on execution units within each sub-core 2301A-2301F may utilize shared local memory 2308A-2308F within each sub-core to enable threads executing within a thread group to execute using a common pool of on-chip memory.

[0273] In at least one embodiment, Fig.23 At least one component shown or described is used to implement the invention described herein and at least in conjunction with Figures 1 to 7 In at least one embodiment, the graphics core 2300 enables the compiler to generate a graphics card based on the graphics card described herein. Figure 1 The process 100 further describes the estimated performance cost of assigning registers to active scopes.

[0274] Fig.24 A parallel processing unit ("PPU") 2400 is shown according to at least one embodiment. In at least one embodiment, the PPU 2400 is configured with machine-readable code that, if executed by the PPU 2400, causes the PPU 2400 to perform some or all of the processes and techniques described throughout this document. In at least one embodiment, the PPU 2400 is a multithreaded processor implemented on one or more integrated circuit devices, and utilizes multithreading as a latency hiding technique designed to process computer-readable instructions (also referred to as machine-readable instructions or simply instructions) executed in parallel on multiple threads. In at least one embodiment, a thread refers to an execution thread and is an instance of a group of instructions configured to be executed by the PPU 2400. In at least one embodiment, the PPU 2400 is a graphics processing unit ("GPU") configured to implement a graphics rendering pipeline for processing three-dimensional ("3D") graphics data to generate two-dimensional ("2D") image data for display on a display device (such as an LCD device). In at least one embodiment, the PPU 2400 is used to perform calculations, such as linear algebra operations and machine learning operations. Fig.24 The example parallel processor is shown for illustrative purposes only, and should be construed as a non-limiting example of a processor architecture implemented in at least one embodiment.

[0275] In at least one embodiment, one or more PPUs 2400 are configured to accelerate high performance computing (“HPC”), data center, and machine learning applications. In at least one embodiment, one or more PPUs 2400 are configured to accelerate CUDA programs. In at least one embodiment, PPU 2400 includes, but is not limited to, I / O unit 2406, front end unit 2410, scheduler unit 2412, work distribution unit 2414, hub 2416, crossbar switch (“Xbar”) 2420, one or more general processing clusters (“GPC”) 2418, and one or more partition units (“memory partition units”) 2422. In at least one embodiment, PPU 2400 is connected to a host processor or other PPU 2400 via one or more high-speed GPU interconnects (“GPU interconnects”) 2408. In at least one embodiment, PPU 2400 is connected to a host processor or other peripheral devices via a system bus or interconnect 2402. In one embodiment, PPU 2400 is connected to a local memory including one or more memory devices ("memory") 2404. In at least one embodiment, memory device 2404 includes, but is not limited to, one or more dynamic random access memory ("DRAM") devices. In at least one embodiment, one or more DRAM devices are configured and / or configurable as a high bandwidth memory ("HBM") subsystem, with multiple DRAM dies stacked within each device.

[0276] In at least one embodiment, the high-speed GPU interconnect 2408 may refer to a wire-based multi-lane communication link that the system uses to scale and includes one or more PPUs 2400 ("CPUs") in conjunction with one or more CPUs, supporting cache coherency between the PPU 2400 and the CPUs and CPU mastering. In at least one embodiment, the high-speed GPU interconnect 2408 transmits data and / or commands to other units of the PPU 2400, such as one or more copy engines, video encoders, video decoders, power management units, and / or other units in the PPU 2400 through the hub 2416. Fig.24 Other components that may not be explicitly shown.

[0277] In at least one embodiment, I / O unit 2406 is configured to receive data from a host processor ( Fig.24In at least one embodiment, the I / O unit 2406 communicates with the host processor directly through the system bus 2402 or through one or more intermediate devices (e.g., a memory bridge). In at least one embodiment, the I / O unit 2406 can communicate with one or more other processors (e.g., one or more PPUs 2400) via the system bus 2402. In at least one embodiment, the I / O unit 2406 implements a PCIe interface for communicating over a PCIe bus. In at least one embodiment, the I / O unit 2406 implements an interface for communicating with external devices.

[0278] In at least one embodiment, the I / O unit 2406 decodes packets received via the system bus 2402. In at least one embodiment, at least some of the packets represent commands configured to cause the PPU 2400 to perform various operations. In at least one embodiment, the I / O unit 2406 sends the decoded commands to various other units of the PPU 2400 as specified by the commands. In at least one embodiment, the commands are sent to the front end unit 2410 and / or to the hub 2416 or other units of the PPU 2400, such as one or more replication engines, video encoders, video decoders, power management units, etc. ( Fig.24 In at least one embodiment, I / O unit 2406 is configured to route communications between various logical units of PPU 2400.

[0279] In at least one embodiment, a program executed by a host processor encodes a command stream in a buffer that provides a workload to the PPU 2400 for processing. In at least one embodiment, the workload includes instructions and data to be processed by those instructions. In at least one embodiment, the buffer is an area in memory that is accessible (e.g., read / write) by both the host processor and the PPU 2400—the host interface unit can be configured to access the buffer in the system memory connected to the system bus 2402 via the memory request transmitted via the I / O unit 2406 through the system bus 2402. In at least one embodiment, the host processor writes the command stream to the buffer and then sends a pointer indicating the start of the command stream to the PPU 2400, so that the front end unit 2410 receives one or more command stream pointers and manages one or more command streams, reads commands from the command stream and forwards the commands to the various units of the PPU 2400.

[0280] In at least one embodiment, the front end unit 2410 is coupled to a scheduler unit 2412 that configures the various GPCs 2418 to process tasks defined by one or more command streams. In at least one embodiment, the scheduler unit 2412 is configured to track state information related to the various tasks managed by the scheduler unit 2412, where the state information may indicate which GPC 2418 the task is assigned to, whether the task is active or inactive, a priority associated with the task, etc. In at least one embodiment, the scheduler unit 2412 manages multiple tasks that are executed on one or more GPCs 2418.

[0281] In at least one embodiment, the scheduler unit 2412 is coupled to a work distribution unit 2414, which is configured to dispatch tasks for execution on the GPCs 2418. In at least one embodiment, the work distribution unit 2414 tracks a plurality of scheduled tasks received from the scheduler unit 2412 and the work distribution unit 2414 manages a pending task pool and an active task pool for each GPC 2418. In at least one embodiment, the pending task pool includes a plurality of time slots (e.g., 32 time slots) containing tasks assigned to be processed by a particular GPC 2418; the active task pool may include a plurality of time slots (e.g., 4 time slots) for tasks actively processed by the GPC 2418, such that as one of the tasks in the GPC 2418 completes execution, the task is evicted from the active task pool of the GPC 2418 and one of the other tasks is selected from the pending task pool and scheduled for execution on the GPC 2418. In at least one embodiment, if the active task is idle on GPC 2418, such as while waiting for data dependencies to be resolved, the active task is evicted from GPC 2418 and returned to the pending task pool, while another task in the pending task pool is selected and scheduled for execution on GPC 2418.

[0282] In at least one embodiment, work distribution unit 2414 communicates with one or more GPCs 2418 via XBar 2420. In at least one embodiment, XBar 2420 is an interconnect network that couples many units of PPU 2400 to other units of PPU 2400 and can be configured to couple work distribution unit 2414 to a specific GPC 2418. In at least one embodiment, other units of one or more PPU 2400 can also be connected to XBar 2420 through hub 2416.

[0283] In at least one embodiment, the tasks are managed by the scheduler unit 2412 and assigned to one of the GPCs 2418 by the work distribution unit 2414. The GPC 2418 is configured to process the tasks and produce results. In at least one embodiment, the results can be consumed by other tasks in the GPC 2418, routed to different GPCs 2418 via the XBar 2420, or stored in the memory 2404. In at least one embodiment, the results can be written to the memory 2404 via the partition unit 2422, which implements a memory interface for writing data to or reading data from the memory 2404. In at least one embodiment, the results can be transmitted to another PPU 2400 or CPU via the high-speed GPU interconnect 2408. In at least one embodiment, the PPU 2400 includes, but is not limited to, U partition units 2422, which is equal to the number of separate and different memory devices 2404 coupled to the PPU 2400.

[0284] In at least one embodiment, the host processor executes a driver core that implements an application programming interface (API) that enables one or more applications executing on the host processor to schedule operations for execution on the PPU 2400. In one embodiment, multiple computing applications are executed simultaneously by the PPU 2400, and the PPU 2400 provides isolation, quality of service (“QoS”), and independent address spaces for multiple computing applications. In at least one embodiment, the application generates instructions (e.g., in the form of API calls) that cause the driver core to generate one or more tasks for execution by the PPU 2400, and the driver core outputs the tasks to one or more streams processed by the PPU 2400. In at least one embodiment, each task includes one or more related thread groups, which may be referred to as warps. In at least one embodiment, a warp includes multiple related threads (e.g., 32 threads) that can be executed in parallel. In at least one embodiment, a cooperative thread may refer to multiple threads, including instructions for executing tasks and exchanging data through a shared memory.

[0285] In at least one embodiment, Fig.24 At least one component shown or described is used to implement the invention described herein and at least in conjunction with Figures 1 to 7 In at least one embodiment, the PPU 2400 enables the compiler to be based on the techniques and / or functions described herein. Figure 1 The process 100 further describes the estimated performance cost of assigning registers to active scopes.

[0286] Fig.25FIG. 2 shows a GPC 2500 according to at least one embodiment. In at least one embodiment, the GPC 2500 is Fig.24 2418. In at least one embodiment, each GPC 2500 includes, but is not limited to, multiple hardware units for processing tasks, and each GPC 2500 includes, but is not limited to, a pipeline manager 2502, a pre-raster operations unit ("PROP") 2504, a raster engine 2508, a work distribution crossbar ("WDX") 2516, a memory management unit ("MMU") 2518, one or more data processing clusters ("DPCs") 2506, and any suitable combination of components.

[0287] In at least one embodiment, the operation of the GPC 2500 is controlled by a pipeline manager 2502. In at least one embodiment, the pipeline manager 2502 manages the configuration of one or more DPCs 2506 to process tasks assigned to the GPC 2500. In at least one embodiment, the pipeline manager 2502 configures at least one of the one or more DPCs 2506 to implement at least a portion of a graphics rendering pipeline. In at least one embodiment, the DPC 2506 is configured to execute vertex shader programs on a programmable streaming multiprocessor (“SM”) 2514. In at least one embodiment, the pipeline manager 2502 is configured to route packets received from the work distribution unit to appropriate logic units within the GPC 2500, and in at least one embodiment, some packets may be routed to fixed function hardware units in the PROP 2504 and / or the raster engine 2508, while other packets may be routed to the DPC 2506 for processing by the primitive engine 2512 or the SM 2514. In at least one embodiment, pipeline manager 2502 configures at least one of DPCs 2506 to implement a neural network model and / or a computational pipeline. In at least one embodiment, pipeline manager 2502 configures at least one of DPCs 2506 to execute at least a portion of a CUDA program.

[0288] In at least one embodiment, PROP unit 2504 is configured to route data generated by raster engine 2508 and DPC 2506 to a raster operations ("ROP") unit in a partition unit, such as described above in conjunction with Fig.242422, etc., described in more detail. In at least one embodiment, the PROP unit 2504 is configured to perform optimizations for color blending, organize pixel data, perform address translation, and the like. In at least one embodiment, the raster engine 2508 includes, but is not limited to, a plurality of fixed-function hardware units configured to perform various raster operations, and in at least one embodiment, the raster engine 2508 includes, but is not limited to, a setup engine, a coarse raster engine, a culling engine, a clipping engine, a fine raster engine, a tile aggregation engine, and any suitable combination thereof. In at least one embodiment, the setup engine receives the transformed vertices and generates plane equations associated with the geometric primitives defined by the vertices; the plane equations are transmitted to the coarse raster engine to generate coverage information for the basic primitives (e.g., an x, y coverage mask for the tile); the output of the coarse raster engine is transmitted to the culling engine, where fragments associated with primitives that fail the z test are culled, and to the clipping engine, where fragments outside the frustum are clipped. In at least one embodiment, the clipped and culled fragments are passed to a fine raster engine to generate properties for the pixel fragments based on the plane equations generated by the setup engine. In at least one embodiment, the output of the raster engine 2508 includes fragments to be processed by any appropriate entity (e.g., by a fragment shader implemented within the DPC 2506).

[0289] In at least one embodiment, each DPC 2506 included in GPC 2500 includes, but is not limited to, an M-pipeline controller ("MPC") 2510; a primitive engine 2512; one or more SMs 2514; and any suitable combination thereof. In at least one embodiment, MPC 2510 controls the operation of DPC 2506, routing packets received from pipeline manager 2502 to appropriate units in DPC 2506. In at least one embodiment, packets associated with vertices are routed to primitive engine 2512, which is configured to fetch vertex attributes associated with the vertices from memory; conversely, packets associated with shader programs may be sent to SM 2514.

[0290] In at least one embodiment, SM 2514 includes, but is not limited to, a programmable stream processor configured to process tasks represented by multiple threads. In at least one embodiment, SM 2514 is multithreaded and configured to execute multiple threads (e.g., 32 threads) from a specific thread group simultaneously, and implements a single instruction, multiple data ("SIMD") architecture, wherein each thread in a group of threads (e.g., a warp) is configured to process different data sets based on the same instruction set. In at least one embodiment, all threads in a thread group execute the same instruction. In at least one embodiment, SM 2514 implements a single instruction, multiple thread ("SIMT") architecture, wherein each thread in a group of threads is configured to process different data sets based on the same instruction set, but wherein individual threads in a thread group are allowed to diverge during execution. In at least one embodiment, a program counter, call stack, and execution state are maintained for each warp, thereby achieving concurrency between warps and serial execution within the warp when threads in the warp diverge. In another embodiment, a program counter, call stack, and execution state are maintained for each individual thread, thereby enabling equal concurrency between all threads within and between warps. In at least one embodiment, execution state is maintained for each individual thread, and threads executing the same instruction can be converged and executed in parallel to improve efficiency. Fig.26 At least one embodiment of SM 2514 is described in more detail.

[0291] In at least one embodiment, MMU 2518 is used between GPC 2500 and memory partitioning unit (e.g., Fig.24 The MMU 2518 provides an interface between the partition unit 2422 of the memory, and provides virtual address to physical address translation, memory protection, and arbitration of memory requests. In at least one embodiment, the MMU 2518 provides one or more translation lookaside buffers ("TLBs") for performing translation of virtual addresses to physical addresses in memory.

[0292] In at least one embodiment, Fig.25 At least one component shown or described is used to implement the invention described herein and at least in conjunction with Figures 1 to 7 In at least one embodiment, the GPC 2500 enables a compiler to be based on the techniques and / or functions described herein. Figure 1 The process 100 further describes the estimated performance cost of assigning registers to active scopes.

[0293] Fig.26 Streaming multiprocessor ("SM") 2600 is shown in accordance with at least one embodiment. In at least one embodiment, SM 2600 is Fig.25SM 2514. In at least one embodiment, SM 2600 includes, but is not limited to, instruction cache 2602; one or more scheduler units 2604; register file 2608; one or more processing cores ("cores") 2610; one or more special function units ("SFUs") 2612; one or more load / store units ("LSUs") 2614; interconnect network 2616; shared memory / level 1 ("L1") cache 2618; and any suitable combination thereof. In at least one embodiment, a work distribution unit schedules tasks for execution on a general processing cluster ("GPC") of a parallel processing unit ("PPU"), and each task is assigned to a specific data processing cluster ("DPC") within a GPC, and if the task is associated with a shader program, the task is assigned to one of SM 2600. In at least one embodiment, scheduler unit 2604 receives tasks from the work distribution unit and manages instruction scheduling for one or more thread blocks assigned to SM 2600. In at least one embodiment, the scheduler unit 2604 schedules thread blocks to execute as warps of parallel threads, where each thread block is assigned at least one warp. In at least one embodiment, each warp executes a thread. In at least one embodiment, the scheduler unit 2604 manages multiple different thread blocks, assigns warps to different thread blocks, and then dispatches instructions from multiple different cooperative groups to various functional units (e.g., processing core 2610, SFU 2612, and LSU 2614) in each clock cycle. In at least one embodiment, the SM 2600 includes one or more thread block clusters, where the thread block clusters can implement program control of location at a larger granularity than a single thread block of a single streaming multiprocessor (SM). In at least one embodiment, the thread block clusters (also referred to as "clusters") enable multiple thread blocks running concurrently across a streaming multiprocessor to synchronously and cooperatively acquire, exchange, or otherwise use data.

[0294] In at least one embodiment, "cooperative groups" may refer to a programming model for organizing groups of communicating threads that allows developers to express the granularity at which threads are communicating, thereby enabling the expression of richer and more efficient parallel decompositions. In at least one embodiment, the cooperative launch API supports synchronization between thread blocks to execute parallel algorithms. In at least one embodiment, the API of the conventional programming model provides a single, simple construct for synchronizing cooperative threads: a barrier across all threads of a thread block (e.g., a syncthreads() function). However, in at least one embodiment, programmers can define thread groups at a granularity smaller than a thread block and synchronize within the defined group to achieve higher performance, design flexibility, and software reuse in the form of a collective group-wide functional interface. In at least one embodiment, cooperative groups enable programmers to explicitly define thread groups at sub-block and multi-block granularity and perform collective operations, such as synchronizing threads in a cooperative group. In at least one embodiment, the sub-block granularity is as small as a single thread. In at least one embodiment, the programming model supports clean composition across software boundaries, so that libraries and utility functions can be safely synchronized in their local environment without having to make assumptions about convergence. In at least one embodiment, the cooperation group primitives enable new patterns of cooperative parallelism, including but not limited to producer-consumer parallelism, opportunistic parallelism, and global synchronization over an entire grid of thread blocks.

[0295] In at least one embodiment, the dispatch unit 2606 is configured to send instructions to one or more of the functional units, and the scheduler unit 2604 includes but is not limited to two dispatch units 2606 that enable two different instructions from the same thread warp to be dispatched per clock cycle. In at least one embodiment, each scheduler unit 2604 includes a single dispatch unit 2606 or additional dispatch units 2606.

[0296] In at least one embodiment, each SM 2600 includes, in at least one embodiment, but is not limited to, a register file 2608 that provides a set of registers for the functional units of the SM 2600. In at least one embodiment, the register file 2608 is divided between each functional unit, so that a dedicated portion of the register file 2608 is allocated to each functional unit. In at least one embodiment, the register file 2608 is divided between different thread warps executed by the SM 2600, and the register file 2608 provides temporary storage for operands of the data paths connected to the functional units. In at least one embodiment, each SM 2600 includes, but is not limited to, a plurality of L processing cores 2610. In at least one embodiment, the SM 2600 includes, but is not limited to, a large number (e.g., 128 or more) of different processing cores 2610. In at least one embodiment, each processing core 2610 includes, in at least one embodiment, but is not limited to, a fully pipelined, single-precision, double-precision, and / or mixed-precision processing unit, including, but not limited to, a floating-point arithmetic logic unit and an integer arithmetic logic unit. In at least one embodiment, the floating-point arithmetic logic unit implements the IEEE 754-2008 standard for floating-point arithmetic. In at least one embodiment, processing core 2610 includes, but is not limited to, 64 single precision (32-bit) floating point cores, 64 integer cores, 32 double precision (64-bit) floating point cores, and 8 tensor cores.

[0297] In at least one embodiment, the tensor core is configured to perform matrix operations. In at least one embodiment, one or more tensor cores are included in the processing core 2610. In at least one embodiment, the tensor core is configured to perform deep learning matrix arithmetic, such as convolution operations for neural network training and reasoning. In at least one embodiment, each tensor core operates on a 4×4 matrix and performs a matrix multiplication and accumulation operation D=A×B+C, where A, B, C, and D are 4×4 matrices.

[0298] In at least one embodiment, the matrix multiplication inputs A and B are 16-bit floating point matrices, and the accumulation matrices C and D are 16-bit floating point or 32-bit floating point matrices. In at least one embodiment, the tensor core performs a 32-bit floating point accumulation operation on the 16-bit floating point input data. In at least one embodiment, the 16-bit floating point multiplication uses 64 operations and obtains a full-precision product, which is then accumulated with other intermediate products using 32-bit floating point addition to perform a 4x4x4 matrix multiplication. In at least one embodiment, the tensor core is used to perform larger two-dimensional or higher-dimensional matrix operations composed of these smaller elements. In at least one embodiment, an API (such as a CUDA-C++ API) exposes specialized matrix loads, matrix multiplications and accumulations, and matrix storage operations to efficiently use tensor cores from CUDA-C++ programs. In at least one embodiment, at the CUDA level, the warp level interface assumes a 16×16 size matrix across all 32 warp threads.

[0299] In at least one embodiment, each SM 2600 includes, but is not limited to, M SFUs 2612 that perform special functions (e.g., attribute evaluation, reciprocal square root, etc.). In at least one embodiment, the SFUs 2612 include, but are not limited to, tree traversal units configured to traverse a hierarchical tree data structure. In at least one embodiment, the SFUs 2612 include, but are not limited to, texture units configured to perform texture map filtering operations. In at least one embodiment, the texture units are configured to load texture maps (e.g., 2D arrays of texture pixels) from memory and sample the texture maps to produce sampled texture values ​​for use by shader programs executed by the SM 2600. In at least one embodiment, the texture maps are stored in a shared memory / L1 cache 2618. In at least one embodiment, the texture units implement texture operations (such as filtering operations) using mip-maps (e.g., texture maps with different levels of detail). In at least one embodiment, each SM 2600 includes, but is not limited to, two texture units.

[0300] In at least one embodiment, each SM 2600 includes, but is not limited to, N LSUs 2614 that implement load and store operations between shared memory / L1 cache 2618 and register file 2608. In at least one embodiment, each SM 2600 includes, but is not limited to, an interconnect network 2616 that connects each functional unit to register file 2608, and the LSUs 2614 connect to register file 2608 and shared memory / L1 cache 2618. In at least one embodiment, the interconnect network 2616 is a crossbar switch that can be configured to connect any functional unit to any register in register file 2608, and to connect the LSUs 2614 to memory locations in register file 2608 and shared memory / L1 cache 2618.

[0301] In at least one embodiment, the shared memory / L1 cache 2618 is an array of on-chip memory that allows data storage and communication between the SM 2600 and the primitive engines and between threads in the SM 2600 in at least one embodiment. In at least one embodiment, the shared memory / L1 cache 2618 includes, but is not limited to, a storage capacity of 128KB and is located in the path from the SM 2600 to the partition unit. In at least one embodiment, the shared memory / L1 cache 2618 is used in at least one embodiment for caching reads and writes. In at least one embodiment, one or more of the shared memory / L1 cache 2618, the L2 cache, and the memory is a backing store.

[0302] In at least one embodiment, data cache and shared memory functions are combined into a single memory block, providing improved performance for both types of memory access. In at least one embodiment, the capacity is used by programs that do not use the shared memory or as a cache, for example, if the shared memory is configured to use half of the capacity, the texture and load / store operations can use the remaining capacity. According to at least one embodiment, the integration within the shared memory / L1 cache 2618 enables the shared memory / L1 cache 2618 to be used as a high throughput pipeline for streaming data while providing high bandwidth and low latency access to frequently reused data. In at least one embodiment, when configured for general parallel computing, a simpler configuration can be used compared to graphics processing. In at least one embodiment, a fixed-function GPU is bypassed, thereby creating a simpler programming model. In at least one embodiment, in a general parallel computing configuration, the work distribution unit directly allocates and distributes blocks of threads to DPCs. In at least one embodiment, threads in a block execute the same program, use unique thread IDs in computations to ensure that each thread generates unique results, use SM 2600 to execute programs and perform computations, use shared memory / L1 cache 2618 to communicate between threads, and use LSU 2614 to read and write global memory through shared memory / L1 cache 2618 and memory partitioning units. In at least one embodiment, when configured for general parallel computing, SM 2600 writes commands to scheduler unit 2604 that can be used to start new work on a DPC. In at least one embodiment, SM 2600 includes one or more distributed shared memories (or distributed shared memories) that implement direct SM to SM operations across multiple SM shared memory blocks, such as load, store, and execute atomics.

[0303] In at least one embodiment, SM 2600 includes one or more asynchronous execution functions, which include a tensor memory accelerator (TMA) unit that can transfer data blocks between global memory and shared memory. In at least one embodiment, one or more processors use or access one or more TMAs to perform bidirectional copy operations, such as from global memory to shared memory and vice versa. In at least one embodiment, SM 2600 includes one or more TMAs that are asynchronously copied between thread blocks in a cluster. In at least one embodiment, SM 2600 includes one or more asynchronous transaction barriers for performing atomic data movement and synchronization. In at least one embodiment, SM 2600 includes a tensor core transformer engine, which includes software and one or more cores for accelerating transformer model training and reasoning. In at least one embodiment, the transformer of one or more tensor core transformer engines manages and dynamically selects FP8 and 16-bit calculations by replaying and scaling between FP8 and 16 bits in each layer of one or more neural networks.

[0304] In at least one embodiment, the PPU is included in or coupled to a desktop computer, a laptop computer, a tablet computer, a server, a supercomputer, a smartphone (e.g., wireless, handheld device), a PDA, a digital camera, a vehicle, a head mounted display, a handheld electronic device, etc. In at least one embodiment, the PPU is implemented on a single semiconductor substrate. In at least one embodiment, the PPU is included in a system on a chip ("SoC") along with one or more other devices (e.g., additional PPUs, memory, a RISC CPU, an MMU, a digital-to-analog converter ("DAC"), etc.).

[0305] In at least one embodiment, the PPU may be included on a graphics card that includes one or more storage devices. The graphics card may be configured to connect to a PCIe slot on a desktop computer motherboard. In at least one embodiment, the PPU may be an integrated GPU ("iGPU") included in a chipset of the motherboard.

[0306] In at least one embodiment, Fig.26 At least one component shown or described is used to implement the invention described herein and at least in conjunction with Figures 1 to 7 In at least one embodiment, the streaming multiprocessor 2600 enables the compiler to be based on the techniques and / or functions described herein. Figure 1 The process 100 further describes the estimated performance cost of assigning registers to active scopes.

[0307] Software Construction for General Computing

[0308] The following figures illustrate, but are not limited to, exemplary software configurations for implementing at least one embodiment.

[0309] Fig. 27 A software stack for a programming platform according to at least one embodiment is shown. In at least one embodiment, a programming platform is a platform for utilizing hardware on a computing system to accelerate computing tasks. In at least one embodiment, a software developer can access the programming platform through libraries, compiler instructions, and / or extensions to a programming language. In at least one embodiment, the programming platform can be, but is not limited to, CUDA, Radeon Open Compute Platform ("ROCm"), OpenCL (OpenCL developed by Khronosgroup), TM ), SYCL, or Intel One API.

[0310] In at least one embodiment, the software stack 2700 of the programming platform provides an execution environment for the application 2701. In at least one embodiment, the application 2701 may include any computer software that can be launched on the software stack 2700. In at least one embodiment, the application 2701 may include, but is not limited to, artificial intelligence ("AI") / machine learning ("ML") applications, high performance computing ("HPC") applications, virtual desktop infrastructure ("VDI"), or data center workloads.

[0311] In at least one embodiment, the application 2701 and the software stack 2700 run on the hardware 2707. In at least one embodiment, the hardware 2707 may include one or more GPUs, CPUs, FPGAs, AI engines, and / or other types of computing devices that support programming platforms. In at least one embodiment, for example, using CUDA, the software stack 2700 may be vendor-specific and only compatible with devices from a specific vendor. In at least one embodiment, for example, in using OpenCL, the software stack 2700 can be used with devices from different vendors. In at least one embodiment, the hardware 2707 includes a host connected to one or more devices, which can be accessed via an application programming interface (API) call to perform computing tasks. In at least one embodiment, compared to the host in the hardware 2707, it may include but is not limited to a CPU (but may also include a computing device) and its memory, and the devices in the hardware 2707 may include but are not limited to a GPU, FPGA, AI engine or other computing device (but may also include a CPU) and its memory.

[0312] In at least one embodiment, the software stack 2700 of the programming platform includes, but is not limited to, multiple libraries 2703, runtime 2705, and device kernel drivers 2706. In at least one embodiment, each of the libraries 2703 may include data and programming code that can be used by a computer program and utilized during software development. In at least one embodiment, the library 2703 may include, but is not limited to, pre-written code and subroutines, classes, values, type specifications, configuration data, documentation, help data, and / or message templates. In at least one embodiment, the library 2703 includes functions optimized for execution on one or more types of devices. In at least one embodiment, the library 2703 may include, but is not limited to, functions for performing math, deep learning, and / or other types of operations on the device. In at least one embodiment, the library 2703 is associated with a corresponding API 2702, which may include one or more APIs that expose functions implemented in the library 2703. In at least one embodiment, a processor (e.g., a CPU, a GPU) executes, calls, or otherwise uses one or more APIs to prioritize the kernel. For example, a first kernel (e.g., a parent kernel) can launch a second kernel (e.g., a child kernel), and the second kernel can be used by the processor to launch additional kernels (e.g., grandchild kernels) independently of the first kernel. In at least one embodiment, the processor executes an API or calls an API from memory to execute to support dynamic stream priorities (e.g., updating priorities while a stream is being used to perform an operation). For example, when the processor executes the API, it allows a programmer to copy stream priorities from one stream to one or more other streams.

[0313] In at least one embodiment, the software stack 2700 includes an API to support dynamic stream priorities (e.g., updating the priority when the stream is used to perform an operation), which allows the programmer to set the priority of the stream at any time after creation. In at least one embodiment, the software stack 2700 includes an API to support dynamic stream priorities (e.g., updating the priority when the stream is used to perform an operation), which allows the programmer to obtain the current priority of the stream, where the priority is one of multiple attributes of the stream. In at least one embodiment, the software stack 2700 includes an API to support dynamic stream priorities (e.g., updating the priority when the stream is used to perform an operation), which allows the programmer to obtain the current priority of the stream as a single attribute. In at least one embodiment, the software stack 2700 includes an API to support dynamic stream priorities (e.g., updating the priority while the stream is used to perform an operation), which allows the programmer to launch the kernel to perform operations on the stream at a set priority, which may be different from the stream priority. In at least one embodiment, the software stack 2700 includes an API that indicates whether an object (e.g., a thread synchronization object such as a barrier) that tracks whether all data movement operations for a set of threads operating on a GPU are completed with a specified state after a specified time period, where the specified state can be a state indicating that the data has been moved and is ready for use, and is specified using an expected parity value as an input to the API.

[0314] In at least one embodiment, the software stack 2700 includes one or more APIs for updating the kernel. In at least one embodiment, the processor executes the API or calls the API from the memory to be executed to update the existing API to support context-free kernels, which allows programmers to add kernel nodes to the graph without a graphics context so that the graphics context can be dynamically associated with the kernel at runtime. In at least one embodiment, the software stack 2700 includes one or more APIs to allow programmers to obtain the kernel identifier and the graphics context from the kernel node as separate parameters, so that parameters are obtained from the kernel and from the context-free kernel. In at least one embodiment, the software stack 2700 includes one or more APIs for launching a task graph (e.g., a task graph) and executing one or more task graphs (e.g., including one or more programs) using a parallel processor (such as one or more graphics processing units).

[0315] In at least one embodiment, the software stack 2700 includes one or more APIs for associating one or more instructions with one or more memory ordering operations (such as fence or memory barrier (membar) operations). In at least one embodiment, the instructions are associated with one or more domains so that the memory ordering operations are performed in association with one or more specific domains without interfering with instructions of other domains. An API that indicates that a thread has reached (e.g., at a thread synchronization barrier) or completed a work phase associated with an asynchronous data movement operation on the GPU. In at least one embodiment, the software stack 2700 includes one or more to allow the programmer to manually indicate an expected transaction count when a thread has completed a work phase, which is used to update an object that tracks whether all data movement operations for a group of threads are completed.

[0316] In at least one embodiment, the application 2701 is written as source code that is compiled into executable code as follows: Figure 32-34 2701. In at least one embodiment, the executable code of the application 2701 can be run at least in part on an execution environment provided by the software stack 2700. In at least one embodiment, during the execution of the application 2701, code that needs to be run on the device (as opposed to the host) can be obtained. In this case, in at least one embodiment, the runtime 2705 can be called to load and start the necessary code on the device. In at least one embodiment, the runtime 2705 can include any technically feasible runtime system that can support the execution of the application 2701.

[0317] In at least one embodiment, runtime 2705 is implemented as one or more runtime libraries associated with a corresponding API (which is shown as API 2704). In at least one embodiment, one or more such runtime libraries may include, but are not limited to, functions for memory management, execution control, device management, error handling, and / or synchronization, etc. In at least one embodiment, memory management functions may include, but are not limited to, functions for allocating, deallocating, and copying device memory and transferring data between host memory and device memory. In at least one embodiment, execution control functions may include, but are not limited to, functions for launching functions on a device (sometimes referred to as "kernels" when the function is a global function callable from the host), and functions for setting property values ​​in buffers maintained by the runtime library for a given function to be executed on the device.

[0318] In at least one embodiment, the runtime library and corresponding API 2704 may be implemented in any technically feasible manner. In at least one embodiment, one (or any number of) APIs may expose a low-level set of functions for fine-grained control of a device, while another (or any number of) APIs may expose such a higher-level set of functions. In at least one embodiment, a high-level runtime API may be built on top of the low-level APIs. In at least one embodiment, one or more runtime APIs may be language-specific APIs layered on top of a language-independent runtime API.

[0319] In at least one embodiment, one or more processors disclosed in the “processing system” may execute, access, or otherwise use the software stack 2700. For example, the APU 1400, the CPU 1500, the 17A-17B exemplary graphics processor, the general purpose graphics processing unit (“GPGPU”) 1830, the parallel processor 1900, the processing cluster 1994, the graphics processor 1934, the graphics processor 1996, the graphics processor 2000, the processor 2100, the processor 2200, the parallel processing unit (“PPU”) 2400, the GPC 2500, and / or the streaming multiprocessor (“SM”) 2600 may execute, use, call, or otherwise implement (e.g., by accessing memory) one or more APIs included in the software stack 2700.

[0320] In at least one embodiment, the device kernel driver 2706 is configured to facilitate communication with the underlying device. In at least one embodiment, the device kernel driver 2706 can provide APIs such as API 2704 and / or low-level functions that other software relies on. In at least one embodiment, the device kernel driver 2706 can be configured to compile the intermediate representation ("IR") code into binary code at runtime. In at least one embodiment, for CUDA, the device kernel driver 2706 can compile non-hardware-specific parallel thread execution ("PTX") IR code into binary code (cache compiled binary code) for a specific target device at runtime, which is sometimes also referred to as "final" code. In at least one embodiment, doing so can allow the final code to run on the target device, which may not exist when the source code is initially compiled into PTX code. Alternatively, in at least one embodiment, the device source code can be compiled into binary code offline without the need for the device kernel driver 2706 to compile the IR code at runtime.

[0321] In at least one embodiment, Fig. 27 At least one component shown or described is used to implement the invention described herein and at least in conjunction with Figures 1 to 7In at least one embodiment, the execution of application 2701 causes the compiler to perform the following operations based on the techniques and / or functions described herein. Figure 1 The process 100 further describes the estimated performance cost of assigning registers to active scopes.

[0322] Fig.28 According to at least one embodiment, Fig. 27 2801. In at least one embodiment, the CUDA software stack 2800 on which the application 2801 can be launched includes a CUDA library 2803, a CUDA runtime 2805, a CUDA driver 2807, and a device kernel driver 2808. In at least one embodiment, the CUDA software stack 2800 is executed on hardware 2809, which may include a CUDA-enabled GPU developed by NVIDIA Corporation of Santa Clara, California.

[0323] In at least one embodiment, the application 2801, the CUDA runtime 2805, and the device kernel driver 2808 can respectively perform functions similar to the application 2701, the runtime 2705, and the device kernel driver 2706, and the above combination Fig. 27It is described. In at least one embodiment, the CUDA driver 2807 includes a library (libcuda.so) that implements the CUDA driver API 2806. In at least one embodiment, similar to the CUDA runtime API 2804 implemented by the CUDA runtime library (cudart), the CUDA driver API 2806 can disclose but is not limited to functions for memory management, execution control, device management, error handling, synchronization and / or graphics interoperability, etc. In at least one embodiment, the CUDA driver API 2806 is different from the CUDA runtime API 2804 in that the CUDA runtime API 2804 simplifies device code management by providing implicit initialization, context (similar to process) management, and module (similar to dynamically loaded library) management. In contrast to the high-level CUDA runtime API 2804, in at least one embodiment, the CUDA driver API 2806 is a low-level API that provides finer-grained control over the device, particularly with respect to context and module loading. In at least one embodiment, the CUDA driver API 2806 can disclose functions for context management that are not disclosed by the CUDA runtime API 2804. In at least one embodiment, the CUDA driver API 2806 is also language-independent and supports, for example, OpenCL in addition to the CUDA runtime API 2804. Furthermore, in at least one embodiment, the development libraries including the CUDA runtime 2805 can be considered separate from the driver components, including the user-mode CUDA driver 2807 and the kernel-mode device driver 2808 (sometimes also referred to as a "display" driver).

[0324] In at least one embodiment, the CUDA library 2803 may include, but is not limited to, a math library, a deep learning library, a parallel algorithm library, and / or a signal / image / video processing library, which may be utilized by parallel computing applications (e.g., application 2801). In at least one embodiment, the CUDA library 2803 may include a math library, such as the cuBLAS library, which is an implementation of the Basic Linear Algebra Subroutines ("BLAS") for performing linear algebra operations; the cuFFT library for computing fast Fourier transforms ("FFTs"), and the cuRAND library for generating random numbers, etc. In at least one embodiment, the CUDA library 2803 may include a deep learning library, such as the cuDNN library for primitives for deep neural networks and the TensorRT platform for high-performance deep learning inference, etc.

[0325] In at least one embodiment, Fig.28 At least one component shown or described is used to implement the invention described herein and at least in conjunction with Figures 1 to 7In at least one embodiment, the execution of application 2801 causes the compiler to perform the following operations based on the techniques and / or functions described herein. Figure 1 The process 100 further describes the estimated performance cost of assigning registers to active scopes.

[0326] Fig.29 According to at least one embodiment, Fig. 27 In at least one embodiment, the ROCm software stack 2900 on which the application 2901 can be launched includes a language runtime 2903, a system runtime 2905, a thunk 2907, and a ROCm kernel driver 2908. In at least one embodiment, the ROCm software stack 2900 is executed on hardware 2909, which may include a ROCm-enabled GPU developed by AMD, Inc. of Santa Clara, California.

[0327] In at least one embodiment, application 2901 may execute in conjunction with the above Fig. 27 In addition, in at least one embodiment, the language runtime 2903 and the system runtime 2905 can perform functions similar to those of the application 2701 discussed above. Fig. 27 The language runtime 2903 and the system runtime 2905 have similar functions. In at least one embodiment, the difference between the language runtime 2903 and the system runtime 2905 is that the system runtime 2905 is a language-independent runtime that implements the ROCr system runtime API 2904 and utilizes the heterogeneous system architecture ("HSA") runtime API. In at least one embodiment, the HSA runtime API is a thin user mode API that exposes interfaces for accessing and interacting with AMDGPU, including functions for memory management, execution control of kernels dispatched by the architecture, error handling, system and agent information, and runtime initialization and shutdown. In at least one embodiment, compared to the system runtime 2905, the language runtime 2903 is an implementation of a language-specific runtime API 2902 layered on top of the ROCr system runtime API 2904. In at least one embodiment, the language runtime API may include, but is not limited to, a portable heterogeneous computing interface ("HIP") language runtime API, a heterogeneous computing compiler ("HCC") language runtime API, or an OpenCL API, among others. In particular, the HIP language is an extension of the C++ programming language with a functionally similar version of the CUDA mechanism, and in at least one embodiment, the HIP language runtime API includes a combination of the above Fig.28 Functions similar to the CUDA runtime API 2804 discussed above, such as those used for memory management, execution control, device management, error handling, synchronization, etc.

[0328] In at least one embodiment, thunk (ROCt) 2907 is an interface 2906 that can be used to interact with the underlying ROCm driver 2908. In at least one embodiment, the ROCm driver 2908 is a ROCk driver, which is a combination of the AMDGPU driver and the HSA kernel driver (amdkfd). In at least one embodiment, the AMDGPU driver is a device kernel driver for GPUs developed by AMD that performs the above combined Fig. 27 The HSA kernel driver 2706 is a device kernel driver that allows different types of processors to more efficiently share system resources via hardware features.

[0329] In at least one embodiment, various libraries (not shown) may be included in the ROCm software stack 2900 above the language runtime 2903 and provide for integration with the above. Fig.28 The various libraries may include, but are not limited to, math, deep learning, and / or other libraries, such as a hipBLAS library that implements functions similar to CUDA cuBLAS, a rocFFT library similar to CUDA cuFFT for computing FFT, and the like.

[0330] In at least one embodiment, Fig.29 At least one component shown or described is used to implement the invention described herein and at least in conjunction with Figures 1 to 7 In at least one embodiment, the execution of application 2901 causes the compiler to perform the following operations based on the techniques and / or functions described herein. Figure 1 The process 100 further describes the estimated performance cost of assigning registers to active scopes.

[0331] Fig.30 According to at least one embodiment, Fig. 27 3001. In at least one embodiment, the OpenCL software stack 3000 on which the application 3001 can be launched includes an OpenCL framework 3010, an OpenCL runtime 3006, and a driver 3007. In at least one embodiment, the OpenCL software stack 3000 is executed on hardware 2809 that is not vendor-specific. In at least one embodiment, because devices developed by different vendors support OpenCL, specific OpenCL drivers may be required to interoperate with hardware from such vendors.

[0332] In at least one embodiment, the application 3001, the OpenCL runtime 3006, the device kernel driver 3007 and the hardware 3008 can respectively execute the above combined Fig. 27 The discussed applications 2701, runtime 2705, device kernel driver 2706, and hardware 2707 have similar functionality. In at least one embodiment, the application 3001 also includes an OpenCL kernel 3002 having code to be executed on the device.

[0333] In at least one embodiment, OpenCL defines a "platform" that allows a host to control devices connected to the host. In at least one embodiment, the OpenCL framework provides a platform layer API and a runtime API, shown as platform API 3003 and runtime API 3005. In at least one embodiment, the runtime API 3005 uses contexts to manage the execution of kernels on devices. In at least one embodiment, each identified device can be associated with a respective context, and the runtime API 3005 can use the context to manage the command queue, program objects and kernel objects, shared memory objects, etc. of the device. In at least one embodiment, the platform API 3003 exposes functions that allow device contexts to be used to select and initialize devices, submit work to devices via command queues, and enable data transfer from and to devices, etc. In addition, in at least one embodiment, the OpenCL framework provides various built-in functions (not shown), including mathematical functions, relational functions, image processing functions, etc.

[0334] In at least one embodiment, compiler 3004 is also included in OpenCL framework 3010. In at least one embodiment, source code can be compiled offline before executing the application or compiled online during execution of the application. In contrast to CUDA and ROCm, OpenCL applications in at least one embodiment can be compiled online by compiler 3004, which is included to represent any number of compilers that can be used to compile source code and / or IR code (e.g., Standard Portable Intermediate Representation ("SPIR-V") code) into binary code. Alternatively, in at least one embodiment, OpenCL applications can be compiled offline before executing such applications.

[0335] In at least one embodiment, Fig.30 At least one component shown or described is used to implement the invention described herein and at least in conjunction with Figures 1 to 7 In at least one embodiment, the execution of application 3001 causes the compiler to perform the following operations based on the techniques and / or functions described herein. Figure 1 The process 100 further describes the estimated performance cost of assigning registers to active scopes.

[0336] Fig.31 Software supported by a programming platform according to at least one embodiment is shown. In at least one embodiment, the programming platform 3104 is configured to support various programming models 3103, middleware and / or libraries 3102, and frameworks 3101 that the application 3100 can rely on. In at least one embodiment, the application 3100 can be an AI / ML application implemented using, for example, a deep learning framework (e.g., MXNet, PyTorch, or TensorFlow), which can rely on libraries such as cuDNN, NVIDIA Collective Communications Library ("NCCL"), and / or NVIDIA Developer Data Loading Library ("DALI") CUDA libraries to provide accelerated computing on the underlying hardware.

[0337] In at least one embodiment, programming platform 3104 can be a combination of the above Fig.28 , Fig.29 and Fig.30 One of the CUDA, ROCm, or OpenCL platforms described. In at least one embodiment, the programming platform 3104 supports multiple programming models 3103, which are abstractions of the underlying computing system that allow the expression of algorithms and data structures. In at least one embodiment, the programming model 3103 can expose features of the underlying hardware to improve performance. In at least one embodiment, the programming model 3103 can include, but is not limited to, CUDA, HIP, OpenCL, C++ Accelerated Massive Parallelism ("C++AMP"), Open Multiprocessing ("OpenMP"), Open Accelerators ("OpenACC"), and / or Vulcan Compute.

[0338] In at least one embodiment, the library and / or middleware 3102 provides an abstract implementation of the programming model 3104. In at least one embodiment, such a library includes data and programming code that can be used by a computer program and utilized during software development. In at least one embodiment, in addition to those that can be obtained from the programming platform 3104, such middleware also includes software that provides services to applications. In at least one embodiment, the library and / or middleware 3102 may include, but is not limited to, cuBLAS, cuFFT, cuRAND and other CUDA libraries, or rocBLAS, rocFFT, rocRAND and other ROCm libraries. In addition, in at least one embodiment, the library and / or middleware 3102 may include NCCL and ROCm communication collection libraries ("RCCL") libraries that provide communication routines for GPUs, MIOpen libraries for deep learning acceleration and / or intrinsic libraries for linear algebra, matrix and vector operations, geometric transformations, numerical solvers, and related algorithms.

[0339] In at least one embodiment, application framework 3101 relies on library and / or middleware 3102. In at least one embodiment, each application framework 3101 is a software framework for implementing a standard structure of application software. Returning to the AI / ML example discussed above, in at least one embodiment, AI / ML applications can be implemented using a framework such as Caffe, Caffe2, TensorFlow, Keras, PyTorch, or MxNet deep learning framework.

[0340] In at least one embodiment, Fig.31 At least one component shown or described is used to implement the invention described herein and at least in conjunction with Figures 1 to 7 In at least one embodiment, the execution of the application 3100 causes the compiler to perform the following operations based on the techniques and / or functions described herein. Figure 1 The process 100 further describes the estimated performance cost of assigning registers to active scopes.

[0341] Fig.32 Compiled code according to at least one embodiment is shown to Figure 27-303201 is executed on one of the programming platforms of . In at least one embodiment, the compiler 3201 receives source code 3200, which includes both host code and device code. In at least one embodiment, the compiler 3201 is configured to transform the source code 3200 into a host executable code 3202 for execution on the host and a device executable code 3203 for execution on the device. In at least one embodiment, the source code 3200 can be compiled offline before executing the application, or compiled online during the execution of the application. In at least one embodiment, the compiler 3201 includes or has access to one or more libraries to identify an API call sequence that executes a single fused API, where the single fused API is a combined API for two or more APIs.

[0342] In at least one embodiment, source code 3200 may include code in any programming language supported by compiler 3201, such as C++, C, Fortran, etc. In at least one embodiment, source code 3200 may be included in a single-source file having a mixture of host code and device code, and indicating the location of the device code therein. In at least one embodiment, the single-source file may be a .cu file including CUDA code or a .hip.cpp file including HIP code. Alternatively, in at least one embodiment, source code 3200 may include multiple source code files, rather than a single source file, in which host code and device code are separated.

[0343] In at least one embodiment, compiler 3201 is configured to compile source code 3200 into host executable code 3202 for execution on a host and device executable code 3203 for execution on a device. In at least one embodiment, compiler 3201 performs operations including parsing source code 3200 into an abstract system tree (AST), performing optimizations, and generating executable code. In at least one embodiment where source code 3200 includes a single source file, compiler 3201 can separate device code from host code in such a single source file, compile the device code and host code into device executable code 3203 and host executable code 3202, respectively, and link device executable code 3203 and host executable code 3202 together in a single file, as described below with respect to Fig.33 discussed in more detail.

[0344] In at least one embodiment, the host executable code 3202 and the device executable code 3203 can be in any suitable format, such as binary code and / or IR code. In the case of CUDA, in at least one embodiment, the host executable code 3202 can include native object code, and the device executable code 3203 can include code in a PTX intermediate representation. In at least one embodiment, in the case of ROCm, both the host executable code 3202 and the device executable code 3203 can include target binary code.

[0345] In at least one embodiment, Fig.32 At least one component shown or described is used to implement the invention described herein and at least in conjunction with Figures 1 to 7 In at least one embodiment, the compiler 3201 is based on the techniques and / or functions described herein. Figure 1 The process 100 further describes the estimated performance cost of assigning registers to active scopes.

[0346] Fig.33 is a compiled code according to at least one embodiment to Figure 27-30 3301 is a more detailed illustration of the execution on one of the programming platforms of . In at least one embodiment, the compiler 3301 is configured to receive the source code 3300, compile the source code 3300, and output an executable file 3310. In at least one embodiment, the source code 3300 is a single source file, such as a .cu file, a .hip.cpp file, or a file in other formats, which includes both host code and device code. In at least one embodiment, the compiler 3301 can be, but is not limited to, the NVIDIA CUDA compiler ("NVCC") for compiling CUDA code in a .cu file, or the HCC compiler for compiling HIP code in a .hip.cpp file.

[0347] In at least one embodiment, compiler 3301 includes compiler front end 3302, host compiler 3305, device compiler 3306, and linker 3309. In at least one embodiment, compiler front end 3302 is configured to separate device code 3304 from host code 3303 in source code 3300. In at least one embodiment, device code 3304 is compiled by device compiler 3306 into device executable code 3308, which may include binary code or IR code as described. In at least one embodiment, host code 3303 is separately compiled by host compiler 3305 into host executable code 3307. In at least one embodiment, for NVCC, host compiler 3305 may be, but is not limited to, a general C / C++ compiler that outputs native object code, and device compiler 3306 may be, but is not limited to, a low-level virtual machine ("LLVM")-based compiler that forks the LLVM compiler infrastructure and outputs PTX code or binary code. In at least one embodiment, for HCC, both the host compiler 3305 and the device compiler 3306 can be, but a...

Claims

1. A processor, comprising: One or more circuits for causing a first plurality of processor registers to be allocated to one or more software threads based at least in part on one or more computational performance metrics associated with the allocated second plurality of registers, wherein the computational performance metrics are measured prior to allocating the first plurality of processor registers.

2. The processor of claim 1, wherein: the first plurality of processor registers and the second plurality of processor registers being configured as one or more processor register groups, wherein each register group includes an equal number of registers; as well as The first plurality of processor registers to be allocated is based at least in part on a number of the one or more software threads to be executed in parallel.

3. The processor of claim 1, wherein the first plurality of processor registers to be allocated is based at least in part on one or more thresholds corresponding to the one or more computing performance metrics.

4. The processor of claim 1, wherein the first plurality of processor registers to be allocated is based at least in part on one or more threshold numbers of processor register sets.

5. The processor of claim 1, wherein the one or more circuits are configured to cause one or more instructions of an intermediate representation (IR) of a software program to be modified.

6. The processor of claim 1, wherein the one or more computational performance metrics include values ​​indicative of a runtime of the one or more software threads.

7. The processor of claim 1, wherein the first plurality of processor registers to be allocated is based at least in part on one or more other computing performance metrics associated with the first plurality of processor registers and to be measured prior to allocating the first plurality of processor registers.

8. A system comprising: One or more circuits for causing a first plurality of processor registers to be allocated to one or more software threads based at least in part on one or more computational performance metrics associated with the allocated second plurality of registers, wherein the computational performance metrics are measured prior to allocating the first plurality of processor registers.

9. The system of claim 8, wherein: the first plurality of processor registers and the second plurality of processor registers being configured as one or more register groups, wherein each register group includes an equal number of registers; as well as The first plurality of processor registers to be allocated is based at least in part on reducing a number of register sets to be used by the one or more software threads.

10. The system of claim 8, wherein the first plurality of processor registers to be allocated is based at least in part on one or more functions that estimate the one or more computational performance metrics.

11. The system of claim 8, wherein the first plurality of processor registers to be allocated is based at least in part on a number of processor register sets that is below one or more threshold numbers of processor register sets.

12. The system of claim 8, wherein the first plurality of processor registers to be allocated are based at least in part on a data structure separate from an interference graph corresponding to an intermediate representation (IR) of the software program.

13. The system of claim 8, wherein the one or more computing performance metrics include a value indicative of a number of overflow instructions.

14. The system of claim 8, wherein the first plurality of processor registers to be allocated is based at least in part on one or more modifications to instructions of the one or more software threads.

15. A method comprising: A first plurality of processor registers are caused to be allocated to one or more software threads based at least in part on one or more computational performance metrics associated with an allocated second plurality of registers, wherein the computational performance metrics are measured prior to allocating the first plurality of processor registers.

16. The method of claim 15, wherein: the first plurality of processor registers and the second plurality of processor registers being configured as one or more register groups, wherein each register group includes an equal number of registers; as well as The first plurality of processor registers to be allocated is based at least in part on reducing a number of register sets to be used by the one or more software threads.

17. The method of claim 15, wherein the first plurality of processor registers to be allocated is based at least in part on one or more functions that estimate the one or more computational performance metrics.

18. The method of claim 15, wherein the first plurality of processor registers to be allocated is based at least in part on one or more processor register sets required to execute the one or more software threads.

19. The method of claim 15, wherein the first plurality of processor registers to be allocated is based at least in part on reducing a number of processor registers required by the one or more software threads and exceeding one or more threshold performance values.

20. The method of claim 15, wherein the one or more computing performance metrics include one or more values ​​indicative of a number of instructions to be inserted to execute the one or more software threads.