English

cf4ocl: a C framework for OpenCL

Distributed, Parallel, and Cluster Computing 2017-05-16 v3

Abstract

OpenCL is an open standard for parallel programming of heterogeneous compute devices, such as GPUs, CPUs, DSPs or FPGAs. However, the verbosity of its C host API can hinder application development. In this paper we present cf4ocl, a software library for rapid development of OpenCL programs in pure C. It aims to reduce the verbosity of the OpenCL API, offering straightforward memory management, integrated profiling of events (e.g., kernel execution and data transfers), simple but extensible device selection mechanism and user-friendly error management. We compare two versions of a conceptual application example, one based on cf4ocl, the other developed directly with the OpenCL host API. Results show that the former is simpler to implement and offers more features, at the cost of an effectively negligible computational overhead. Additionally, the tools provided with cf4ocl allowed for a quick analysis on how to optimize the application.

Keywords

Cite

@article{arxiv.1609.01257,
  title  = {cf4ocl: a C framework for OpenCL},
  author = {Nuno Fachada and Vitor V. Lopes and Rui C. Martins and Agostinho C. Rosa},
  journal= {arXiv preprint arXiv:1609.01257},
  year   = {2017}
}

Comments

The peer-reviewed version of this paper is published in Science of Computer Programming at http://www.sciencedirect.com/science/article/pii/S0167642317300540 . This version is typeset by the authors and differs only in pagination and typographical detail

R2 v1 2026-06-22T15:40:24.314Z