I just installed the intel opencl sdk on ubuntu 15.10. I am trying to use it and for some reason I am only able to detect the nvidia opencl platform.
#include <CL/cl.h>
#include <stdio.h>
#include <stdlib.h>
int main()
{
cl_uint nids;
clGetPlatformIDs(0, NULL, &nids);
printf("Platforms = %d\n", nids);
cl_platform_id* plat_ids = malloc(sizeof(cl_platform_id) * nids);
clGetPlatformIDs(nids, plat_ids, NULL);
for(int i = 0; i < nids; i++)
{
char name[1000];
clGetPlatformInfo(plat_ids[i], CL_PLATFORM_VENDOR, 1000, name, NULL);
puts(name);
}
return 0;
}
This code outputs...
Platforms = 1
NVIDIA Corporation
This seems strange to me because I am not even linking with the nvidia libOpenCL.so. Here is my compile command from eclipse
make all
Building file: ../main.c
Invoking: GCC C Compiler
gcc -I/opt/intel/intel-opencl-1.2-6.0.0.1049/opencl-1.2-sdk-6.0.0.1049/include -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"main.d" -MT"main.o" -o "main.o" "../main.c"
Finished building: ../main.c
Building target: OpenCLTest
Invoking: GCC C Linker
gcc -L/opt/intel/intel-opencl-1.2-6.0.0.1049/opencl-1.2-6.0.0.1049/lib64 -o "OpenCLTest" ./main.o -lOpenCL
Finished building target: OpenCLTest
As you can see I only link with the Intel library.