So, it appears that the problem I was experiencing was due to x86 vs 64bit. I changed the compiler settings to reference Win32 for linker and everything magically worked.
I also added a reference under the Linker Settings/Link libraries to the OpenCL.lib although I doubt that made the difference.
I ran a basic OpenCL device finder (https://www.sharcnet.ca/help/index.php/OpenCL) and it returned the info on my NVidia Quadro FX 570.
I will now begin to run various algorithms starting with some basic vector calculus (http://www.thebigblob.com/getting-started-with-opencl-and-gpu-computing/).
That is all for now.
Despite using the “-lOpenCL” flag in the linker options under the “Linker Settings” tab for the OpenCL compiler settings in Code::Blocks, I still receive the following build errors:
obj\Debug\main.o||In function `main’:|
C:\Users\txt103120\Desktop\CodeBlocks\device_check\main.cpp|27|undefined reference to `clGetPlatformIDs@12’|
C:\Users\txt103120\Desktop\CodeBlocks\device_check\main.cpp|29|undefined reference to `clGetDeviceIDs@24’|
C:\Users\txt103120\Desktop\CodeBlocks\device_check\main.cpp|44|undefined reference to `clGetDeviceInfo@20’|
C:\Users\txt103120\Desktop\CodeBlocks\device_check\main.cpp|71|undefined reference to `clGetDeviceInfo@20’|
||=== Build finished: 4 errors, 0 warnings ===|
I found this post on StackOverflow that seems relevant:
Now, I need to determine the course of action to resolve this.
So, I am following this setup process…
So far, it is a useful tutorial but there are a few caveats for someone not yet familiar with C++ and C::B that I thought are worth mentioning.
First: if you are using an NVIDIA GPU you need to DL/install the CUDA toolkit.
Then, when setting the compiler string (under Search Directories in C::B) for Windows it should look something like “C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v5.0\include”. This relates directly to the include statement at the beginning of your code, “#include <CL/cl.h>”. Similarly, your linker string should be something like “C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v5.0\lib\x64”.
Finally, I still received 4 errors after compiling the tutorial’s example code. I will post a resolution to those errors soon.