arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 1802.06504cs.PLcs.MS
收藏

编译狄德罗:从张量演算到C

Compiling Diderot: From Tensor Calculus to C

Charisee Chiw, Gordon L. Kindlmann, John Reppy

摘要:

Diderot是一种并行的领域特定语言,用于分析和可视化多维科学图像,例如由CT和MRI扫描仪产生的图像。特别是,它支持张量场(即,从3D点到张量值的函数)用于表示由成像设备扫描的底层物理对象。狄德罗支持高阶编程,其中张量场是第一类值,微分算子和提升线性代数算子可以直接用语言表达数学推理。虽然这种提升的场操作是许多科学可视化算法的定义和计算的核心,但迄今为止,它们需要大量的手动推导和费力的实现。Diderot编译器面临的挑战是有效地将表面语言中可表达的高级数学概念转换为C中的低级有效实现。本文介绍了我们的方法来应对这一挑战,这是基于精心设计的中间表示(IR),称为EIN,和一些编译器的转换,降低程序从张量演算到C,同时避免组合爆炸的大小的IR。我们描述了在编译的挑战,如狄德罗语言,EIN的设计,和编译器所使用的转换。我们还提出了一个评价EIN的编译效率和生成代码的质量。

英文摘要:

Diderot is a parallel domain-specific language for analysis and visualization of multidimensional scientific images, such as those produced by CT and MRI scanners. In particular, it supports algorithms where tensor fields (i.e., functions from 3D points to tensor values) are used to represent the underlying physical objects that were scanned by the imaging device. Diderot supports higher-order programming where tensor fields are first-class values and where differential operators and lifted linear-algebra operators can be used to express mathematical reasoning directly in the language. While such lifted field operations are central to the definition and computation of many scientific visualization algorithms, to date they have required extensive manual derivations and laborious implementation. The challenge for the Diderot compiler is to effectively translate the high-level mathematical concepts that are expressible in the surface language to a low-level and efficient implementation in C. This paper describes our approach to this challenge, which is based around the careful design of an intermediate representation (IR), called EIN, and a number of compiler transformations that lower the program from tensor calculus to C while avoiding combinatorial explosion in the size of the IR. We describe the challenges in compiling a language like Diderot, the design of EIN, and the transformation used by the compiler. We also present an evaluation of EIN with respect to both compiler efficiency and quality of generated code.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