View Full Version : OpenCL: Headers [Updated Sep 15 2011]

Petr Schreiber
01-12-2009, 10:00
This post contains maintained headers for OpenCL, usable both for OpenCL 1.0 and OpenCL 1.1 applications.
It consists of official headers translations, named:


Then there are two headers I added for more coding comfort:

cl_thinBasic_ext.tBasicU - adds low level functionality
cl_thinBasic_highlevel.tBasicU - adds high level functionality for RAD

The new headers offer multiple advantages over my previous release from past year:

OpenCL 1.1 functionality added
Pointer parameters in C originals are handled via ByRef in ThinBASIC. If you still want to pass pointer, just use ByVal override.
OpenCL types are ported as tCL_* (cl_mem becomes tCL_mem). The original names could not be preserved, as they would collide due to fact ThinBASIC is not case sensitive. I think it is still better than previous long type_cl_ prefix.
Constants are ported as they are in C, no % is added, making the adaptation of codes from C originals smoother
Some bugs in original translation fixed
Extensions changed from Inc to tBasicU

Important note: Please unzip the attachement to your ThinBASIC/Inc directory.

I hope the headers serve you well, and wish you all happy GPGPU coding!


Petr Schreiber
15-09-2011, 11:00
Updated the clImageGet4ByteStringTHINBASIC function from cl_thinbasic_ext.tBasicU to return images in original quality.
This positively affects the OpenCL: Image Processing Test (http://www.thinbasic.com/community/showthread.php?10327-OpenCL-Image-Processing-Test-Updated-Sep-04-2011) sample, which can now process bigger images without quality loss.