Home Page

Project Page (


Latest version

SVN Repository


Douglas A. Augusto daaugusto at

Get Immune-inspired Instance Selection at Fast, secure and Free Open Source software downloads

Last updated on Tue Dec 26 15:44:26 2011.


Genetic Programming in OpenCL is a parallel implementation of genetic programming targeted at heterogeneous devices, such as CPU and GPU. It is written in OpenCL, an open standard for portable parallel programming across many computing platforms.

Running GPOCL


In order to compile gpocl you must have installed the following tools:


Building using an out-of-source approach is recommended. To do so, within the root gpocl directory:

 cd build
 cmake ..

This should leave in the build directory an executable file called gpocl.


Usage: gpocl [-cpu [n] | -gpu <fpi|ppcu|pppe>] [OPTION] <data points>

General options:
  -v, --verbose
     print gpocl version and exit
  -h, --help
     print this help and exit

Genetic Programming options:
  -p <p1,...,pn>, --primitives <p1,...,pn>
     GP primitives (operators/operands) [default = +,-,*,/,neg,ephemeral]
  -pp, --print-primitives
     Print all available GP primitives
  -g <n>, --generations <n>
     number of generations, n>0 [default = 1000]
  -s <n>, --seed <n>
     GP initialization seed, n>=0 [default = 0, random]
  -ps <n>, --population-size <n>
     number of individuals [default = 1024]
  -cp <f>, --crossover-probability <f>
     crossover probability, 0.0<=f<=1.0 [default = 0.95]
  -mp <f>, --mutation-probability <f>
     mutation probability, 0.0<=f<=1.0 [default = 0.10]
  -sp <n>, --seletion-pressure <n>
     selection pressure (tournament size), n>=1 [default = 3]
  -es <n>, --elitism-size <n>
     elitism size, 0<=n<=1 [default = 1]
  -max <n>, --maximum-size <n>
     maximum program size [default = 20]
  -min <n>, --minimum-size <n>
     minimum program size [default = 1]
  -et <n>, --error-tolerance <f>
     tolerance of error (stop criterion) [default = none]

OpenCL options:
  -cl-mls <n>, --cl-maximum-local-size <n>


After having compiled gpocl, to run it do:

   ./gpocl -v ../datasets/fibonacci.csv

This will run gpocl using all cpu cores. To use a specific number of cores do

   ./gpocl -v ../datasets/fibonacci.csv -cpu 2

if you want, for instance, to use only two cores.

To run on the GPU, do:

   ./gpocl -v ../datasets/fibonacci.csv -gpu ppcu


gpocl is licensed under the GNU General Public License (GPL) Version 3 (or later), June 2007