Aiming at increasing the OpenCL developing, I created some wizards to start up an OpenCL application project using the SDK from NVidia, AMD or Intel. I've used Anjuta DevStudio on Linux.
This is just a first approach, so don't be disappointed if you need to do some changes. The wizards give you a simple functional code and you can work on this one.
System requirements (they depend on your goal):
- NVidia: GPU Computing SDK code samples, CUDA Toolkit (http://developer.nvidia.com)
- AMD APP SDK (http://developer.amd.com)
- INTEL OpenCL SDK (http://software.intel.com/en-us/articles/opencl-sdk)
- Anjuta DevStudio 2.30+
Usually, files with .cl extension don't have any associated language specification. Download the opencl.lang (http://www.streamcomputing.eu/downloads/?opencl.lang, by the way, thanks to streamcomputing blog) and copy it to your ~/.local/share/gtksourceview-2.0/language-specs directory. Make a test opening a .cl file with gedit.
It is a versatile software development studio featuring a number of advanced programming facilities including project management, application wizard, interactive debugger, source editor, version control, GUI designer, profiler and many more tools. It focuses on providing simple and usable user interface, yet powerful for efficient development. [http://projects.gnome.org/anjuta/]
New OpenCL Wizards
Create (if that's not there) your ~/.local/share/anjuta/project
~/.local/share/anjuta/project$ wget https://sites.google.com/site/wendellrodrigues/projects/OpenCLWizards.tgz
~/.local/share/anjuta/project$ tar xvzf OpenCLWizards.tgz
Open anjuta and try to create a New Project.
Now we can see new types of project wizard in the C tab: AMD and Intel and in the C++ tab: AMD, Intel and NVidia.
AMD APP SDK
For C++ applications the process is similar. The file templates are based on Template and TemplateC from the SDK and the projects will be created (default) in "samples/opencl/myprojects/app". If you change the default destination, please be careful of relative references in the Makefile.
For NVidia applications we have only the C++. Even though the samples' code are standard C, the provided Makefile and includes are made targeting g++. That's not a problem and you can write your code in C as well as C++. The wizard will ask you for the "NVIDIA_GPU_Computing_SDK" path. By default, projects will be created in "OpenCL/myprojects".
Like for AMD SDK we have C and C++ wizards. But, they use Makefiles generated by the autotools. Intel SDK in Linux environments is not yet stable, so these wizards regard the folder where you have installed the lib64(yes, for Linux we have, until now, just the 64bits version) and include folders provided by the SDK package. By default projects will be installed at the same include and lib64 directory level.
Moreover, the Makefiles take into account these points:
- CL includes: -I../../include
- CL Dynamic Library: -lOpenCL (located at lib64/libOpenCL.so)
To run your OpenCL programs sometimes you need to define the work directory, executable and possible parameters.
I hope these wizards give you some curiosity to start programming in OpenCL. Feel free to ask me if you have any questions or just to comment.