Code Monkey home page Code Monkey logo

dusk's Introduction

dusk

A minimal and lightweight front-end for dawn.

Dusk translates a subset of Python code (a Python embedded domain specific language - eDSL) to SIR. Its purpose is to allow quick prototyping of dawn's unstructured features for internal experiments.

Dusk is currently in an experimental state. Examples are available here: tests/examples/

Requirements

Installation

It is highly recommended to use a virtual env for development:

python -m venv virtual_env # create virtual env
source virtual_env/bin/activate # activate virtual env

Then dusk can be directly installed from github via pip (this will also install dawn4py):

pip install dusk@git+https://github.com/dawn-ico/dusk.git

Usage

The package will install a dusk command-line tool which can be used to compile dusk stencils:

dusk --help

and a pipeable dusk-front tool:

dusk-front --help

The output of dusk-front is Dawn's SIR (in JSON format), which is intended to be piped to the tools in the Dawn's toolchain in order to obtain generated code, e.g.

dusk-front ./tests/examples/laplacian_fvm.py | dawn-opt | dawn-codegen -b naive-ico

This allows to pass arguments to dawn-opt and dawn-codegen (for example to enable/configure optimizations). If one doesn't need such customization, a simpler way to obtain generated code is by using the dusk tool, which also allows backend selection (-b option). Example:

dusk -b ico-cuda -o ./laplacian_fd_cuda.cpp ./tests/examples/laplacian_fd.py

Overview

  • tests/examples/ - Examples of the dusk eDSL
  • dusk/script/__init__.py - Contains definitions & mocks for dusk
  • dusk/cli.py - Implements a basic command line interface to compile dusk stencils to generated code
  • dusk/front.py - Implements a basic command line interface to compile dusk stencils to SIR
  • dusk/transpile.py - Provides a programmatic interface to compile dusk stencils
  • dusk/grammar.py - Implements most of the transformations for Python AST to SIR utilizing the matching framework
  • dusk/semantics.py - Provides infrastructure to support dusk's semantics (used by the grammar)
  • dusk/match.py - Implements a simple matching framework for ASTs

dusk's People

Contributors

benweber42 avatar cosunae avatar mroethlin avatar stagno avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.