The first parameter is wrong: ret = clGetDeviceIDs( platforms[1], CL_DEVICE_TYPE_ALL, 1, &device_id, &ret_num_devices); It should be platforms[0], or it won't run on an NVidia GPU.
The first parameter is wrong:
ret = clGetDeviceIDs( platforms[1], CL_DEVICE_TYPE_ALL, 1,
&device_id, &ret_num_devices);
It should be platforms[0], or it won't run on an NVidia GPU.