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 therefore 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 C++ library LLAMA, which 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. Providing two close-to-life examples, we show that the LLAMA-generated AoS (Array of Struct) and SoA (Struct of Array) layouts produce identical code with the same performance characteristics as manually written data structures. LLAMA's layout-aware copy routines can significantly speed up transfer and reshuffling of data between layouts compared with naive element-wise copying. The library is fully extensible with third-party allocators and allows users to support their own memory layouts with custom mappings.


翻译:CPU 和 内存之间的性能差距会持续扩大。 选择每个硬件架构的最佳内存布局越来越重要, 因为越来越多的程序将内存捆绑起来。 对于跨多种硬件架构运行的便携式代码, 因此数据结构的内存布局的选择最好与程序的其余部分脱钩。 这可以通过零运行时间覆盖式的抽象层实现, 在这种层下可以自由交换内存布局。 我们展示了 C++ 图书馆 LLAMAMA, 它提供了这样的数据结构抽象层, 并且为嵌套、 结构化数据的多维数阵列提供了示例。 LLAMAMA 提供了定义和转换用户定义数据类型自定义的自定义内存布局的完全C+兼容方法。 我们提供了两个近寿命示例。 我们显示, LMA 生成的 AoS (Struct Array) 和 SoA (Array) 版布局可以产生与手动数据结构相同的性能特性相同的代码。 LLNAMA 的布局认知复制程序可以大大加快用户之间的传输和重新配置数据布局间数据布局的功能布局与所有用户之间的自动平版图支持。

0
下载
关闭预览

相关内容

专知会员服务
61+阅读 · 2020年3月19日
Keras François Chollet 《Deep Learning with Python 》, 386页pdf
专知会员服务
163+阅读 · 2019年10月12日
机器学习入门的经验与建议
专知会员服务
94+阅读 · 2019年10月10日
【SIGGRAPH2019】TensorFlow 2.0深度学习计算机图形学应用
专知会员服务
41+阅读 · 2019年10月9日
Transferring Knowledge across Learning Processes
CreateAMind
29+阅读 · 2019年5月18日
Deep Compression/Acceleration:模型压缩加速论文汇总
极市平台
14+阅读 · 2019年5月15日
强化学习的Unsupervised Meta-Learning
CreateAMind
18+阅读 · 2019年1月7日
Unsupervised Learning via Meta-Learning
CreateAMind
43+阅读 · 2019年1月3日
【NIPS2018】接收论文列表
专知
5+阅读 · 2018年9月10日
Arxiv
0+阅读 · 2021年7月30日
Accelerated Methods for Deep Reinforcement Learning
Arxiv
6+阅读 · 2019年1月10日
VIP会员
相关VIP内容
专知会员服务
61+阅读 · 2020年3月19日
Keras François Chollet 《Deep Learning with Python 》, 386页pdf
专知会员服务
163+阅读 · 2019年10月12日
机器学习入门的经验与建议
专知会员服务
94+阅读 · 2019年10月10日
【SIGGRAPH2019】TensorFlow 2.0深度学习计算机图形学应用
专知会员服务
41+阅读 · 2019年10月9日
相关资讯
Transferring Knowledge across Learning Processes
CreateAMind
29+阅读 · 2019年5月18日
Deep Compression/Acceleration:模型压缩加速论文汇总
极市平台
14+阅读 · 2019年5月15日
强化学习的Unsupervised Meta-Learning
CreateAMind
18+阅读 · 2019年1月7日
Unsupervised Learning via Meta-Learning
CreateAMind
43+阅读 · 2019年1月3日
【NIPS2018】接收论文列表
专知
5+阅读 · 2018年9月10日
Top
微信扫码咨询专知VIP会员