US10387994B2 - Automatically enabling a read-only cache in a language in which two arrays in two different variables may alias each other - Google Patents

Automatically enabling a read-only cache in a language in which two arrays in two different variables may alias each other Download PDF

Info

Publication number
US10387994B2
US10387994B2 US15/792,822 US201715792822A US10387994B2 US 10387994 B2 US10387994 B2 US 10387994B2 US 201715792822 A US201715792822 A US 201715792822A US 10387994 B2 US10387994 B2 US 10387994B2
Authority
US
United States
Prior art keywords
variable
read
cache
aliased
code
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Expired - Fee Related, expires
Application number
US15/792,822
Other versions
US20180047134A1 (en
Inventor
Kazuaki Ishizaki
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
International Business Machines Corp
Original Assignee
International Business Machines Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by International Business Machines Corp filed Critical International Business Machines Corp
Priority to US15/792,822 priority Critical patent/US10387994B2/en
Assigned to INTERNATIONAL BUSINESS MACHINES CORPORATION reassignment INTERNATIONAL BUSINESS MACHINES CORPORATION ASSIGNMENT OF ASSIGNORS INTEREST (SEE DOCUMENT FOR DETAILS). Assignors: ISHIZAKI, KAZUAKI
Publication of US20180047134A1 publication Critical patent/US20180047134A1/en
Application granted granted Critical
Publication of US10387994B2 publication Critical patent/US10387994B2/en
Expired - Fee Related legal-status Critical Current
Adjusted expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06TIMAGE DATA PROCESSING OR GENERATION, IN GENERAL
    • G06T1/00General purpose image data processing
    • G06T1/60Memory management
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F12/00Accessing, addressing or allocating within memory systems or architectures
    • G06F12/02Addressing or allocation; Relocation
    • G06F12/08Addressing or allocation; Relocation in hierarchically structured memory systems, e.g. virtual memory systems
    • G06F12/0802Addressing of a memory level in which the access to the desired data or data block requires associative addressing means, e.g. caches
    • G06F12/0875Addressing of a memory level in which the access to the desired data or data block requires associative addressing means, e.g. caches with dedicated cache, e.g. instruction or stack
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/40Transformation of program code
    • G06F8/41Compilation
    • G06F8/44Encoding
    • G06F8/445Exploiting fine grain parallelism, i.e. parallelism at instruction level
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2212/00Indexing scheme relating to accessing, addressing or allocation within memory systems or architectures
    • G06F2212/10Providing a specific technical effect
    • G06F2212/1008Correctness of operation, e.g. memory ordering
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2212/00Indexing scheme relating to accessing, addressing or allocation within memory systems or architectures
    • G06F2212/45Caching of specific data in cache memory
    • G06F2212/452Instruction code
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2212/00Indexing scheme relating to accessing, addressing or allocation within memory systems or architectures
    • G06F2212/45Caching of specific data in cache memory
    • G06F2212/455Image or video data

Definitions

  • the present invention relates generally to information processing and, in particular, to automatically enabling a read-only cache in a language in which two arrays in two different variables may alias each other.
  • aliasing refers to the situation where the same memory location can be accessed using different names. Such a situation can be quite problematic, particularly in the case of sequential writes. For example, if two writes are aliased and occur out of sequence, an incorrect program result will likely occur. The same is true for a write access and a read access. In contrast, if two reads are aliased and occur out of sequence, the program result will likely not be affected.
  • a general purpose graphics processing unit (GPGPU) by NVIDIA® provides a read-only cache, which can be accessed fast, on a chip.
  • This read-only cache is not coherent with write actions to other memory system.
  • the read-only cache must be used only for accesses to memory that must not be written by the same GPU code.
  • the CUDA language provided by NVIDIA® allows a programmer to enable a read-only cache by decorating pointer arguments using “const_restrict_”, or using an intrinsic “_ldg( )” for each access.
  • the Open Accelerators (OpenACC) programming standard does not allow a programmer to enable read-only cache explicitly.
  • a read-only cache is not automatically enabled.
  • This program has lexical variables that points to arrays, and it has one or more lexical variables that do not perform write operations to arrays. If a compiler naively generate a code from a parallel stream to enable read-only cache for accesses regarding b[ ] in the sample program, the code will not work correctly when a[ ] and b[ ] point to the same array.
  • a method is provided.
  • the method is for executing, by a processor including a read-only cache, a program having a plurality of variables including a first variable and a second variable.
  • Each of the plurality of variables is for executing at least one of a respective one of a plurality of read operations or a respective one of a plurality of write operations for an object.
  • the method includes providing a first code that uses the read-only cache and a second code that does not use the read-only cache.
  • the method further includes determining, by the processor, whether a first object designated by the first variable is aliased or not aliased with a second object designated by the second variable.
  • the method also includes executing, by the processor, the first code when the first object is not aliased with the second object.
  • the method additionally includes executing, by the processor, the second code when the first object is aliased with the second object.
  • a computer program product is provided.
  • the computer program product is for controlling execution of a program by a processor including a read-only cache.
  • the program has a plurality of variables including a first variable and a second variable.
  • Each of the plurality of variables is for executing at least one of a respective one of a plurality of read operations or a respective one of a plurality of write operations for an object.
  • the computer program product includes a non-transitory computer readable storage medium having program instructions embodied therewith.
  • the program instructions are executable by a computer to cause the computer to perform a method.
  • the method includes providing a first code that uses the read-only cache and a second code that does not use the read-only cache.
  • the method further includes determining, by the processor, whether a first object designated by the first variable is aliased or not aliased with a second object designated by the second variable.
  • the method also includes executing, by the processor, the first code when the first object is not aliased with the second object.
  • the method additionally includes executing, by the processor, the second code when the first object is aliased with the second object.
  • a system is provided.
  • the system is for executing a program having a plurality of variables including a first variable and a second variable.
  • Each of the plurality of variables is for executing at least one of a respective one of a plurality of read operations or a respective one of a plurality of write operations for an object.
  • the system includes a compiler for providing a first code that uses the read-only cache and a second code that does not use the read-only cache.
  • the system further includes a processor, having a read-only cache, for determining whether a first object designated by the first variable is aliased or not aliased with a second object designated by the second variable, executing the first code when the first object is not aliased with the second object, and executing the second code when the first object is aliased with the second object.
  • a processor having a read-only cache, for determining whether a first object designated by the first variable is aliased or not aliased with a second object designated by the second variable, executing the first code when the first object is not aliased with the second object, and executing the second code when the first object is aliased with the second object.
  • FIG. 1 shows an exemplary processing system 100 to which the present principles may be applied, in accordance with an embodiment of the present principles
  • FIG. 2 shows an exemplary method 200 for enabling a read-only cache at runtime, in accordance with an embodiment of the present principles
  • FIG. 3 shows an exemplary method 300 for generating check code by a compiler, in accordance with an embodiment of the present principles
  • FIG. 4 shows an exemplary method 400 for checking a condition at runtime without generating check code, in accordance with an embodiment of the present principles.
  • the present principles are directed to automatically enabling a read-only cache in a language in which two arrays in two different variables may alias each other.
  • the present principles involve checking whether or not a condition exists for enabling a read-only cache at runtime. Code enabling a read-only cache is executed only when the condition exists.
  • FIG. 1 shows an exemplary processing system 100 to which the present principles may be applied, in accordance with an embodiment of the present principles.
  • the processing system 100 includes at least one processor (CPU) 104 and a GPGPU 103 operatively coupled to other components via a system bus 102 .
  • a cache 106 operatively coupled to the system bus 102 .
  • ROM Read Only Memory
  • RAM Random Access Memory
  • I/O input/output
  • CPU 104 can have one or more on-chip caches (e.g., L 1 , L 2 , etc., collectively denoted by the reference numeral 104 A).
  • at least one cache from among the one or more caches 104 A is a read-only cache.
  • GPGPU 103 includes at least one cache 103 A.
  • Cache 103 is a read-only cache.
  • cache 103 A is on-chip with respect to the GPGPU 103 .
  • cache 103 A is used by GPGPU 103 but is off-chip with respect to GPGPU 103 .
  • the present principles can be applied to any of CPU 104 and read-only cache 104 A and/or GPGPU 103 and read-only cache 103 A.
  • a first storage device 122 and a second storage device 124 are operatively coupled to system bus 102 by the I/O adapter 120 .
  • the storage devices 122 and 124 can be any of a disk storage device (e.g., a magnetic or optical disk storage device), a solid state magnetic device, and so forth.
  • the storage devices 122 and 124 can be the same type of storage device or different types of storage devices.
  • Storage device 122 and/or storage device 124 can be implemented as a cache.
  • Storage device 122 includes an operating system 122 A.
  • Storage device 124 includes one or more compilers, collectively denoted by the reference numeral 124 A.
  • a speaker 132 is operatively coupled to system bus 102 by the sound adapter 130 .
  • a transceiver 142 is operatively coupled to system bus 102 by network adapter 140 .
  • a display device 162 is operatively coupled to system bus 102 by display adapter 160 .
  • a first user input device 152 , a second user input device 154 , and a third user input device 156 are operatively coupled to system bus 102 by user interface adapter 150 .
  • the user input devices 152 , 154 , and 156 can be any of a keyboard, a mouse, a keypad, an image capture device, a motion sensing device, a microphone, a device incorporating the functionality of at least two of the preceding devices, and so forth. Of course, other types of input devices can also be used, while maintaining the spirit of the present principles.
  • the user input devices 152 , 154 , and 156 can be the same type of user input device or different types of user input devices.
  • the user input devices 152 , 154 , and 156 are used to input and output information to and from system 100 .
  • processing system 100 may also include other elements (not shown), as readily contemplated by one of skill in the art, as well as omit certain elements.
  • various other input devices and/or output devices can be included in processing system 100 , depending upon the particular implementation of the same, as readily understood by one of ordinary skill in the art.
  • various types of wireless and/or wired input and/or output devices can be used.
  • additional processors, controllers, memories, and so forth, in various configurations can also be utilized as readily appreciated by one of ordinary skill in the art.
  • processing system 100 may perform at least part of the methods described herein including, for example, at least part of method 200 of FIG. 2 and/or at least part of method 300 of FIG. 3 and/or at least part of method 400 of FIG. 4 .
  • Method 200 provides a general overview of the present principles, while methods 300 and 400 provides two exemplary ways of implementing the present principles.
  • methods 300 and 400 provides two exemplary ways of implementing the present principles.
  • variations of these methods can be readily implemented while maintaining the spirit of the present principles.
  • FIG. 2 shows an exemplary method 200 for enabling a read-only cache at runtime, in accordance with an embodiment of the present principles.
  • the read-only cache is enabled in a language in which two arrays in two different variables can alias each other.
  • step 210 generate a first version and a second version of a code for a target region to be executed on a GPU.
  • the first version of the code uses a read-only cache for accesses of some or all read-only arrays.
  • the second version of the code does not use a read-only cache for accesses of all read-only arrays.
  • the first runtime condition is the existence of an object, whose accesses use read-only cache, where the object is in a variable and the object is not accessed by any write operation in a target code region.
  • the second predetermined condition is that the variable does not point to the (same) object in other variables which may be accessed by any write operations in the target code region.
  • step 230 determine whether or not all of the predetermined runtime conditions have been satisfied. If so, then the method proceeds to step 240 . Otherwise, the method proceeds to step 250 .
  • step 240 execute a code that uses the read-only cache for the target region.
  • step 250 execute a code that does not use the read-only cache for the target region.
  • FIG. 3 shows an exemplary method 300 for generating check code by a compiler, in accordance with an embodiment of the present principles.
  • the check code is used for enabling a read-only cache at runtime.
  • the read-only cache is enabled in a language in which two arrays in two different variables can alias each other.
  • step 310 classify all variables of a language array (that is, an array in a particular computer programming language) to be transferred to a GPGPU as follows: R is a set of variables that is used only for read operations that uses read-only cache; and W is a set of variables that may be used for write operations.
  • step 320 determine if there is a variable from R yet unprocessed by method 300 . If so, then the method proceeds to step 330 . Otherwise, the method proceeds to step 325 .
  • step 325 generate a path from the if-statement, which was generated at step 340 , to code that uses the read-only cache, and the method is terminated.
  • step 330 retrieve (get) a variable from R and remove the variable from R.
  • step 340 generate a statement (e.g., an if-statement) with a condition to compare two addresses, the first address from among a language array of the variable retrieved (from set R) in step 330 and the second address from among language arrays in variables in set W.
  • the condition is true if these two addresses are the same.
  • the condition is later evaluated at runtime.
  • step 350 generate a conditional branch (depending on the condition of step 340 ) having a path from a new if statement (generated at step 340 for a next variable in R), and another path from the if-statement to code that does not use the read-only cache, where the actual path used is determined at runtime based on the runtime conditional result of the if-statement generated by step 340 . If the condition is satisfied, a path from the if-statement to code that does not use the read-only cache will be selected at runtime. Otherwise, another path will be selected at runtime.
  • step 330 takes a, and steps 340 and 350 generate the following if-statement:
  • step 330 takes b, and steps 340 and 350 generate the following code:
  • step 325 At the end of step 350 , we are missing code for “ . . . ”. Then, go to step 320 . Since there is no more variables in R, step 325 generates the following code: “go to code that uses the read-only cache” at “ . . . ”. This is a reason that step 325 generates a path.
  • FIG. 4 shows an exemplary method 400 for checking a condition at runtime without generating check code, in accordance with an embodiment of the present principles.
  • a hash table where a key is a variable to hold a language array, and a value is a read-write mode of this variable.
  • step 420 determine if there is a given variable of a language array with its access mode m (READ, WRITE, READWRITE (that is, both a read and a write), or NONE) to be transferred to a GPGPU. If so, then the method proceeds to step 430 . Otherwise, the method proceeds to step 480 .
  • access mode m READ, WRITE, READWRITE (that is, both a read and a write), or NONE
  • access mode m READ, WRITE, READWRITE, or NONE
  • the first address is for a language array in a variable stored in the hash table.
  • the second address is for the given variable (retrieved at step 430 ). If so, then the method proceeds to step 450 . Otherwise, the method returns to step 420 .
  • step 450 return the corresponding value n, where the value n is the access mode (READ, WRITE, READWRITE, or NONE) of the variable retrieved at step 430 .
  • step 460 determine whether or not one of the following predetermined conditions from a set (of two, in this case) of predetermined conditions (using the value n returns at step 450 ):
  • step 470 the method proceeds to step 470 . Otherwise, the method returns to step 420 .
  • step 470 execute the code on the GPGPU without the read-only cache.
  • step 480 execute the code on the GPGPU enabling the read-only cache.
  • the present invention may be a system, a method, and/or a computer program product.
  • the computer program product may include a computer readable storage medium (or media) having computer readable program instructions thereon for causing a processor to carry out aspects of the present invention.
  • the computer readable storage medium can be a tangible device that can retain and store instructions for use by an instruction execution device.
  • the computer readable storage medium may be, for example, but is not limited to, an electronic storage device, a magnetic storage device, an optical storage device, an electromagnetic storage device, a semiconductor storage device, or any suitable combination of the foregoing.
  • a non-exhaustive list of more specific examples of the computer readable storage medium includes the following: a portable computer diskette, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or Flash memory), a static random access memory (SRAM), a portable compact disc read-only memory (CD-ROM), a digital versatile disk (DVD), a memory stick, a floppy disk, a mechanically encoded device such as punch-cards or raised structures in a groove having instructions recorded thereon, and any suitable combination of the foregoing.
  • RAM random access memory
  • ROM read-only memory
  • EPROM or Flash memory erasable programmable read-only memory
  • SRAM static random access memory
  • CD-ROM compact disc read-only memory
  • DVD digital versatile disk
  • memory stick a floppy disk
  • a mechanically encoded device such as punch-cards or raised structures in a groove having instructions recorded thereon
  • a computer readable storage medium is not to be construed as being transitory signals per se, such as radio waves or other freely propagating electromagnetic waves, electromagnetic waves propagating through a waveguide or other transmission media (e.g., light pulses passing through a fiber-optic cable), or electrical signals transmitted through a wire.
  • Computer readable program instructions described herein can be downloaded to respective computing/processing devices from a computer readable storage medium or to an external computer or external storage device via a network, for example, the Internet, a local area network, a wide area network and/or a wireless network.
  • the network may comprise copper transmission cables, optical transmission fibers, wireless transmission, routers, firewalls, switches, gateway computers and/or edge servers.
  • a network adapter card or network interface in each computing/processing device receives computer readable program instructions from the network and forwards the computer readable program instructions for storage in a computer readable storage medium within the respective computing/processing device.
  • Computer readable program instructions for carrying out operations of the present invention may be assembler instructions, instruction-set-architecture (ISA) instructions, machine instructions, machine dependent instructions, microcode, firmware instructions, state-setting data, or either source code or object code written in any combination of one or more programming languages, including an object oriented programming language such as SMALLTALK, C++ or the like, and conventional procedural programming languages, such as the “C” programming language or similar programming languages.
  • the computer readable program instructions may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server.
  • the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet Service Provider).
  • electronic circuitry including, for example, programmable logic circuitry, field-programmable gate arrays (FPGA), or programmable logic arrays (PLA) may execute the computer readable program instructions by utilizing state information of the computer readable program instructions to personalize the electronic circuitry, in order to perform aspects of the present invention.
  • These computer readable program instructions may be provided to a processor of a general purpose computer, special purpose computer, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions/acts specified in the flowchart and/or block diagram block or blocks.
  • These computer readable program instructions may also be stored in a computer readable storage medium that can direct a computer, a programmable data processing apparatus, and/or other devices to function in a particular manner, such that the computer readable storage medium having instructions stored therein comprises an article of manufacture including instructions which implement aspects of the function/act specified in the flowchart and/or block diagram block or blocks.
  • the computer readable program instructions may also be loaded onto a computer, other programmable data processing apparatus, or other device to cause a series of operational steps to be performed on the computer, other programmable apparatus or other device to produce a computer implemented process, such that the instructions which execute on the computer, other programmable apparatus, or other device implement the functions/acts specified in the flowchart and/or block diagram block or blocks.
  • each block in the flowchart or block diagrams may represent a module, segment, or portion of instructions, which comprises one or more executable instructions for implementing the specified logical function(s).
  • the functions noted in the block may occur out of the order noted in the figures.
  • two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved.
  • any of the following “/”, “and/or”, and “at least one of”, for example, in the cases of “A/B”, “A and/or B” and “at least one of A and B”, is intended to encompass the selection of the first listed option (A) only, or the selection of the second listed option (B) only, or the selection of both options (A and B).
  • such phrasing is intended to encompass the selection of the first listed option (A) only, or the selection of the second listed option (B) only, or the selection of the third listed option (C) only, or the selection of the first and the second listed options (A and B) only, or the selection of the first and third listed options (A and C) only, or the selection of the second and third listed options (B and C) only, or the selection of all three options (A and B and C).
  • This may be extended, as readily apparent by one of ordinary skill in this and related arts, for as many items listed.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • Memory System Of A Hierarchy Structure (AREA)

