A language for GPU computing.
Scheme C++ Python Shell Makefile C Other
Clone or download
Failed to load latest commit information.
HSBencher @ 2c0e4ec First attempt at updating for hsbencher 1.8 Apr 17, 2014
etc Commenting out the rest of the raytrace benchmark in scripts. Jun 11, 2014
examples Build a better KD-Tree by recognizing that empty space is good. Sep 29, 2015
external Updating elegant-weapons Sep 29, 2015
harlan Merge branch 'master' of github.com:eholk/harlan into kd-trees Sep 29, 2015
lib Added filter. Again, super sequential, but hopefully we'll improve it… Sep 29, 2015
rt Build a better KD-Tree by recognizing that empty space is good. Sep 29, 2015
test Merge branch 'master' of github.com:eholk/harlan into kd-trees Sep 29, 2015
travis Fixing installation scripts. Feb 25, 2014
util Importing Vicare format in compatability library. Dec 9, 2014
.gitignore Cleaning up .gitignore. Aug 8, 2014
.gitmodules Switching HSBencher to HTTPs for Travis. Apr 22, 2014
.jenkins_runBench.sh WIP: hacking on multi-result but its having problems Mar 22, 2014
.travis.yml Disabling Vicare in Travis CI (Issue #154) Sep 24, 2015
AUTHORS.txt Applying Sajith's getcwd patch. Sep 19, 2012
LICENSE Adding a license. Jun 28, 2013
Makefile Minor makefile cleanup. Jun 9, 2014
README.md Fixed minor typo Jul 16, 2015
build-benchmarks Added a script to build just the benchmarks from the OOPSLA paper. Jun 10, 2014
build-benchmarks.scm Don't include bench-raytrace.kfc in build-benchmarks. Jun 11, 2014
elegant-weapons Use elegant-weapons. Nov 2, 2011
harlan.ss Added a scheme macro that implements kernel. Nov 30, 2011
harlanc Merge branch 'bigred2' Mar 27, 2014
harlanc.scm Implemented transactional kernels. Sep 24, 2015
harlani Fixed a bug in remove-recursion. Raytracing has two objects now, alth… Mar 22, 2014
harlani.scm Add a few more harlani commands. Feb 25, 2014
load-one-pass Further splitting up languages file for better performance. Shaved ab… Apr 2, 2015
load-one-pass.scm Get rid of the big monolithic languages file. Apr 2, 2015
prebuild.ss Add a prebuild.ss file to give us finer-grained control over what we … Dec 6, 2013
run-tests Added nanopass as a submodule and a skeleton remove-lambdas pass that… Jun 24, 2013
run-tests.scm Add run-fail testspec (Issue #26) Apr 2, 2015
run_benchmarks.cabal First attempt at updating for hsbencher 1.8 Apr 17, 2014
run_benchmarks.hs Attempting to bump up the region sized used for benchmarks. Jul 14, 2014


Harlan Build Status

Harlan is a domain specific language for programming GPUs. This project serves primarily as a testbed for implementation and optimization techniques. The language is intentionally small, in order to simplify the process of exploring new analyses and optimizations.

Getting Started

Harlan is known to build and run on the following operating systems.

  • Mac OS X 10.6 (Snow Leopard)
  • Mac OS X 10.7 (Lion)
  • Mac OS X 10.8 (Mountain Lion)
  • Mac OS X 10.9 (Mavericks)
  • Various flavors of Linux

Others will probably work as well. The OpenCL included with Mac OS X has several bugs that lead to failures in some of the Harlan test cases. For the most part, these failures can be ignored.

Harlan requires an OpenCL implementation as well as a compatible Scheme. Below are several OpenCL implementations that should work.

Harlan is known to work with (Petite) Chez Scheme and Vicare. Petite Chez Scheme can be downloaded from http://www.scheme.com/download.

Once all the prerequisites are installed, you can compile and run the test suite as follows.

make check

If the tests are successful, you will see the following at the end of all the output:

All tests succeeded.

The test programs are available in the test directory. End-to-end test programs have the .kfc extension. Other extensions represent code that is valid at various intermediate passes in the compiler.

Make puts test binaries in the test.bin directory, and also saves output from test programs here. Programs may be run directly from this directory for easier debugging.

Harlan programs can be compiled manually as follows.

./harlanc hello.kfc

For debugging purposes, the -v flag can be used.

./harlanc -v hello.kfc

This causes the compiler to write out the intermediate results from each compiler pass.

Assuming the Harlan compiler is successful, the compiler will produce an executable based on the program's filename. For example, the previous example will produce the file hello, which can be executed directly.

Next Steps

The official Harlan documentation is currently held in the Harlan Wiki.

The Harlan mailing list is harlan-dev. Feel free to join this group and ask questions of the Harlan developers and other Harlan users.

Directory Structure

Here is a quick overview of the various directories included in this repository.

  • HSBencher - a utility to automatically run and report the results of Harlan benchmarks.
  • etc - miscellaneous tools, including an Emacs mode for Harlan files.
  • external - the location of several git submodules, including the Nanopass Framework and Elegant Weapons.
  • harlan - the source code for the Harlan compiler.
  • lib - the standard library for Harlan.
  • rt - the runtime library for Harlan.
  • test - Harlan test cases and benchmarks.
  • test.bin - Harlan's test runner (run-tests.scm) stores the compiled binaries and program output for the test cases here.
  • travis - support files for running Harlan's test suite under Travis CI.
  • util - miscellaneous Scheme files, including compatability shims for different Scheme implementations.