/*! Returns the platform identifier for this device. */ QCLPlatform QCLDevice::platform() const { cl_platform_id plat; if (!m_id || clGetDeviceInfo(m_id, CL_DEVICE_PLATFORM, sizeof(plat), &plat, 0) != CL_SUCCESS) return QCLPlatform(); else return QCLPlatform(plat); }
/*! Returns a list of all OpenCL platforms that are supported by this host. */ QList<QCLPlatform> QCLPlatform::platforms() { cl_uint size; if (clGetPlatformIDs(0, 0, &size) != CL_SUCCESS) return QList<QCLPlatform>(); QVarLengthArray<cl_platform_id> buf(size); clGetPlatformIDs(size, buf.data(), &size); QList<QCLPlatform> platforms; for (int index = 0; index < buf.size(); ++index) platforms.append(QCLPlatform(buf[index])); return platforms; }