@inproceedings {futhark/sc22mem, author = {P. Munksgaard and T. Henriksen and P. Sadayappan and C. Oancea}, booktitle = {2022 SC22: International Conference for High Performance Computing, Networking, Storage and Analysis (SC) (SC)}, title = {Memory Optimizations in an Array Language}, year = {2022}, volume = {}, issn = {2167-4337}, pages = {424-438}, abstract = {We present a technique for introducing and optimizing the use of memory in a functional array language, aimed at GPU execution, that supports correct-by-construction parallelism. Using linear memory access descriptors as building blocks, we define a notion of memory in the compiler IR that enables cost-free change-of-layout transformations (e.g., slicing, transposition), whose results can even be carried across control flow such as ifs/loops without manifestation in memory. The memory notion allows a graceful transition to an unsafe IR that is automatically optimized (1) to mix reads and writes to the same array inside a parallel construct, and (2) to map semantically different arrays to the same memory block. The result is code similar to what imperative users would write. Our evaluation shows that our optimizations have significant impact (1:1–2) and result in performance competitive to hand-written code from challenging benchmarks, such as Rodinia’s NW, LUD, Hotspot.}, keywords = {gpu;parallelism;functional programming;optimizing compiler}, doi = {}, url = {https://doi.ieeecomputersociety.org/}, publisher = {IEEE Computer Society}, address = {Los Alamitos, CA, USA}, month = {nov} }