/dcompute

Native execution of D on GPUs

Primary LanguageDBoost Software License 1.0BSL-1.0

dcompute

Latest version Latest version License Gitter

About

This project is a set of libraries designed to work with ldc to enable native execution of D on GPUs (and other more exotic targets of OpenCL such as FPGAs DSPs, hereafter just 'GPUs') on the OpenCL and CUDA runtimes.

There are three main parts

  • A standard library 'std' containing standard functionality for targetting GPUs, an abstraction layer over the intrinsics.
  • A driver library to handle all the compute API interactions and provide a friendly, easy-to-use, consistent interface. Of course you can always get down to a lower level of interaction if you need to.
  • A set of standard kernels and primitives to cover a large number of use cases and serve as documentation on how (and how not) to use this library.

Build Instructions

To build DCompute you will need:

  • ldc as the D dcompiler.
  • a SPIRV capable LLVM (available here to build ldc to to support SPIRV (required for OpenCL)).
  • or LDC built with any LLVM 3.9.1 or greater that has the NVPTX backend enabled, to support CUDA.
  • dub and then just run $dub build or add "dcompute": "~>0.0.1" to your dub.json or dependency "dcompute" version="~>0.0.1" to your dub.sdl.

A dmd compatible d compiler,dmd, ldmd or gdmd (available as part of ldc and gdc respectively), and cmake for building ldc is also required if you need to build ldc yourself.

Getting Started

Please see the wiki.

TODO

Generate OpenCL builtins from here

Get D versions of the OpenCL and CUDA APIs so that work can begin on a unified D driver API.

Add code examples to the readme.