README.md (1356B)
runcl
runcl
is a minimal OpenCL harness allowing image generation on the GPU by
means of executing an OpenCL file to compute the raster data.
runcl
depends on libpng
and libOpenCL
. The former should be
installed on most UNIX systems. Check your system's documentation for
instructions on how to install the latter.
runcl
was originally created to generate fractal art. A few examples of
fractal art I created with it can be found at https://pollux.codes/art.
Installation
make
sudo make install
To create a debug build, run make debug
instead of make
.
Usage
The arguments of runcl
are mostly self-explanatory:
runcl \
-p <platform-index> \
-w <image-width> \
-h <image-height> \
input-opencl-file \
output-png-file
The default image size is 640x480
.
Use clinfo
to see platform information. By default the platform with index 0
is chosen.
OpenCL File Requirements
In order for runcl
to work, the OpenCL file used must have a kernel named
render
with three arguments, const int width
, const int height
, and
__global float *out
.
See examples/gradient.cl
for a demonstration of these requirements, as well
as the suggested way of using the arguments. The other files in the examples
folder contain more sophisticated files for generating more complex images.