Home

Awesome

DerelictOpenCL

A dynamic binding to OpenCL for the D Programming Language.

Please see the pages Building and Linking Derelict and Using Derelict, or information on how to build DerelictCL and load the OpenCL library at run time. In the meantime, here's some sample code.

import derelict.opencl.cl;

void main() {
    // Load the OpenCL library.
    DerelictCL.load();

    // Query platforms and devices
    ...

    // Reload the OpenCL library.
    DerelictCL.reload(<chosen_version>);

    // Load OpenCL official extensions.
    DerelictCL.loadEXT(<chosen_platform>);

    // Now OpenCL functions can be called.
    ...
}