Abstract

A method and system are provided for executing, by a processor including a read-only cache, a program having a plurality of variables including a first variable and a second variable. Each variable is for executing a respective read operation or a respective write operation for an object. The method includes providing a first code that uses the read-only cache and a second code that does not use the read-only cache. The method further includes determining, by the processor, whether a first object designated by the first variable is aliased or not aliased with a second object designated by the second variable. The method also includes executing, by the processor, the first code when the first object is not aliased with the second object, and the second code when the first object is aliased with the second object.

Description

BACKGROUND Technical Field
The present invention relates generally to information processing and, in particular, to automatically enabling a read-only cache in a language in which two arrays in two different variables may alias each other.
Description of the Related Art
There are languages in which two arrays in two different variables may alias each other such as C and Java®. For example, in a sample program, a[ ] and b[ ] may point to the same array.
In computer programming, and as used herein, aliasing refers to the situation where the same memory location can be accessed using different names. Such a situation can be quite problematic, particularly in the case of sequential writes. For example, if two writes are aliased and occur out of sequence, an incorrect program result will likely occur. The same is true for a write access and a read access. In contrast, if two reads are aliased and occur out of sequence, the program result will likely not be affected.
A general purpose graphics processing unit (GPGPU) by NVIDIA® provides a read-only cache, which can be accessed fast, on a chip. This read-only cache is not coherent with write actions to other memory system. Thus, the read-only cache must be used only for accesses to memory that must not be written by the same GPU code.
The CUDA language provided by NVIDIA® allows a programmer to enable a read-only cache by decorating pointer arguments using “const_restrict_”, or using an intrinsic “_ldg( )” for each access. The Open Accelerators (OpenACC) programming standard does not allow a programmer to enable read-only cache explicitly.
TABLE 1 below shows a sample program written in Java®.
TABLE 1
void test(int a[ ], int b[ ]) {
 IntStream.range(0, b.length).
 parallel( ).forEach(i -> {    a[i] = b[i] * 2;
  a[i] = b[i] * 3;
 });
}
In the sample program written in Java® (or in an equivalent program in C with an OpenACC directive), a read-only cache is not automatically enabled. This program has lexical variables that points to arrays, and it has one or more lexical variables that do not perform write operations to arrays. If a compiler naively generate a code from a parallel stream to enable read-only cache for accesses regarding b[ ] in the sample program, the code will not work correctly when a[ ] and b[ ] point to the same array.
Thus, there is a need for automatically enabling a read-only cache in a computer programming language in which two arrays in two different variables can alias each other.
SUMMARY
According to an aspect of the present principles, a method is provided. The method is for executing, by a processor including a read-only cache, a program having a plurality of variables including a first variable and a second variable. Each of the plurality of variables is for executing at least one of a respective one of a plurality of read operations or a respective one of a plurality of write operations for an object. The method includes providing a first code that uses the read-only cache and a second code that does not use the read-only cache. The method further includes determining, by the processor, whether a first object designated by the first variable is aliased or not aliased with a second object designated by the second variable. The method also includes executing, by the processor, the first code when the first object is not aliased with the second object. The method additionally includes executing, by the processor, the second code when the first object is aliased with the second object.
According to another aspect of the present principles, a computer program product is provided. The computer program product is for controlling execution of a program by a processor including a read-only cache. The program has a plurality of variables including a first variable and a second variable. Each of the plurality of variables is for executing at least one of a respective one of a plurality of read operations or a respective one of a plurality of write operations for an object. The computer program product includes a non-transitory computer readable storage medium having program instructions embodied therewith. The program instructions are executable by a computer to cause the computer to perform a method. The method includes providing a first code that uses the read-only cache and a second code that does not use the read-only cache. The method further includes determining, by the processor, whether a first object designated by the first variable is aliased or not aliased with a second object designated by the second variable. The method also includes executing, by the processor, the first code when the first object is not aliased with the second object. The method additionally includes executing, by the processor, the second code when the first object is aliased with the second object.
According to yet another aspect of the present principles, a system is provided. The system is for executing a program having a plurality of variables including a first variable and a second variable. Each of the plurality of variables is for executing at least one of a respective one of a plurality of read operations or a respective one of a plurality of write operations for an object. The system includes a compiler for providing a first code that uses the read-only cache and a second code that does not use the read-only cache. The system further includes a processor, having a read-only cache, for determining whether a first object designated by the first variable is aliased or not aliased with a second object designated by the second variable, executing the first code when the first object is not aliased with the second object, and executing the second code when the first object is aliased with the second object.
These and other features and advantages will become apparent from the following detailed description of illustrative embodiments thereof, which is to be read in connection with the accompanying drawings.
BRIEF DESCRIPTION OF DRAWINGS
The disclosure will provide details in the following description of preferred embodiments with reference to the following figures wherein:
FIG. 1 shows an exemplary processing system 100 to which the present principles may be applied, in accordance with an embodiment of the present principles;
FIG. 2 shows an exemplary method 200 for enabling a read-only cache at runtime, in accordance with an embodiment of the present principles;
FIG. 3 shows an exemplary method 300 for generating check code by a compiler, in accordance with an embodiment of the present principles; and
FIG. 4 shows an exemplary method 400 for checking a condition at runtime without generating check code, in accordance with an embodiment of the present principles.
DETAILED DESCRIPTION OF PREFERRED EMBODIMENTS
The present principles are directed to automatically enabling a read-only cache in a language in which two arrays in two different variables may alias each other.
In an embodiment, the present principles involve checking whether or not a condition exists for enabling a read-only cache at runtime. Code enabling a read-only cache is executed only when the condition exists.
FIG. 1 shows an exemplary processing system 100 to which the present principles may be applied, in accordance with an embodiment of the present principles. The processing system 100 includes at least one processor (CPU) 104 and a GPGPU 103 operatively coupled to other components via a system bus 102. A cache 106, a Read Only Memory (ROM) 108, a Random Access Memory (RAM) 110, an input/output (I/O) adapter 120, a sound adapter 130, a network adapter 140, a user interface adapter 150, and a display adapter 160, are operatively coupled to the system bus 102. While cache 106 is intended to represent an off-chip cache, CPU 104 can have one or more on-chip caches (e.g., L1, L2, etc., collectively denoted by the reference numeral 104A). In an embodiment, at least one cache from among the one or more caches 104A is a read-only cache. Moreover, GPGPU 103 includes at least one cache 103A. Cache 103 is a read-only cache. In the embodiment of FIG. 1, cache 103A is on-chip with respect to the GPGPU 103. In other embodiments, cache 103A is used by GPGPU 103 but is off-chip with respect to GPGPU 103. The present principles can be applied to any of CPU 104 and read-only cache 104A and/or GPGPU 103 and read-only cache 103A.
A first storage device 122 and a second storage device 124 are operatively coupled to system bus 102 by the I/O adapter 120. The storage devices 122 and 124 can be any of a disk storage device (e.g., a magnetic or optical disk storage device), a solid state magnetic device, and so forth. The storage devices 122 and 124 can be the same type of storage device or different types of storage devices. Storage device 122 and/or storage device 124 can be implemented as a cache. Storage device 122 includes an operating system 122A. Storage device 124 includes one or more compilers, collectively denoted by the reference numeral 124A.
A speaker 132 is operatively coupled to system bus 102 by the sound adapter 130. A transceiver 142 is operatively coupled to system bus 102 by network adapter 140. A display device 162 is operatively coupled to system bus 102 by display adapter 160.
A first user input device 152, a second user input device 154, and a third user input device 156 are operatively coupled to system bus 102 by user interface adapter 150. The user input devices 152, 154, and 156 can be any of a keyboard, a mouse, a keypad, an image capture device, a motion sensing device, a microphone, a device incorporating the functionality of at least two of the preceding devices, and so forth. Of course, other types of input devices can also be used, while maintaining the spirit of the present principles. The user input devices 152, 154, and 156 can be the same type of user input device or different types of user input devices. The user input devices 152, 154, and 156 are used to input and output information to and from system 100.
Of course, the processing system 100 may also include other elements (not shown), as readily contemplated by one of skill in the art, as well as omit certain elements. For example, various other input devices and/or output devices can be included in processing system 100, depending upon the particular implementation of the same, as readily understood by one of ordinary skill in the art. For example, various types of wireless and/or wired input and/or output devices can be used. Moreover, additional processors, controllers, memories, and so forth, in various configurations can also be utilized as readily appreciated by one of ordinary skill in the art. These and other variations of the processing system 100 are readily contemplated by one of ordinary skill in the art given the teachings of the present principles provided herein.
It is to be appreciated that processing system 100 may perform at least part of the methods described herein including, for example, at least part of method 200 of FIG. 2 and/or at least part of method 300 of FIG. 3 and/or at least part of method 400 of FIG. 4.
Three exemplary methods 200, 300, and 400 will now be described with respect to FIGS. 2, 3, and 4. Method 200 provides a general overview of the present principles, while methods 300 and 400 provides two exemplary ways of implementing the present principles. Of course, given the teachings of the present principles provided herein, variations of these methods can be readily implemented while maintaining the spirit of the present principles.
FIG. 2 shows an exemplary method 200 for enabling a read-only cache at runtime, in accordance with an embodiment of the present principles. The read-only cache is enabled in a language in which two arrays in two different variables can alias each other.
At step 210, generate a first version and a second version of a code for a target region to be executed on a GPU. The first version of the code uses a read-only cache for accesses of some or all read-only arrays. The second version of the code does not use a read-only cache for accesses of all read-only arrays.
At step 220, search for a first predetermined runtime condition and a second predetermined runtime condition. The first runtime condition is the existence of an object, whose accesses use read-only cache, where the object is in a variable and the object is not accessed by any write operation in a target code region. The second predetermined condition is that the variable does not point to the (same) object in other variables which may be accessed by any write operations in the target code region.
At step 230, determine whether or not all of the predetermined runtime conditions have been satisfied. If so, then the method proceeds to step 240. Otherwise, the method proceeds to step 250.
At step 240, execute a code that uses the read-only cache for the target region.
At step 250, execute a code that does not use the read-only cache for the target region.
FIG. 3 shows an exemplary method 300 for generating check code by a compiler, in accordance with an embodiment of the present principles. The check code is used for enabling a read-only cache at runtime. The read-only cache is enabled in a language in which two arrays in two different variables can alias each other.
At step 310, classify all variables of a language array (that is, an array in a particular computer programming language) to be transferred to a GPGPU as follows: R is a set of variables that is used only for read operations that uses read-only cache; and W is a set of variables that may be used for write operations.
At step 320, determine if there is a variable from R yet unprocessed by method 300. If so, then the method proceeds to step 330. Otherwise, the method proceeds to step 325.
At step 325, generate a path from the if-statement, which was generated at step 340, to code that uses the read-only cache, and the method is terminated.
At step 330, retrieve (get) a variable from R and remove the variable from R.
At step 340, generate a statement (e.g., an if-statement) with a condition to compare two addresses, the first address from among a language array of the variable retrieved (from set R) in step 330 and the second address from among language arrays in variables in set W. The condition is true if these two addresses are the same. The condition is later evaluated at runtime.
At step 350, generate a conditional branch (depending on the condition of step 340) having a path from a new if statement (generated at step 340 for a next variable in R), and another path from the if-statement to code that does not use the read-only cache, where the actual path used is determined at runtime based on the runtime conditional result of the if-statement generated by step 340. If the condition is satisfied, a path from the if-statement to code that does not use the read-only cache will be selected at runtime. Otherwise, another path will be selected at runtime.
The following example in provided with respect to method 300.
Let us think about the case of two variables a and b in R and w in W.
First, step 330 takes a, and steps 340 and 350 generate the following if-statement:
“if (a == w) {
 go to code that does not use the read-only cache
} else {
...
}”
Then, step 330 takes b, and steps 340 and 350 generate the following code:
“if (a == w) {
  go to code that does not use the read-only cache
 } else {
  if (b == w) {
   go to code that does not use the read-only cache
  } else {
  ...
  }
 }”
