Introduction

The Platform-Neutral Compute Intermediate Language, or PENCIL, is a C99-based language developed as part of the CARP Project. A key goal of the language is to serve as an intermediate language for the compilation of domain-specific languages. The PENCIL representation can then be compiled into efficient, device-specific OpenCL code using a PENCIL-to-OpenCL compiler such as PPCG. This eliminates the need for the DSL implementer to develop different platform-specific backends: all that is needed to target different platforms is a PENCIL backend!

The PENCIL Scala library

The PENCIL repository contains a Scala library that can be used to implement a PENCIL backend for a DSL compiler. The library provides the following: This library significantly simplifies the development process of targeting a DSL to PENCIL, by providing an API for building, manipulating, and printing the PENCIL intermediate representation.

Using the PENCIL Scala library

Useful links