ODE Solver Example

ODE Solver example, OpenCLTemplate 1.10, OpenCL 1.1


As an example of system of differential equation solver using OpenCL and yet another example of OpenCL / OpenGL interoperation, I’ve updated the OpenCLTemplate Runge Kutta solver example.

Here is a video of the program whose source code is available in the CLRK46 section (check OpenCLTemplate ODE solver!):



OpenCL 1.1 Specification


Khronos Group OpenCL 1.1 Specification is out, adding significant functionality for enhanced parallel programming flexibility, functionality and performance.

Make sure to check the new specification @ http://www.khronos.org/


OpenCLTemplate 1.10 Released


These changes that I made to OpenCLTemplate are mostly to enable a program which uses Cloo (or some other binding) to use the features implemented in OpenCLTemplate. I wanted to use Cloo for the OpenCL/GL interop and OpenCLTemplate for solving differential equations.

Download OpenCLTemplate




– It is now possible to initialize OpenCLTemplate from a given Context pointer and Command Queue pointer InitCL(IntPtr ContextPtr, IntPtr CommandQueuePtr);
– It is now possible to create OpenCLTemplate program variables from existing buffers Variable(IntPtr OpenCLVarPointer, int varSize, int sizeOfType);

Differential equations solver:

– Exposed the independent variable CLCalc.Program.Variable x and state space vector CLCalc.Program.Variable y at floatODE46 and doubleODE46;
– Exposed method Step() to perform a single step of size stepsize.

Leave a Reply

Your email address will not be published. Required fields are marked *