At the end of step 350, we are missing code for “ . . . ”. Then, go to step 320. Since there is no more variables in R, step 325 generates the following code: “go to code that uses the read-only cache” at “ . . . ”. This is a reason that step 325 generates a path.
Referring back to the source program of TABLE 1, the following pseudocode shown in TABLE 2 is generated based on the principles of method 300.
TABLE 2
// code for CPU
void test(int a[ ], int b[ ]) {
 // allocate device buffer d_a for A and transfer data to device buffer
 // allocate device buffer d_b for B and transfer data to device buffer
 ...
 if (*a != *b)
  testGPUwROC<<<...>>>(d_A, d_B); // GPU code enabling
  read-only cache
 else
  testGPU<<<...>>>(d_A, d_B); // GPU code without read-only cache
 ...
}
FIG. 4 shows an exemplary method 400 for checking a condition at runtime without generating check code, in accordance with an embodiment of the present principles.
At step 410, provide a hash table, where a key is a variable to hold a language array, and a value is a read-write mode of this variable.
At step 420, determine if there is a given variable of a language array with its access mode m (READ, WRITE, READWRITE (that is, both a read and a write), or NONE) to be transferred to a GPGPU. If so, then the method proceeds to step 430. Otherwise, the method proceeds to step 480.
At step 430, retrieve (get) a given variable to hold a language array with its access mode m (READ, WRITE, READWRITE, or NONE) to be transferred to the GPGPU.
At step 440, check, using the hash table, whether a first address and a second address are the same (i.e., first address=second address). The first address is for a language array in a variable stored in the hash table. The second address is for the given variable (retrieved at step 430). If so, then the method proceeds to step 450. Otherwise, the method returns to step 420.
At step 450, return the corresponding value n, where the value n is the access mode (READ, WRITE, READWRITE, or NONE) of the variable retrieved at step 430.
At step 460, determine whether or not one of the following predetermined conditions from a set (of two, in this case) of predetermined conditions (using the value n returns at step 450):
1. (m is READ and m is accessed through read-only cache) and (n is WRITE or n is READWRITE); and
2. (n is READ and n is accessed through read-only cache) and (m is WRITE or m is READWRITE).
If so, then the method proceeds to step 470. Otherwise, the method returns to step 420.
At step 470, execute the code on the GPGPU without the read-only cache.
At step 480, execute the code on the GPGPU enabling the read-only cache.
Referring back to the source program of TABLE 1, the following pseudocode shown in TABLE 3 is generated based on the principles of method 400.
TABLE 3
// code for CPU
void test(int a[ ], int b[ ], int len) {
 bool noROC = false;
 initGPU(C); // allocate hashtable in C->h
 noROC |= copyToGPU(C, a, &d_A,
     a.length*4, W);
 noROC |= copyToGPU(C, b, &d_B,
     b.length*4, R);
 if (!noROC)
  testGPUwROC<<<...>>>(d_A,d_B);
 else
  testGPU<<<...>>>(d_A, d_B);
 copyFromGPU(C, b, d_b, b.length*4);
 copyFromGPU(C, a, d_a, a.length*4);
 termGPU(C); // free hashtable in C->h
}
Further referring back to the source program of TABLE 1, the following runtime code shown in TABLE 4 is generated based on the principles of method 400.
TABLE 4
bool copyToGPU(C, int *a, int **d, int len, int m) {
 int n = C->h->get(a); // n is NONE/R/W/RW
 if (n == NONE) {
  cudaMalloc(d, len);
  cudaMemcpy(*d, a, len, Host2Device);
  C->h->put(a, m);
 }
 return
  (((m == R) && ((n == W) || (n == RW))) ||
  ((n == R) && ((m == W) || (m == RW))));
}
void copyFromGPU(C, int *a, int *d,int len) {
 cudaMemcpy(a, d, len, Device2Host);
 cudaFree(d);
 C->h->remove(a);
}
The present invention may be a system, a method, and/or a computer program product. The computer program product may include a computer readable storage medium (or media) having computer readable program instructions thereon for causing a processor to carry out aspects of the present invention.
The computer readable storage medium can be a tangible device that can retain and store instructions for use by an instruction execution device. The computer readable storage medium may be, for example, but is not limited to, an electronic storage device, a magnetic storage device, an optical storage device, an electromagnetic storage device, a semiconductor storage device, or any suitable combination of the foregoing. A non-exhaustive list of more specific examples of the computer readable storage medium includes the following: a portable computer diskette, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or Flash memory), a static random access memory (SRAM), a portable compact disc read-only memory (CD-ROM), a digital versatile disk (DVD), a memory stick, a floppy disk, a mechanically encoded device such as punch-cards or raised structures in a groove having instructions recorded thereon, and any suitable combination of the foregoing. A computer readable storage medium, as used herein, is not to be construed as being transitory signals per se, such as radio waves or other freely propagating electromagnetic waves, electromagnetic waves propagating through a waveguide or other transmission media (e.g., light pulses passing through a fiber-optic cable), or electrical signals transmitted through a wire.
Computer readable program instructions described herein can be downloaded to respective computing/processing devices from a computer readable storage medium or to an external computer or external storage device via a network, for example, the Internet, a local area network, a wide area network and/or a wireless network. The network may comprise copper transmission cables, optical transmission fibers, wireless transmission, routers, firewalls, switches, gateway computers and/or edge servers. A network adapter card or network interface in each computing/processing device receives computer readable program instructions from the network and forwards the computer readable program instructions for storage in a computer readable storage medium within the respective computing/processing device.
Computer readable program instructions for carrying out operations of the present invention may be assembler instructions, instruction-set-architecture (ISA) instructions, machine instructions, machine dependent instructions, microcode, firmware instructions, state-setting data, or either source code or object code written in any combination of one or more programming languages, including an object oriented programming language such as SMALLTALK, C++ or the like, and conventional procedural programming languages, such as the “C” programming language or similar programming languages. The computer readable program instructions may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the latter scenario, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet Service Provider). In some embodiments, electronic circuitry including, for example, programmable logic circuitry, field-programmable gate arrays (FPGA), or programmable logic arrays (PLA) may execute the computer readable program instructions by utilizing state information of the computer readable program instructions to personalize the electronic circuitry, in order to perform aspects of the present invention.
Aspects of the present invention are described herein with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and/or block diagrams, and combinations of blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer readable program instructions.
These computer readable program instructions may be provided to a processor of a general purpose computer, special purpose computer, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions/acts specified in the flowchart and/or block diagram block or blocks. These computer readable program instructions may also be stored in a computer readable storage medium that can direct a computer, a programmable data processing apparatus, and/or other devices to function in a particular manner, such that the computer readable storage medium having instructions stored therein comprises an article of manufacture including instructions which implement aspects of the function/act specified in the flowchart and/or block diagram block or blocks.
The computer readable program instructions may also be loaded onto a computer, other programmable data processing apparatus, or other device to cause a series of operational steps to be performed on the computer, other programmable apparatus or other device to produce a computer implemented process, such that the instructions which execute on the computer, other programmable apparatus, or other device implement the functions/acts specified in the flowchart and/or block diagram block or blocks.
The flowchart and block diagrams in the Figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of the present invention. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of instructions, which comprises one or more executable instructions for implementing the specified logical function(s). In some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems that perform the specified functions or acts or carry out combinations of special purpose hardware and computer instructions.
Reference in the specification to “one embodiment” or “an embodiment” of the present principles, as well as other variations thereof, means that a particular feature, structure, characteristic, and so forth described in connection with the embodiment is included in at least one embodiment of the present principles. Thus, the appearances of the phrase “in one embodiment” or “in an embodiment”, as well any other variations, appearing in various places throughout the specification are not necessarily all referring to the same embodiment.
It is to be appreciated that the use of any of the following “/”, “and/or”, and “at least one of”, for example, in the cases of “A/B”, “A and/or B” and “at least one of A and B”, is intended to encompass the selection of the first listed option (A) only, or the selection of the second listed option (B) only, or the selection of both options (A and B). As a further example, in the cases of “A, B, and/or C” and “at least one of A, B, and C”, such phrasing is intended to encompass the selection of the first listed option (A) only, or the selection of the second listed option (B) only, or the selection of the third listed option (C) only, or the selection of the first and the second listed options (A and B) only, or the selection of the first and third listed options (A and C) only, or the selection of the second and third listed options (B and C) only, or the selection of all three options (A and B and C). This may be extended, as readily apparent by one of ordinary skill in this and related arts, for as many items listed.
Having described preferred embodiments of a system and method (which are intended to be illustrative and not limiting), it is noted that modifications and variations can be made by persons skilled in the art in light of the above teachings. It is therefore to be understood that changes may be made in the particular embodiments disclosed which are within the scope of the invention as outlined by the appended claims. Having thus described aspects of the invention, with the details and particularity required by the patent laws, what is claimed and desired protected by Letters Patent is set forth in the appended claims.

