Skip to content

Runtime configuration

Eric Holk edited this page Apr 22, 2014 · 2 revisions

Harlan programs have several parameters that can be controlled at runtime. Currently, these are all controlled by environment variables. Below is a list of the environment variables and what they do.

  • HARLAN_DEVICE - This can be either cpu or gpu. It fixes whether the program will run using a GPU (or accelerator) device or use an OpenCL CPU device. By default, the system will choose arbitrarily. Not all systems have both a CPU and GPU.
  • HARLAN_MIN_REGION_SIZE - Sets the minimum size for new regions. By default, this is 8KB, but some programs (particularly those that allocate a lot in kernels) may not work with this default. In these cases, the default can be overridden with this environment variable.
  • HARLAN_DISABLE_OPENCL_OPTS - Tells the OpenCL compiler not to optimize. Harlan generates code that tends to crash OpenCL compilers, so setting this environment variable to anything can be used to work around this problem.