Files
astaroth/acc
jpekkila f8cd571323 Now CMake and compilation flags are functionally equivalent with the current master branch, not taking into account the deprecated flags. Also various small improvements to building.
Deprecated flags:
        * BUILD_DEBUG. This was redundant since CMake also has such flag. The build type can now be switched by passing -DCMAKE_BUILD_TYPE=<Release|Debug|RelWithDebugInfo|...> to cmake. See CMake documentation on CMAKE_BUILD_TYPE on all av
        * BUILD_UTILS. The utility library is now always built along the core library. We can reintroduce this flag if needed when the library grows larger. Currently MPI functions depend on Utils and without the flag we don't have to worr
        * BUILD_RT_VISUALIZATION. RT visualization has been dormant for a while and I'm not even sure if it works any more. Eventually the RT library should be generalized and moved to Utils at some point. Disabled the build flag for the t
2020-01-24 07:00:49 +02:00
..
2020-01-23 18:08:06 +02:00
2020-01-14 21:37:56 +02:00

ACC - Astaroth Code Compiler

ACC is a source-to-source compiler for generating CUDA kernels from programs written in Astaroth Code (AC). This document focuses on how to build and run the compiler. For detailed description of code generation and compilation phases, we refer the reader to J. Pekkilä, Astaroth: A Library for Stencil Computations on Graphics Processing Units. 2019., Section 4.3. We refer the reader to Specification for a detailed description of AC syntax.

ACC is automatically compiled and invoked when compiling the Astaroth Library, user intervention is not needed. The instructions presented in this file are only for developers looking to debug the AC compiler.

Dependencies

gcc flex bison

Building

  1. mkdir build
  2. cd build
  3. cmake ..
  4. make -j

Usage

Script compile_acc_module.sh executes all compilation stages from preprocessing to linking AC standard libraries. The resulting cuda headers are placed in the current working directory. The script should be invoked as follows.

./compile_acc_module <a directory containing AC files>

For preprocessing only, see preprocess.sh. The first parameter is regarded as the AC source file, while rest of the parameters are passed to gcc. For example:

./preprocess.sh file.ac -I dir

Preprocesses file.ac and searches dir for files to be included.

For invoking the code generator, pass preprocessed files that respect AC syntax to acc.

For example:

acc < file.ac.preprocessed

See Building on how to obtain acc.