- A Visual Studio example project with guide on how to specify the include and library folders
- CMake support for Linux and Mac
- No exposed OpenCL or manual memory management calls, just the C++ STL.
- Parametrized kernel types, choose from processing
float
s,int
s orchar
s on your GPU. - Variable amount of input vectors
- Human readable OpenCL errors for easy debugging of your program.
std::vector<int> input_1 (5,5);
std::vector<int> input_2 { 1, 2, 3, 4, 5 };
try {
EasyOpenCL<int> framework (SHOW_DEBUG);
framework.loadKernel("arithmetic.cl");
framework.addInputBuffer(0, input_1);
framework.addInputBuffer(1, input_2);
framework.addOutputBuffer(2);
framework.runKernel();
framework.showOutputBuffer();
}
catch (std::exception& e) {
std::cerr << "Error: " << e.what() << std::endl;
}
For a more elaborate guide, follow example/VC++2013/README.md
- Clone or download this repository
- Open the example project solution (
example/VC++2013/EasyOpenCL.sln
) in Visual Studio - Specify the proper include and library directories using the guide in the README.md
- Build and run the example using
Ctrl-F5
git clone https://github.com/Gladdy/EasyOpenCL.git
cd EasyOpenCL
mkdir build && cd build
cmake ..
make
./test
- Dhruba Bandopadhyay: OpenCL Cookbook: Listing all devices and their critical attributes
- elhigu: cmake-findopencl
- Tom Scogland: OpenCL error checking