-
Notifications
You must be signed in to change notification settings - Fork 0
Nikola Architecture
Here we attempt to document the architecture of Nikola, yielding both an overview and an understanding of the details.
Protip: use graphmod from hackage to generate a graphwiz file of Nikola source, and a tool such as zgrviewer to inspect it (both are in the dybberplc
dropbox folder)
This module defines the first-order AST, S.Exp
.
This module defines a thin newtype wrapper E.Exp t a
around S.Exp
. t
,a
are phantom types with t
refering to target (eg. CUDA
) and a
refering to
the expected type resulting from evaluating the E.Exp
.
-
Data.Array.Nikola.Backend.C.Codegen
Actual C code generation happens here through
compileProgram
. CUDA is treated as a variant of C, as determined by aDialect
enum type. Still, only host code is compiled, but with the (dialect extension?) ability to call cuda kernels.Code generation happens inside the
C
monad, described below: -
Data.Array.Nikola.Backend.C.Monad
-
Compilable
typeclass