Reputation: 69
I want to use some external libraries (http://trac.osgeo.org/geos/) to perform some analytical tasks on Geometry objects(GIS). I want to perform these task using OpenCL on Cuda so that I can use the paralel power of GPU to perform these tasks in parallel on large set of data.So my question is:
Can I write kernel using these libraries?
Also How can I pass the objects of complex data structures of these libraries as an argument to the kernel/(in specific How can I create buffer of these complex objects??
Upvotes: 3
Views: 2401
Reputation: 10896
An OpenCL program mostly consists of two parts
It is upto your host code to compile/setup the kernel, fetch/set up the data from any library/source, translate it into the appropriate scalar, vector or other data types permissible in an OpenCL kernel, run the kernel(s) that process the data and get the results back from the compute device to the host (if necessary) and then translate those simple data types back to whatever form required for consumption by the rest of the code.
So no - you cannot directly use a regular C++ library from inside the kernel. But you can do whatever you want to in the host code.
Upvotes: 8
Reputation: 3678
No, you can't use external libraries in OpenCL kernels. Remember, any kernels is required to be compiled when the OpenCl application runs because it can't know what platform it is running on beforehand.
Upvotes: 6