Altera_Forum
Honored Contributor
11 years agoClarity regarding Altera OpenCL basics
Hi all,
I started my foray into OpenCL through GPUs, such as nVIDIA or AMD graphics cards. However I've recently moved onto research using FPGAs. Unfortunately even after querying the usual suspects (aocl_programming.pdf, Altera's online tutorials, etc.) I find myself no closer to understanding it. Usually when I install an OpenCL platform, I'd need to install an .icd into /etc/OpenCL/vendors (Ubuntu) or HKEY_LOCAL_MACHINE\SOFTWARE\Khronos\OpenCL\Vendors (Windows), which is used by the ICD loader to load the specific platform's library. This is true for Intel, nVidia and AMD, as far as I am aware. However this is not the case with the Altera OpenCL SDK? How does it define OpenCL functions (eg. clGetPlatformID(), etc.) if it does not even have the libOpenCL.so (in the Linux case) library? I've checked around if any of the libraries libalteracl.so act as stand-ins, but think I've just confused myself further. My confusion arises from the fact that the examples I've downloaded from Altera (written in C++) look similar to the code I've written when programming OpenCL for nVidia or AMD GPUs. When initializing contexts they call the exact same functions (eg. clGetDeviceInfo(), etc.), and these examples compile and execute just fine. However when I code my own host utility programs (written in C), the GCC spits out that several basic utility OpenCL functions are undefined:undefined reference to `clGetPlatformIDs'
undefined reference to `clGetPlatformInfo'
undefined reference to `clReleaseKernel'
undefined reference to `clReleaseProgram'
undefined reference to `clReleaseCommandQueue'
undefined reference to `clReleaseContext' What did I miss? I know that the host-side code must be compiled with GCC; I've done this all before with GPUs, but what is the difference when using Altera's OpenCL SDK? Regards, Victor