Task parallelism

I’m trying to parallelize Ant Colony Optimization metaheuristic (http://en.wikipedia.org/wiki/Ant_colony_optimization) with OpenCL, but i don’t know how can I enqueue a common C++ function, instead of a kernel. I need this for enqueue my ants.

Thanks.

You can try using a native kernel, clEnqueueNativeKernel, if your CL implementation supports it.

http://www.khronos.org/registry/cl/sdk/1.0/docs/man/xhtml/clEnqueueNativeKernel.html