As Processing-In-Memory (PIM) hardware matures and starts making its way into normal compute platforms, software has an important role to play in determining what to perform where, and when, on such heterogeneous systems. Taking an emerging class of PIM hardware which provisions a general purpose (RISC-V) processor at each memory bank, this paper takes on this challenging problem by developing a software compilation framework. This framework analyzes several application characteristics -parallelizability, vectorizability, data set sizes, and offload costs -to determine what, whether, when and how to offload computations to the PIM engines. In the process, it also proposes a vector engine extension to the bank-level RISC-V cores. Using several off-the-shelf C/C++ applications, we demonstrate that PIM is not always a panacea, and a framework such as ours is essential in carefully selecting what needs to be performed where, when and how. The choice of hardware platforms -number of memory banks, relative speeds and capabilities of host CPU and PIM cores, can further impact the "to PIM or not" question.
CCS CONCEPTS• Computer systems organization → Heterogeneous (hybrid) systems; • Hardware → Emerging architectures; Emerging languages and compilers.