The performance gap between CPU and memory widens continuously. Choosing the best memory layout for each hardware architecture is increasingly important as more and more programs become memory bound. For portable codes that run across heterogeneous hardware architectures, the choice of the memory layout for data structures is ideally decoupled from the rest of a program. This can be accomplished via a zero-runtime-overhead abstraction layer, underneath which memory layouts can be freely exchanged. We present the Low-Level Abstraction of Memory Access (LLAMA), a C++ library that provides such a data structure abstraction layer with example implementations for multidimensional arrays of nested, structured data. LLAMA provides fully C++ compliant methods for defining and switching custom memory layouts for user-defined data types. The library is extensible with third-party allocators. Providing two close-to-life examples, we show that the LLAMA-generated AoS (Array of Structs) and SoA (Struct of Arrays) layouts produce identical code with the same performance characteristics as manually written data structures. Integrations into the SPEC CPU\textsuperscript{\textregistered} lbm benchmark and the particle-in-cell simulation PIConGPU demonstrate LLAMA's abilities in real-world applications. LLAMA's layout-aware copy routines can significantly speed up transfer and reshuffling of data between layouts compared with naive element-wise copying. LLAMA provides a novel tool for the development of high-performance C++ applications in a heterogeneous environment.


翻译:CPU 和 内存之间的性能差距会持续扩大。 选择每个硬件架构的最佳内存布局将变得越来越重要, 因为越来越多的程序会被内存约束。 对于跨多种硬件架构运行的便携式代码, 数据结构的内存布局的选择最好与程序的其余部分脱钩。 可以通过零运行时间覆盖式的抽象层来完成, 在这种层下可以自由交换内存布局。 我们展示了低水平内存存存存存存存存存存存存存存存存存存( LLLAMA) 和 SOA 库, 提供这样的数据结构抽象层, 以及嵌套式、 结构化数据的多功能。 LLAMA 提供了完全C++A 符合定义和切换用户定义数据类型自定义内存储布局的自定义内容布局的全 C++A 方法。 提供两个接近寿命的缩略图样的缩略图, 我们显示LAMA 和SLA RODRA 的平流翻版版布局与手动式数据结构结构结构结构的硬性数据结构的硬体化性平版化内, 内, IMALMA 的内, 和SLMA IMLMA 的磁性平流平流缩缩缩缩缩缩缩图图能应用程序应用程序应用程序能能能能能能将大量平基路基路基件。

0
下载
关闭预览

相关内容

专知会员服务
22+阅读 · 2021年9月20日
【Cell】神经算法推理,Neural algorithmic reasoning
专知会员服务
27+阅读 · 2021年7月16日
Stabilizing Transformers for Reinforcement Learning
专知会员服务
56+阅读 · 2019年10月17日
【SIGGRAPH2019】TensorFlow 2.0深度学习计算机图形学应用
专知会员服务
39+阅读 · 2019年10月9日
Hierarchically Structured Meta-learning
CreateAMind
23+阅读 · 2019年5月22日
Call for Participation: Shared Tasks in NLPCC 2019
中国计算机学会
5+阅读 · 2019年3月22日
TorchSeg:基于pytorch的语义分割算法开源了
极市平台
20+阅读 · 2019年1月28日
Unsupervised Learning via Meta-Learning
CreateAMind
41+阅读 · 2019年1月3日
条件GAN重大改进!cGANs with Projection Discriminator
CreateAMind
8+阅读 · 2018年2月7日
【学习】Hierarchical Softmax
机器学习研究会
4+阅读 · 2017年8月6日
Auto-Encoding GAN
CreateAMind
7+阅读 · 2017年8月4日
强化学习 cartpole_a3c
CreateAMind
9+阅读 · 2017年7月21日
Arxiv
3+阅读 · 2019年9月5日
Learning by Abstraction: The Neural State Machine
Arxiv
6+阅读 · 2019年7月11日
Arxiv
3+阅读 · 2019年3月1日
Arxiv
9+阅读 · 2018年3月10日
VIP会员
相关资讯
Hierarchically Structured Meta-learning
CreateAMind
23+阅读 · 2019年5月22日
Call for Participation: Shared Tasks in NLPCC 2019
中国计算机学会
5+阅读 · 2019年3月22日
TorchSeg:基于pytorch的语义分割算法开源了
极市平台
20+阅读 · 2019年1月28日
Unsupervised Learning via Meta-Learning
CreateAMind
41+阅读 · 2019年1月3日
条件GAN重大改进!cGANs with Projection Discriminator
CreateAMind
8+阅读 · 2018年2月7日
【学习】Hierarchical Softmax
机器学习研究会
4+阅读 · 2017年8月6日
Auto-Encoding GAN
CreateAMind
7+阅读 · 2017年8月4日
强化学习 cartpole_a3c
CreateAMind
9+阅读 · 2017年7月21日
Top
微信扫码咨询专知VIP会员