C Framework for OpenCL


The C Framework for OpenCL, cf4ocl , is a cross-platform pure C object-oriented framework for developing and benchmarking OpenCL projects. It aims to:

  1. Promote the rapid development of OpenCL host programs in C (with support for C++) and avoid the tedious and error-prone boilerplate code usually required.
  2. Assist in the benchmarking of OpenCL events, such as kernel execution and data transfers. Profiling comes for free with cf4ocl .
  3. Simplify the analysis of the OpenCL environment and of kernel requirements.
  4. Allow for all levels of integration with existing OpenCL code: use as much or as few of cf4ocl required for your project, with full access to the underlying OpenCL objects and functions at all times.


  • Object-oriented interface to the OpenCL API
  • New/destroy functions, no direct memory alloc/free
  • Easy (and extensible) device selection
  • Simple event dependency mechanism
  • User-friendly error management
  • OpenCL version and platform independent
  • Integrated profiling
  • Advanced device query utility
  • Offline kernel compiler and linker

Official website: http://fakenmc.github.io/cf4ocl/

Hope that helps or, at least, inspires.

1 Like

Haiku have no OpenCL support.