Claims (20)

What is claimed is:
1. A method for executing, by a processor including a read-only cache, a program having a first variable and a second variable, each of the variables for executing at least one of a respective one of a plurality of read operations or a respective one of a plurality of write operations for an object, the method comprising:
determining, by the processor, whether a first object designated by the first variable is aliased or not aliased with a second object designated by the second variable based on (i) a first condition that the first object in the first variable has accesses that use only the read-only cache and that the first object in the first variable is not accessed by any of the plurality of write operations in a target code region, and (ii) a second condition that the first variable does not point to the first object in other variables of the program that are accessible by any of the plurality of write operations in the target code region;
executing, by the processor, a first code that uses the read-only cache, when the first object is not aliased with the second object; and
executing, by the processor, a second code that does not use the read-only cache, when the first object is aliased with the second object.
2. The method of claim 1, wherein said determining step comprises determining whether the first object, which executes a given one of the plurality of read operations but does not execute any of the plurality of write operations, is the same as or different from the second object which executes a given one of the plurality of write operations.
3. The method of claim 1, further comprising classifying the first variable and the second variable into a corresponding one of a first and a second set, the first set including variables used only for the read operations, the second set including variables used only for the write operations.
4. The method of claim 3, further comprising generating check code for determining whether the first object is aliased with the second object, the check code referencing the first set and the second set.
5. The method of claim 1, wherein the second code is executed when at least one of the first condition and the second condition is true.
6. The method of claim 1, wherein the processor is a graphics processing unit.
7. The method of claim 1, wherein said determining step determines whether the first object designated by the first variable is aliased or not aliased with the second object designated by the second variable based on access modes used by the first variable and the second variable.
8. The method of claim 7, wherein the access mode of at least one of the first variable and the second variable is used as a respective value in a hash table whose keys comprise at least one of the first variable and the second variable.
9. A computer program product for controlling execution of a program by a processor including a read-only cache, the program having a first variable and a second variable, each of the variables for executing at least one of a respective one of a plurality of read operations or a respective one of a plurality of write operations for an object, the computer program product comprising a non-transitory computer readable storage medium having program instructions embodied therewith, the program instructions executable by a computer to cause the computer to perform a method comprising:
determining, by the processor, whether a first object designated by the first variable is aliased or not aliased with a second object designated by the second variable based on (i) a first condition that the first object in the first variable has accesses that use only the read-only cache and that the first object in the first variable is not accessed by any of the plurality of write operations in a target code region, and (ii) a second condition that the first variable does not point to the first object in other variables of the program that are accessible by any of the plurality of write operations in the target code region;
executing, by the processor, a first code that uses the read-only cache, when the first object is not aliased with the second object; and
executing, by the processor, a second code that does not use the read-only cache, when the first object is aliased with the second object.
10. The computer program product of claim 9, wherein said determining step comprises determining whether the first object, which executes a given one of the plurality of read operations but does not execute any of the plurality of write operations, is the same as or different from the second object which executes a given one of the plurality of write operations.
11. The computer program product of claim 9, further comprising classifying the first variable and the second variable into a corresponding one of a first and a second set, the first set including variables used only for the read operations, the second set including variables used only for the write operations.
12. The computer program product of claim 11, further comprising generating check code for determining whether the first object is aliased with the second object, the check code referencing the first set and the second set.
13. The computer program product of claim 9, wherein the second code is executed when at least one of the first condition and the second condition is true.
14. The computer program product of claim 9, wherein the processor is a graphics processing unit.
15. The computer program product of claim 9, wherein said determining step determines whether the first object designated by the first variable is aliased or not aliased with the second object designated by the second variable based on access modes used by the first variable and the second variable.
16. The computer program product of claim 15, wherein the access mode of at least one of the first variable and the second variable is used as a respective value in a hash table whose keys comprise at least one of the first variable and the second variable.
17. A system for executing a program having a first variable and a second variable, each of the variables for executing at least one of a respective one of a plurality of read operations or a respective one of a plurality of write operations for an object, the system comprising:
a processor, having a read-only cache, for determining, using a first condition and a second condition, whether a first object designated by the first variable is aliased or not aliased with a second object designated by the second variable, executing a first code, that uses the read-only cache, when the first object is not aliased with the second object, and executing a second code, that does not use the read-only cache, when the first object is aliased with the second object,
wherein the first variable has an access mode m, the second variable has an access mode n, and the first condition being that (the access mode m is a read operation that is accessed through the read-only cache) and (the access mode n is a write operation or a readwrite operation), and the second condition being that (the access mode n is the read operation that is accessed through the read-only cache) and (the access mode m is the write operation or the readwrite operation).
18. The system of claim 17, wherein the first object designated by the first variable is determined to be aliased with the second object designated by the second variable when the first condition or the second condition is true.
19. The system of claim 17, wherein the processor provides a hash table for mapping keys to values, the keys including the first variable, and the values including the access mode of the first variable.
20. The system of claim 17, wherein the processor is a graphics processing unit.
US15/792,822 2015-11-20 2017-10-25 Automatically enabling a read-only cache in a language in which two arrays in two different variables may alias each other Expired - Fee Related US10387994B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
US15/792,822 US10387994B2 (en) 2015-11-20 2017-10-25 Automatically enabling a read-only cache in a language in which two arrays in two different variables may alias each other

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
US14/946,902 US9824419B2 (en) 2015-11-20 2015-11-20 Automatically enabling a read-only cache in a language in which two arrays in two different variables may alias each other
US15/792,822 US10387994B2 (en) 2015-11-20 2017-10-25 Automatically enabling a read-only cache in a language in which two arrays in two different variables may alias each other

