The CLAW Compiler is the reference compiler for the claw directive language. The project can be found here: claw-compiler
The current specification can be found here: CLAW specification document
The specification is written using LaTeX. To generate the PDF document, you
can use pdflatex
with the following command:
cd documentation
pdflatex claw_language_specifications.tex
- Iteration 0.1:
- Define low-level block transformation.
- Loop transformations.
- Remove transformation.
- Define low-level block transformation.
- Iteration 0.2:
- Refine low-level transformation from 0.1 if needed.
- Add
collapse
clause to loop-fusion directive.
- Add
- Add missing low-level transformation from the requirements.
- Add loop transformation
loop-hoist
. - Add array notation transformation
array-transform
. - Add claw transformation
kcache
for column caching. - Add claw transformation
call
for on the fly computation (array access to function call).
- Add loop transformation
- Start to abstract low-level transformation.
- Introduction of the
parallelize
directive with thedefine dimension
andforward
clauses
- Introduction of the
- Refine low-level transformation from 0.1 if needed.
- Iteration 0.3:
- Refine previous iterations, especially
parallelize
directive.
- Refine previous iterations, especially
- Iteration 0.4:
- Refine previous iterations, especially
parallelize
directive. - Add conditional extraction
if-extract
- Refine previous iterations, especially
The directives are either local or global.
- Local directive: those directives have a limited impact on a local block of code (for example, only in a subroutine)
- Global directive: those directives can have an impact on the whole application.
This language is separated in the followings sections:
- CLAW abstraction
(specific abstraction for climate system modeling build on the top of other
directives)
- k caching (column caching)
- on the fly computation (array access to function call)
- Loop transformation
- loop fusion
- loop interchange/reordering
- loop extraction
- loop hoisting
- conditional extraction
- OpenACC/OpenMP abstractions/helpers
- array notation to do statement
- conditional primitive directive
- Utilities
- remove
- ignore
- verbatim
CLAW directives can be defined on several line. The syntax is described in the listing below:
!$claw directive options &
!$claw options
The claw directives can be combined together. For example, loop-fusion and loop-interchange can be used together in a group of nested loops.
The interpretation order of the directives is the following:
- ignore
- remove
- primitive
- array-transform
- loop-extract
- loop-hoist
- loop-fusion
- loop-interchange
- on-the-fly
- kcache
- if-extract
- parallelize
- parallelize-forward
- formatting transformation (internal transformation only)
Users must be aware that directives transformation are applied sequentially and therefore, a transformation can be performed on already transformed code.
Logo by adrienbachmann.ch