Dynamically maintaining coherency within live ranges of direct buffers
AssigneeInternational Business Machines Corporation
InventorsTong Chen, John K. O'Brien, Tao Zhang
Life of this patent
Estimating the term…
Abstract
Reducing coherency problems in a data processing system is provided. Source code that is to be compiled is received and analyzed to identify at least one of a plurality of loops that contain a memory reference. A determination is made as to whether the memory reference is an access to a global memory that should be handled by a direct buffer. Responsive to an indication that the memory reference is an access to the global memory that should be handled by the direct buffer, the memory reference is marked for direct buffer transformation. The direct buffer transformation is then applied to the memory reference.
Claims17
A method, in a data processing system, for reducing coherency problems, the method comprising:
- receiving source code that is to be compiled;
- analyzing the source code to identify at least one loop of a plurality of loops that contain a memory reference;
- determining whether the memory reference is an access to a global memory that should be handled by a direct buffer in a local memory;
- responsive to an indication that the memory reference is an access to the global memory that should be handled by the direct buffer in the local memory, marking the memory reference for direct buffer transformation;
- applying the direct buffer transformation to the memory reference in order for at least one direct buffer to be created in the local memory for storing the memory reference;
- responsive to receiving one or more buffer allocation requests for the at least one loop during execution of the compiled and optimized code, determining whether a direct buffer allocation check request has been received indicating that all buffer allocation requests have been received;
- responsive to receiving the direct buffer allocation check request, determining whether any access ranges of the one or more buffer allocation requests overlap with each other;
- and
- responsive to none of the access ranges of the one or more buffer allocation requests overlapping with each other, allocating contiguous space in the local memory for each direct buffer recorded in a buffer directory data structure in the local memory corresponding to each buffer allocation request.
A computer program product comprising a computer recordable medium having a computer readable program recorded thereon, wherein the computer readable program, when executed on a computing device, causes the computing device to:
- receive source code that is to be compiled;
- analyze the source code to identify at least one loop of a plurality of loops that contain a memory reference;
- determine whether the memory reference is an access to a global memory that should be handled by a direct buffer in a local memory;
- responsive to an indication that the memory reference is an access to the global memory that should be handled by the direct buffer in the local memory, mark the memory reference for direct buffer transformation;
- apply the direct buffer transformation to the memory reference in order for at least one direct buffer to be created in the local memory for storing the memory reference;
- responsive to receiving one or more buffer allocation requests for the at least one loop during execution of the compiled and optimized code, determine whether a direct buffer allocation check request has been received indicating that all buffer allocation requests have been received;
- responsive to receiving the direct buffer allocation check request, determine whether any access ranges of the one or more buffer allocation requests overlap with each other;
- and
- responsive to none of the access ranges of the one or more buffer allocation requests overlapping with each other, allocate contiguous space in the local memory for each direct buffer recorded in a buffer directory data structure in the local memory corresponding to each buffer allocation request.
An apparatus, comprising:
- a processor;
- and
- a memory coupled to the processor, wherein the memory comprises instructions which, when executed by the processor, cause the processor to:
- receive source code that is to be compiled;
- analyze the source code to identify at least one loop of a plurality of loops that contain a memory reference;
- determine whether the memory reference is an access to a global memory that should be handled by a direct buffer in a local memory;
- responsive to an indication that the memory reference is an access to the global memory that should be handled by the direct buffer in a local memory, mark the memory reference for direct buffer transformation;
- apply the direct buffer transformation to the memory reference in order for at least one direct buffer to be created in the local memory for storing the memory reference;
- responsive to receiving one or more buffer allocation requests for the at least one loop during execution of the compiled and optimized code, determine whether a direct buffer allocation check request has been received indicating that all buffer allocation requests have been received;
- responsive to receiving the direct buffer allocation check request, determine whether any access ranges of the one or more buffer allocation requests overlap with each other;
- and
- responsive to none of the access ranges of the one or more buffer allocation requests overlapping with each other, allocate contiguous space in the local memory for each direct buffer recorded in a buffer directory data structure in the local memory corresponding to each buffer allocation request.
Dependencies are inferred from the claim text.