Related Parent Applications (1)

Application Number Title Priority Date Filing Date
US14/946,902 Continuation US9824419B2 (en) 2015-11-20 2015-11-20 Automatically enabling a read-only cache in a language in which two arrays in two different variables may alias each other

Publications (2)

Publication Number Publication Date
US20180047134A1 US20180047134A1 (en) 2018-02-15
US10387994B2 true US10387994B2 (en) 2019-08-20

Family

ID=58720851

Family Applications (3)

Application Number Title Priority Date Filing Date
US14/946,902 Active 2036-01-11 US9824419B2 (en) 2015-11-20 2015-11-20 Automatically enabling a read-only cache in a language in which two arrays in two different variables may alias each other
US15/604,553 Expired - Fee Related US10163189B2 (en) 2015-11-20 2017-05-24 Automatically enabling a read-only cache in a language in which two arrays in two different variables may alias each other
US15/792,822 Expired - Fee Related US10387994B2 (en) 2015-11-20 2017-10-25 Automatically enabling a read-only cache in a language in which two arrays in two different variables may alias each other

Family Applications Before (2)

Application Number Title Priority Date Filing Date
US14/946,902 Active 2036-01-11 US9824419B2 (en) 2015-11-20 2015-11-20 Automatically enabling a read-only cache in a language in which two arrays in two different variables may alias each other
US15/604,553 Expired - Fee Related US10163189B2 (en) 2015-11-20 2017-05-24 Automatically enabling a read-only cache in a language in which two arrays in two different variables may alias each other

Country Status (1)

Country Link
US (3) US9824419B2 (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9824419B2 (en) * 2015-11-20 2017-11-21 International Business Machines Corporation Automatically enabling a read-only cache in a language in which two arrays in two different variables may alias each other
US11755327B2 (en) 2020-03-02 2023-09-12 Microsoft Technology Licensing, Llc Delivering immediate values by using program counter (PC)-relative load instructions to fetch literal data in processor-based devices

Citations (29)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6260190B1 (en) 1998-08-11 2001-07-10 Hewlett-Packard Company Unified compiler framework for control and data speculation with recovery code
US6292880B1 (en) 1998-04-15 2001-09-18 Inktomi Corporation Alias-free content-indexed object cache
US6496907B1 (en) * 1999-10-22 2002-12-17 Apple Computer, Inc. System and method for updating from a read-only to a read-write entry and concurrently invalidating stale cache copies from head-to-tail and tail-to-head directions
US20030145190A1 (en) 2001-12-07 2003-07-31 Paolo Faraboschi Compiler algorithm to implement speculative stores
US6658578B1 (en) * 1998-10-06 2003-12-02 Texas Instruments Incorporated Microprocessors
US20040177261A1 (en) * 2002-11-18 2004-09-09 Watt Simon Charles Control of access to a memory by a device
US7434031B1 (en) * 2004-04-12 2008-10-07 Sun Microsystems, Inc. Execution displacement read-write alias prediction
US20090037690A1 (en) 2007-08-03 2009-02-05 Nema Labs Ab Dynamic Pointer Disambiguation
US20090077329A1 (en) 2007-07-11 2009-03-19 Wood David A Non-broadcast signature-based transactional memory
US7784037B2 (en) * 2006-04-14 2010-08-24 International Business Machines Corporation Compiler implemented software cache method in which non-aliased explicitly fetched data are excluded
US20120079201A1 (en) 2010-09-24 2012-03-29 William James Dally System and method for explicitly managing cache coherence
CN102541761A (en) 2012-01-17 2012-07-04 苏州国芯科技有限公司 Read-only cache memory applying on embedded chips
US8312219B2 (en) * 2009-03-02 2012-11-13 International Business Machines Corporation Hybrid caching techniques and garbage collection using hybrid caching techniques
US20120311290A1 (en) 2011-06-01 2012-12-06 Sean White Systems and methods for executing device control
US20130019232A1 (en) * 2011-07-12 2013-01-17 International Business Machines Corporation Managing aliasing constraints
US20130275682A1 (en) * 2011-09-30 2013-10-17 Raj K. Ramanujan Apparatus and method for implementing a multi-level memory hierarchy over common memory channels
US20130290597A1 (en) * 2011-09-30 2013-10-31 Intel Corporation Generation of far memory access signals based on usage statistic tracking
US20140006696A1 (en) * 2011-12-20 2014-01-02 Raj K. Ramanujan Apparatus and method for phase change memory drift management
US20140040550A1 (en) * 2011-09-30 2014-02-06 Bill Nale Memory channel that supports near memory and far memory access
US20140143577A1 (en) * 2011-12-22 2014-05-22 Murugasamy K. Nachimuthu Power conservation by way of memory channel shutdown
US20140204663A1 (en) * 2011-12-22 2014-07-24 Robert W. Faber Efficient pcms refresh mechanism
US20140229659A1 (en) * 2011-12-30 2014-08-14 Marc T. Jones Thin translation for system access of non volatile semicondcutor storage as random access memory
US20140281240A1 (en) * 2013-03-15 2014-09-18 Thomas Willhalm Instructions To Mark Beginning and End Of Non Transactional Code Region Requiring Write Back To Persistent Storage
US20140297919A1 (en) * 2011-12-21 2014-10-02 Murugasamy K Nachimuthu Apparatus and method for implementing a multi-level memory hierarchy
US20140304475A1 (en) * 2011-12-20 2014-10-09 Raj K Ramanujan Dynamic partial power down of memory-side cache in a 2-level memory hierarchy
US20150058567A1 (en) 2013-08-26 2015-02-26 Advanced Micro Devices, Inc. Hierarchical write-combining cache coherence
US20150149745A1 (en) * 2013-11-25 2015-05-28 Markus Eble Parallelization with controlled data sharing
US20150286472A1 (en) * 2014-04-04 2015-10-08 Qualcomm Incorporated Memory reference metadata for compiler optimization
US20170148132A1 (en) * 2015-11-20 2017-05-25 International Business Machines Corporation Automatically enabling a read-only cache in a language in which two arrays in two different variables may alias each other

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP3220055B2 (en) * 1997-07-17 2001-10-22 松下電器産業株式会社 An optimizing device for optimizing a machine language instruction sequence or an assembly language instruction sequence, and a compiler device for converting a source program described in a high-level language into a machine language or an assembly language instruction sequence.
US6640293B1 (en) * 2000-07-24 2003-10-28 International Business Machines Corporation Apparatus and method of utilizing Alias Hit signals to detect errors within the real address tag arrays
US8527974B2 (en) * 2008-03-28 2013-09-03 International Business Machines Corporation Data transfer optimized software cache for regular memory references
US8589887B2 (en) * 2010-10-20 2013-11-19 International Business Machines Corporation Registration-based remote debug watch and modify
US9052824B2 (en) * 2012-01-26 2015-06-09 Upthere, Inc. Content addressable stores based on sibling groups

Patent Citations (30)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6292880B1 (en) 1998-04-15 2001-09-18 Inktomi Corporation Alias-free content-indexed object cache
US6260190B1 (en) 1998-08-11 2001-07-10 Hewlett-Packard Company Unified compiler framework for control and data speculation with recovery code
US6658578B1 (en) * 1998-10-06 2003-12-02 Texas Instruments Incorporated Microprocessors
US6496907B1 (en) * 1999-10-22 2002-12-17 Apple Computer, Inc. System and method for updating from a read-only to a read-write entry and concurrently invalidating stale cache copies from head-to-tail and tail-to-head directions
US20030145190A1 (en) 2001-12-07 2003-07-31 Paolo Faraboschi Compiler algorithm to implement speculative stores
US20040177261A1 (en) * 2002-11-18 2004-09-09 Watt Simon Charles Control of access to a memory by a device
US7434031B1 (en) * 2004-04-12 2008-10-07 Sun Microsystems, Inc. Execution displacement read-write alias prediction
US7784037B2 (en) * 2006-04-14 2010-08-24 International Business Machines Corporation Compiler implemented software cache method in which non-aliased explicitly fetched data are excluded
US20090077329A1 (en) 2007-07-11 2009-03-19 Wood David A Non-broadcast signature-based transactional memory
US20090037690A1 (en) 2007-08-03 2009-02-05 Nema Labs Ab Dynamic Pointer Disambiguation
US8312219B2 (en) * 2009-03-02 2012-11-13 International Business Machines Corporation Hybrid caching techniques and garbage collection using hybrid caching techniques
US20120079201A1 (en) 2010-09-24 2012-03-29 William James Dally System and method for explicitly managing cache coherence
US20120311290A1 (en) 2011-06-01 2012-12-06 Sean White Systems and methods for executing device control
US20130019232A1 (en) * 2011-07-12 2013-01-17 International Business Machines Corporation Managing aliasing constraints
US10241943B2 (en) * 2011-09-30 2019-03-26 Intel Corporation Memory channel that supports near memory and far memory access
US20130275682A1 (en) * 2011-09-30 2013-10-17 Raj K. Ramanujan Apparatus and method for implementing a multi-level memory hierarchy over common memory channels
US20130290597A1 (en) * 2011-09-30 2013-10-31 Intel Corporation Generation of far memory access signals based on usage statistic tracking
US20140040550A1 (en) * 2011-09-30 2014-02-06 Bill Nale Memory channel that supports near memory and far memory access
US20140006696A1 (en) * 2011-12-20 2014-01-02 Raj K. Ramanujan Apparatus and method for phase change memory drift management
US20140304475A1 (en) * 2011-12-20 2014-10-09 Raj K Ramanujan Dynamic partial power down of memory-side cache in a 2-level memory hierarchy
US20140297919A1 (en) * 2011-12-21 2014-10-02 Murugasamy K Nachimuthu Apparatus and method for implementing a multi-level memory hierarchy
US20140143577A1 (en) * 2011-12-22 2014-05-22 Murugasamy K. Nachimuthu Power conservation by way of memory channel shutdown
US20140204663A1 (en) * 2011-12-22 2014-07-24 Robert W. Faber Efficient pcms refresh mechanism
US20140229659A1 (en) * 2011-12-30 2014-08-14 Marc T. Jones Thin translation for system access of non volatile semicondcutor storage as random access memory
CN102541761A (en) 2012-01-17 2012-07-04 苏州国芯科技有限公司 Read-only cache memory applying on embedded chips
US20140281240A1 (en) * 2013-03-15 2014-09-18 Thomas Willhalm Instructions To Mark Beginning and End Of Non Transactional Code Region Requiring Write Back To Persistent Storage
US20150058567A1 (en) 2013-08-26 2015-02-26 Advanced Micro Devices, Inc. Hierarchical write-combining cache coherence
US20150149745A1 (en) * 2013-11-25 2015-05-28 Markus Eble Parallelization with controlled data sharing
US20150286472A1 (en) * 2014-04-04 2015-10-08 Qualcomm Incorporated Memory reference metadata for compiler optimization
US20170148132A1 (en) * 2015-11-20 2017-05-25 International Business Machines Corporation Automatically enabling a read-only cache in a language in which two arrays in two different variables may alias each other

Non-Patent Citations (8)

* Cited by examiner, † Cited by third party
Title
Hogg, "Islands: Aliasing Protection in Object-Oriented Languages", 1991, OOPSLA '91 Conference proceedings on Objectoriented programming systems, languages, and applications, Oct. 1991, pp. 271-285.
Ishizaki et al., "Compiling and Optimizing Java 8 Programs for GPU Execution", 2015, 2015 International Conference on Parallel Architecture and Compilation, pp. 419-431 (Year: 2015). *
List of IBM Patents or Patent Applications Treated as Related dated Oct. 25, 2017, 2 pages.
Notice of Allowance dated Jul. 20, 2018 for U.S. Appl. No. 15/604,553, 14 pages.
Pai et al., "Fast and Efficient Automatic Memory Management for GPUs using Compiler-Assisted Runtime Coherence Scheme", 2012, PACT '12 Proceedings of the 21st international conference on Parallel architectures and compilation techniques, pp. 33-42 (Year: 2012). *
Skoglund et al., "Alias Control with Read-only References", 2002, Proceedings of the 6th Joint Conference on Information Sciences.-Durham: Assoc Intelligent Machinery, Mar. 2002, pp. 1-5.
Skoglund et al., "Alias Control with Read-only References", 2002, Proceedings of the 6th Joint Conference on Information Sciences.—Durham: Assoc Intelligent Machinery, Mar. 2002, pp. 1-5.
U.S. Office Action issued in U.S. Appl. No. 15/604,553 dated Dec. 14, 2017, 21 pages.

Also Published As

Publication number Publication date
US10163189B2 (en) 2018-12-25
US20180047134A1 (en) 2018-02-15
US20170256028A1 (en) 2017-09-07
US9824419B2 (en) 2017-11-21
US20170148132A1 (en) 2017-05-25

Similar Documents

Publication Publication Date Title
US11163828B2 (en) Building and querying hash tables on processors
US9665394B2 (en) Sharing application objects among multiple tenants
US9804995B2 (en) Computational resource pipelining in general purpose graphics processing unit
US11029924B2 (en) Program optimization by converting code portions to directly reference internal data representations
US10061568B2 (en) Dynamic alias checking with transactional memory
US10884899B2 (en) Optimized trampoline design for fast software tracing
US10387994B2 (en) Automatically enabling a read-only cache in a language in which two arrays in two different variables may alias each other
US10176083B2 (en) Code coverage through overlay hooks
US8806457B2 (en) Deferred constant pool generation
US10769063B2 (en) Spin-less work-stealing for parallel copying garbage collection
US20190220294A1 (en) Using lightweight jit compilation for short-lived jvms on parallel distributing computing framework
US10528401B1 (en) Optimizing accesses to read-mostly volatile variables
US10416975B2 (en) Compiling a parallel loop with a complex access pattern for writing an array for GPU and CPU
US10223088B2 (en) Method for defining alias sets
US10782973B2 (en) Optimizing branch re-wiring in a software instruction cache
US11398004B2 (en) Allocating device buffer on GPGPU for an object with metadata using access boundary alignment
US9747146B2 (en) Method and system for memory access protection
US9389865B1 (en) Accelerated execution of target of execute instruction
US20210406175A1 (en) Shared memory workloads using existing network fabrics
US10387229B2 (en) Reducing cost of deserialization by skipping unused array regions
US20130318509A1 (en) Generating object code from a conjoined assembler directive

Legal Events

Date Code Title Description
AS Assignment

Owner name: INTERNATIONAL BUSINESS MACHINES CORPORATION, NEW Y

Free format text: ASSIGNMENT OF ASSIGNORS INTEREST;ASSIGNOR:ISHIZAKI, KAZUAKI;REEL/FRAME:043941/0503

Effective date: 20151118

FEPP Fee payment procedure

Free format text: ENTITY STATUS SET TO UNDISCOUNTED (ORIGINAL EVENT CODE: BIG.); ENTITY STATUS OF PATENT OWNER: LARGE ENTITY

STPP Information on status: patent application and granting procedure in general

Free format text: RESPONSE TO NON-FINAL OFFICE ACTION ENTERED AND FORWARDED TO EXAMINER

STPP Information on status: patent application and granting procedure in general

Free format text: NOTICE OF ALLOWANCE MAILED -- APPLICATION RECEIVED IN OFFICE OF PUBLICATIONS

STPP Information on status: patent application and granting procedure in general

Free format text: PUBLICATIONS -- ISSUE FEE PAYMENT VERIFIED

STCF Information on status: patent grant

Free format text: PATENTED CASE

FEPP Fee payment procedure

Free format text: MAINTENANCE FEE REMINDER MAILED (ORIGINAL EVENT CODE: REM.); ENTITY STATUS OF PATENT OWNER: LARGE ENTITY

LAPS Lapse for failure to pay maintenance fees

Free format text: PATENT EXPIRED FOR FAILURE TO PAY MAINTENANCE FEES (ORIGINAL EVENT CODE: EXP.); ENTITY STATUS OF PATENT OWNER: LARGE ENTITY

STCH Information on status: patent discontinuation

Free format text: PATENT EXPIRED DUE TO NONPAYMENT OF MAINTENANCE FEES UNDER 37 CFR 1.362

FP Lapsed due to failure to pay maintenance fee

Effective date: 20230820